diff --git a/Makefile b/Makefile index f8fdd70e..1067f1e2 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,10 @@ test: #php artisan database:create --reset vendor/bin/phpunit --debug --verbose +.PHONY: phpcs +phpcs: + @vendor/bin/phpcs -s --standard=phpcs.xml --colors + .PHONY: phpstan: vendor/bin/phpstan analyse -c phpstan.neon -v --level 2 app diff --git a/app/Console/Services/Importer.php b/app/Console/Services/Importer.php index 5c978716..28b76b15 100644 --- a/app/Console/Services/Importer.php +++ b/app/Console/Services/Importer.php @@ -419,7 +419,8 @@ class Importer ['icao' => $row->icao, 'subfleet_id' => $subfleet->id, 'active' => $row->enabled, - ]); + ] + ); $this->addMapping('aircraft', $row->id, $aircraft->id); diff --git a/app/Services/GeoService.php b/app/Services/GeoService.php index 8500c367..1d170021 100644 --- a/app/Services/GeoService.php +++ b/app/Services/GeoService.php @@ -306,7 +306,8 @@ class GeoService extends Service $flight->dpt_airport->icao, $flight->arr_airport->icao, [$flight->dpt_airport->lat, $flight->dpt_airport->lon], - $flight->route); + $flight->route + ); // lat, lon needs to be reversed for GeoJSON foreach ($all_route_points as $point) { diff --git a/composer.json b/composer.json index 552cf92f..02f80fcd 100755 --- a/composer.json +++ b/composer.json @@ -54,14 +54,15 @@ "webpatser/laravel-uuid": "3.*" }, "require-dev": { - "phpunit/phpunit": "7.5.*", - "barryvdh/laravel-ide-helper": "^2.0", "barryvdh/laravel-debugbar": "^3.0", - "mockery/mockery": "0.9.*", - "filp/whoops": "~2.0", + "barryvdh/laravel-ide-helper": "^2.0", "bpocallaghan/generators": "5.0.1", + "codedungeon/phpunit-result-printer": "^0.13.0", + "filp/whoops": "~2.0", + "mockery/mockery": "0.9.*", "nunomaduro/collision": "^2.0", - "codedungeon/phpunit-result-printer": "^0.13.0" + "phpunit/phpunit": "7.5.*", + "squizlabs/php_codesniffer": "3.*" }, "autoload": { "classmap": [ diff --git a/composer.lock b/composer.lock index 2eefc6ec..7ca77902 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ed94de0aeb7e741af9d56f1b364ddab0", + "content-hash": "a2ba5f306c64642928b51fcb4c1876cc", "packages": [ { "name": "akaunting/money", @@ -8190,6 +8190,57 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.4.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2019-04-10T23:49:02+00:00" + }, { "name": "theseer/tokenizer", "version": "1.1.2", diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 00000000..b9025657 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,12 @@ + + + phpvms coding standard + + + + + + + + app/ +