Skip to content

Commit 064b287

Browse files
committed
Fix styling issues
1 parent 1cb7861 commit 064b287

23 files changed

+142
-41
lines changed

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Make sure line endings are normalized to LF for Windows
2+
* text eol=lf
3+
4+
# Remove developer files from exports
5+
tests export-ignore
6+
.gitattributes export-ignore
7+
.gitignore export-ignore
8+
.php_cs export-ignore
9+
.travis.yml export-ignore
10+
phpunit.xml export-ignore
11+
sami_config.php export-ignore

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
build/
22
vendor/
33
composer.lock
4+
infection.json.dist
5+
infection-log.txt
46
psalm.xml

.php_cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
return require __DIR__ . '/vendor/riimu/php-cs-fixer-config/config.php';

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
language: php
2+
sudo: false
3+
4+
php:
5+
- 7.2
6+
7+
cache:
8+
directories:
9+
- build/.composer-cache
10+
11+
before_install:
12+
- export COMPOSER_CACHE_DIR="$(pwd)/build/.composer-cache"
13+
- export XDEBUG="/home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini"
14+
- mv -v "$XDEBUG" "$XDEBUG.disabled"
15+
16+
install:
17+
- mkdir -p build/php_codesniffer build/php-cs-fixer build/ocular
18+
- composer require --no-suggest --no-progress -n -a -d build/php-cs-fixer "friendsofphp/php-cs-fixer:^2.13"
19+
- composer require --no-suggest --no-progress -n -a -d build/php_codesniffer "squizlabs/php_codesniffer:^3.3"
20+
- composer require --no-suggest --no-progress -n -a -d build/ocular "scrutinizer/ocular:^1.5"
21+
- composer update --no-suggest --no-progress -n -a
22+
23+
script:
24+
- build/php_codesniffer/vendor/bin/phpcs -p --standard=PSR2 src tests
25+
- build/php-cs-fixer/vendor/bin/php-cs-fixer fix -v --dry-run --allow-risky=yes --using-cache=no
26+
- mv -v "$XDEBUG.disabled" "$XDEBUG"
27+
- vendor/bin/phpunit --coverage-clover=build/coverage.clover --coverage-text
28+
29+
after_script:
30+
- build/ocular/vendor/bin/ocular code-coverage:upload --format=php-clover build/coverage.clover

LICENSE

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright (c) 2018 Riikka Kalliomäki
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
the Software, and to permit persons to whom the Software is furnished to do so,
8+
subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
},
2323
"require-dev": {
2424
"simply/container": "^0.2.1",
25-
"phpunit/phpunit": "^7.2",
26-
"riimu/php-cs-fixer-config": "^0.1.0",
25+
"phpunit/phpunit": "^7.4",
26+
"riimu/php-cs-fixer-config": "^0.1.1",
2727
"riimu/sami-config": "^0.1.0"
2828
},
2929
"autoload": {

sami_config.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
return require __DIR__ . '/vendor/riimu/sami-config/config.php';

src/Connection/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function getConnection(): \PDO;
2626
* Inserts a row the database with given column values.
2727
* @param string $table Name of the table to insert
2828
* @param array $values Associative array of column values for the insert
29-
* @param string|null $primaryKey Name of automatic primary key column that will be overwritten with its value.
29+
* @param string|null $primaryKey Name of automatic primary key column that will be overwritten with its value
3030
* @return \PDOStatement The resulting PDO statement after executing the query
3131
*/
3232
public function insert(string $table, array $values, & $primaryKey = null): \PDOStatement;

src/Connection/MySqlConnection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function update(string $table, array $values, array $where): \PDOStatemen
6969
return $this->query($this->formatQuery([
7070
'UPDATE' => $this->formatTable($table),
7171
'SET' => $this->formatAssignments($values, $parameters),
72-
'WHERE' => $this->formatConditions($where, $parameters)
72+
'WHERE' => $this->formatConditions($where, $parameters),
7373
]), $parameters);
7474
}
7575

@@ -308,7 +308,7 @@ public function query(string $sql, array $parameters = []): \PDOStatement
308308
}
309309

310310
/**
311-
* Binds an SQL query parameter to the PDO statement fo the query
311+
* Binds an SQL query parameter to the PDO statement fo the query.
312312
* @param \PDOStatement $query The PDO statement for binding the value
313313
* @param int|string $name The name of the placeholder
314314
* @param mixed $value The value to bind

src/Connection/Provider/GenericConnectionProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function getConnection(): \PDO
5151

5252
/**
5353
* Initializes the PDO connection when first requested.
54-
* @return \PDO The initialized PDO connection.
54+
* @return \PDO The initialized PDO connection
5555
*/
5656
protected function initializeConnection(): \PDO
5757
{

0 commit comments

Comments
 (0)