From d9cf2415068433eb799ef5e27fa6867329100d88 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 09:45:21 -0400 Subject: [PATCH 01/14] Install and initialize Duster --- .github/workflows/lint.yml | 53 +++++++ .phpcs.xml.dist | 12 ++ composer.json | 6 +- composer.lock | 294 ++++++++++++++++++++++++++++++++++++- 4 files changed, 362 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .phpcs.xml.dist diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..fc22a35 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,53 @@ +name: Lint + +on: + push: + branches: [ main ] + pull_request: + +jobs: + phpcs: + name: PHPCS + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.0 + extensions: posix, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Install dependencies + run: composer install --no-interaction --no-suggest --ignore-platform-reqs + + - name: PHPCS lint + uses: chekalsky/phpcs-action@v1 + with: + phpcs_bin_path: './vendor/bin/phpcs' + + tlint: + name: TLint + + continue-on-error: false + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.0 + extensions: posix, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Install dependencies + run: composer install --no-interaction --no-suggest --ignore-platform-reqs + + - name: Tlint Lint + run: vendor/bin/tlint diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist new file mode 100644 index 0000000..5ffcf8e --- /dev/null +++ b/.phpcs.xml.dist @@ -0,0 +1,12 @@ + + + app + config + database + public + resources + routes + tests + + + diff --git a/composer.json b/composer.json index 299b7e8..b0f48b0 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,8 @@ "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^6.1", "phpunit/phpunit": "^9.5.10", - "spatie/laravel-ignition": "^1.0" + "spatie/laravel-ignition": "^1.0", + "tightenco/duster": "^0.3.2" }, "autoload": { "psr-4": { @@ -57,7 +58,8 @@ "preferred-install": "dist", "sort-packages": true, "allow-plugins": { - "pestphp/pest-plugin": true + "pestphp/pest-plugin": true, + "dealerdirect/phpcodesniffer-composer-installer": true } }, "minimum-stability": "dev", diff --git a/composer.lock b/composer.lock index fe82701..287d1c8 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": "ccbd816a07b206f971042295b899d1ba", + "content-hash": "edc5ef85a08ad3f9d2b10904032cfb71", "packages": [ { "name": "brick/math", @@ -5175,6 +5175,81 @@ } ], "packages-dev": [ + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.2", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "time": "2022-02-04T12:51:07+00:00" + }, { "name": "doctrine/instantiator", "version": "1.4.1", @@ -7850,6 +7925,62 @@ ], "time": "2022-06-17T06:28:57+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "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" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2022-06-18T07:21:10+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.1", @@ -7899,6 +8030,167 @@ } ], "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "tightenco/duster", + "version": "v0.3.2", + "source": { + "type": "git", + "url": "https://github.com/tighten/duster.git", + "reference": "f2459c92f9288a542033cc0b814f1f94b32b0fc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tighten/duster/zipball/f2459c92f9288a542033cc0b814f1f94b32b0fc1", + "reference": "f2459c92f9288a542033cc0b814f1f94b32b0fc1", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0", + "phpunit/phpunit": "^9.0", + "squizlabs/php_codesniffer": "^3.5", + "tightenco/tighten-coding-standard": "^1.0", + "tightenco/tlint": "^6.0" + }, + "bin": [ + "bin/duster" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Stauffer", + "email": "matt@tighten.co", + "homepage": "https://tighten.co", + "role": "Developer" + } + ], + "description": "Automatic configuration for Laravel apps to apply Tighten's standard linting & code standards.", + "homepage": "https://github.com/tighten/duster", + "keywords": [ + "Code style", + "duster", + "laravel", + "php", + "phpcs", + "tightenco" + ], + "support": { + "issues": "https://github.com/tighten/duster/issues", + "source": "https://github.com/tighten/duster/tree/v0.3.2" + }, + "time": "2021-08-20T15:23:52+00:00" + }, + { + "name": "tightenco/tighten-coding-standard", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/tighten/tighten-coding-standard.git", + "reference": "0d4812d996acedb07b4bca851d84ce9024cc85de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tighten/tighten-coding-standard/zipball/0d4812d996acedb07b4bca851d84ce9024cc85de", + "reference": "0d4812d996acedb07b4bca851d84ce9024cc85de", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", + "php": "^7.3|^8.0", + "squizlabs/php_codesniffer": "^3.5" + }, + "require-dev": { + "phpunit/phpunit": "^9.0", + "tightenco/tlint": "^5.0" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "Tighten\\TightenCodingStandard\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Stauffer", + "email": "matt@tighten.co", + "homepage": "https://tighten.co", + "role": "Developer" + } + ], + "description": "A PHP Code_Sniffer configuration for the Tighten coding standard.", + "homepage": "https://github.com/tighten/tighten-coding-standard", + "keywords": [ + "php", + "tighten-coding-standard", + "tightenco" + ], + "support": { + "issues": "https://github.com/tighten/tighten-coding-standard/issues", + "source": "https://github.com/tighten/tighten-coding-standard/tree/v1.0.2" + }, + "time": "2021-08-20T00:11:14+00:00" + }, + { + "name": "tightenco/tlint", + "version": "v6.3.0", + "source": { + "type": "git", + "url": "https://github.com/tighten/tlint.git", + "reference": "001743e6560757a1a225196e613f11cd8fdb8421" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tighten/tlint/zipball/001743e6560757a1a225196e613f11cd8fdb8421", + "reference": "001743e6560757a1a225196e613f11cd8fdb8421", + "shasum": "" + }, + "require": { + "illuminate/view": "*", + "nikic/php-parser": "^4.12", + "php": ">=7.3", + "symfony/console": "^4.4.30 || ^5.3.7 || ^6.0", + "symfony/process": "^4.4.20 || ^5.0.9 || ^6.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.1", + "phpunit/phpunit": "^8.5.16 || ^9.0", + "symfony/var-dumper": "^5.0" + }, + "bin": [ + "bin/tlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Tighten\\TLint\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Logan Henson", + "email": "logan@loganhenson.com", + "role": "Developer" + } + ], + "description": "Tighten linter for Laravel conventions", + "homepage": "https://github.com/tighten/tlint", + "support": { + "issues": "https://github.com/tighten/tlint/issues", + "source": "https://github.com/tighten/tlint/tree/v6.3.0" + }, + "time": "2022-04-25T18:24:39+00:00" } ], "aliases": [], From a907ffc5cb9c45ec267cc8c91d5d4f54d42a0eb5 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 09:48:09 -0400 Subject: [PATCH 02/14] Update action version --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fc22a35..bc25706 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,7 +25,7 @@ jobs: run: composer install --no-interaction --no-suggest --ignore-platform-reqs - name: PHPCS lint - uses: chekalsky/phpcs-action@v1 + uses: chekalsky/phpcs-action@v1.2 with: phpcs_bin_path: './vendor/bin/phpcs' From 9431e27a37807609e49e12d30641de9e1df0b08b Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 09:48:54 -0400 Subject: [PATCH 03/14] Update action version --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bc25706..fc22a35 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,7 +25,7 @@ jobs: run: composer install --no-interaction --no-suggest --ignore-platform-reqs - name: PHPCS lint - uses: chekalsky/phpcs-action@v1.2 + uses: chekalsky/phpcs-action@v1 with: phpcs_bin_path: './vendor/bin/phpcs' From 4834825cdec1b61469bf28ebe701c581d9dd04a8 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:00:26 -0400 Subject: [PATCH 04/14] Use thenabeel/action-phpcs for linting --- .github/workflows/lint.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fc22a35..c8bbdb9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,9 +25,11 @@ jobs: run: composer install --no-interaction --no-suggest --ignore-platform-reqs - name: PHPCS lint - uses: chekalsky/phpcs-action@v1 + uses: thenabeel/action-phpcs@v8 with: - phpcs_bin_path: './vendor/bin/phpcs' + files: "**.php" + phpcs_path: './vendor/bin/phpcs' + standard: .phpcs.xml.dist tlint: name: TLint From 076fdc85bd67eb953b6cb43349dba4a6d84e7b2a Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:06:18 -0400 Subject: [PATCH 05/14] Set scope to files --- .github/workflows/lint.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c8bbdb9..cafba49 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,8 +27,9 @@ jobs: - name: PHPCS lint uses: thenabeel/action-phpcs@v8 with: - files: "**.php" - phpcs_path: './vendor/bin/phpcs' + scope: files + files: '**.php' + phpcs_path: ./vendor/bin/phpcs standard: .phpcs.xml.dist tlint: From 82c81e75fbb6a0f960c49356fb7b830aabb409a3 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:08:44 -0400 Subject: [PATCH 06/14] Run phpcs directly --- .github/workflows/lint.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cafba49..1ab5acb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,12 +25,7 @@ jobs: run: composer install --no-interaction --no-suggest --ignore-platform-reqs - name: PHPCS lint - uses: thenabeel/action-phpcs@v8 - with: - scope: files - files: '**.php' - phpcs_path: ./vendor/bin/phpcs - standard: .phpcs.xml.dist + run: vendor/bin/phpcs tlint: name: TLint From 6cf7345ed5ff100b63003837451fdbad5fc2911a Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:13:29 -0400 Subject: [PATCH 07/14] Fix with Duster --- app/Console/Kernel.php | 2 +- app/Http/Controllers/Controller.php | 4 +++- app/Models/User.php | 4 +++- config/broadcasting.php | 2 +- config/cache.php | 2 +- config/database.php | 2 +- config/filesystems.php | 2 +- config/logging.php | 2 +- config/session.php | 2 +- public/index.php | 6 +++--- tests/CreatesApplication.php | 2 +- 11 files changed, 17 insertions(+), 13 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index d8bc1d2..e1d9417 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -25,7 +25,7 @@ protected function schedule(Schedule $schedule) */ protected function commands() { - $this->load(__DIR__.'/Commands'); + $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index a0a2a8a..ce1176d 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -9,5 +9,7 @@ class Controller extends BaseController { - use AuthorizesRequests, DispatchesJobs, ValidatesRequests; + use AuthorizesRequests; + use DispatchesJobs; + use ValidatesRequests; } diff --git a/app/Models/User.php b/app/Models/User.php index 23b4063..ffdc1d5 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -10,7 +10,9 @@ class User extends Authenticatable { - use HasApiTokens, HasFactory, Notifiable; + use HasApiTokens; + use HasFactory; + use Notifiable; /** * The attributes that are mass assignable. diff --git a/config/broadcasting.php b/config/broadcasting.php index 1688242..3fe737e 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -36,7 +36,7 @@ 'secret' => env('PUSHER_APP_SECRET'), 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'host' => env('PUSHER_HOST', 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', + 'host' => env('PUSHER_HOST', 'api-' . env('PUSHER_APP_CLUSTER', 'mt1') . '.pusher.com') ?: 'api-' . env('PUSHER_APP_CLUSTER', 'mt1') . '.pusher.com', 'port' => env('PUSHER_PORT', 443), 'scheme' => env('PUSHER_SCHEME', 'https'), 'encrypted' => true, diff --git a/config/cache.php b/config/cache.php index 33bb295..daf5e68 100644 --- a/config/cache.php +++ b/config/cache.php @@ -105,6 +105,6 @@ | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'), ]; diff --git a/config/database.php b/config/database.php index 137ad18..535cd52 100644 --- a/config/database.php +++ b/config/database.php @@ -125,7 +125,7 @@ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), ], 'default' => [ diff --git a/config/filesystems.php b/config/filesystems.php index e9d9dbd..4afc1fc 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -39,7 +39,7 @@ 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => env('APP_URL') . '/storage', 'visibility' => 'public', 'throw' => false, ], diff --git a/config/logging.php b/config/logging.php index 5aa1dbb..752af71 100644 --- a/config/logging.php +++ b/config/logging.php @@ -85,7 +85,7 @@ 'handler_with' => [ 'host' => env('PAPERTRAIL_URL'), 'port' => env('PAPERTRAIL_PORT'), - 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), + 'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'), ], ], diff --git a/config/session.php b/config/session.php index 8fed97c..1b99f22 100644 --- a/config/session.php +++ b/config/session.php @@ -128,7 +128,7 @@ 'cookie' => env( 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_').'_session' + Str::slug(env('APP_NAME', 'laravel'), '_') . '_session' ), /* diff --git a/public/index.php b/public/index.php index 1d69f3a..f3c2ebc 100644 --- a/public/index.php +++ b/public/index.php @@ -16,7 +16,7 @@ | */ -if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) { +if (file_exists($maintenance = __DIR__ . '/../storage/framework/maintenance.php')) { require $maintenance; } @@ -31,7 +31,7 @@ | */ -require __DIR__.'/../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; /* |-------------------------------------------------------------------------- @@ -44,7 +44,7 @@ | */ -$app = require_once __DIR__.'/../bootstrap/app.php'; +$app = require_once __DIR__ . '/../bootstrap/app.php'; $kernel = $app->make(Kernel::class); diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index 547152f..ab92402 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -13,7 +13,7 @@ trait CreatesApplication */ public function createApplication() { - $app = require __DIR__.'/../bootstrap/app.php'; + $app = require __DIR__ . '/../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); From 7a2f534cba1592375e95b7c55e118067156a1cc9 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:19:43 -0400 Subject: [PATCH 08/14] Ignore phpcs warnings on exit --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1ab5acb..a61d4e2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,7 +25,7 @@ jobs: run: composer install --no-interaction --no-suggest --ignore-platform-reqs - name: PHPCS lint - run: vendor/bin/phpcs + run: vendor/bin/phpcs --config-set ignore_warnings_on_exit 1 tlint: name: TLint From 5dffe2fe7e2a7b0d78f3d7a8fcb02df2d6e3e40c Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:23:33 -0400 Subject: [PATCH 09/14] Set warning severity --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a61d4e2..84f7655 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,7 +25,7 @@ jobs: run: composer install --no-interaction --no-suggest --ignore-platform-reqs - name: PHPCS lint - run: vendor/bin/phpcs --config-set ignore_warnings_on_exit 1 + run: vendor/bin/phpcs --warning-severity=0 tlint: name: TLint From 359988219cf0ef2caa7625d95922012c42f19e89 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:33:21 -0400 Subject: [PATCH 10/14] Test linting in CI --- app/Http/Controllers/Controller.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index ce1176d..a0a2a8a 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -9,7 +9,5 @@ class Controller extends BaseController { - use AuthorizesRequests; - use DispatchesJobs; - use ValidatesRequests; + use AuthorizesRequests, DispatchesJobs, ValidatesRequests; } From dde06ffae11a7a67e0bc44454738e9ca5bbeb6a0 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:34:56 -0400 Subject: [PATCH 11/14] Fix linting errors --- app/Http/Controllers/Controller.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index a0a2a8a..ce1176d 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -9,5 +9,7 @@ class Controller extends BaseController { - use AuthorizesRequests, DispatchesJobs, ValidatesRequests; + use AuthorizesRequests; + use DispatchesJobs; + use ValidatesRequests; } From efd905282aeba7d3c7c1f4ac787dd76e54a23710 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:39:35 -0400 Subject: [PATCH 12/14] Fix tlint errors --- app/Providers/EventServiceProvider.php | 1 - .../2014_10_12_000000_create_users_table.php | 10 ---------- .../2014_10_12_100000_create_password_resets_table.php | 10 ---------- .../2019_08_19_000000_create_failed_jobs_table.php | 10 ---------- ...2_14_000001_create_personal_access_tokens_table.php | 10 ---------- 5 files changed, 41 deletions(-) diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index ab8b2cf..474b6c1 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -5,7 +5,6 @@ use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -use Illuminate\Support\Facades\Event; class EventServiceProvider extends ServiceProvider { diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index cf6b776..34c79fe 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -6,11 +6,6 @@ return new class extends Migration { - /** - * Run the migrations. - * - * @return void - */ public function up() { Schema::create('users', function (Blueprint $table) { @@ -24,11 +19,6 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::dropIfExists('users'); diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php index fcacb80..cb07396 100644 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -6,11 +6,6 @@ return new class extends Migration { - /** - * Run the migrations. - * - * @return void - */ public function up() { Schema::create('password_resets', function (Blueprint $table) { @@ -20,11 +15,6 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::dropIfExists('password_resets'); diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php index 1719198..f22af77 100644 --- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php @@ -6,11 +6,6 @@ return new class extends Migration { - /** - * Run the migrations. - * - * @return void - */ public function up() { Schema::create('failed_jobs', function (Blueprint $table) { @@ -24,11 +19,6 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::dropIfExists('failed_jobs'); diff --git a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php index 6c81fd2..d362751 100644 --- a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php +++ b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php @@ -6,11 +6,6 @@ return new class extends Migration { - /** - * Run the migrations. - * - * @return void - */ public function up() { Schema::create('personal_access_tokens', function (Blueprint $table) { @@ -25,11 +20,6 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::dropIfExists('personal_access_tokens'); From dfa28b397d5ec706f2a569b19f38eda33b891d3c Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:42:12 -0400 Subject: [PATCH 13/14] Trigger github action --- app/Http/Controllers/Controller.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index ce1176d..a0a2a8a 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -9,7 +9,5 @@ class Controller extends BaseController { - use AuthorizesRequests; - use DispatchesJobs; - use ValidatesRequests; + use AuthorizesRequests, DispatchesJobs, ValidatesRequests; } From 0e911b2369f1cfaf59cffc9907c9283b1f49a491 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Aug 2022 10:43:22 -0400 Subject: [PATCH 14/14] Trigger github action --- app/Http/Controllers/Controller.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index a0a2a8a..ce1176d 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -9,5 +9,7 @@ class Controller extends BaseController { - use AuthorizesRequests, DispatchesJobs, ValidatesRequests; + use AuthorizesRequests; + use DispatchesJobs; + use ValidatesRequests; }