From bf2fd2644872acb4726a995deb3f8d4d56bfea1f Mon Sep 17 00:00:00 2001 From: Joel Clermont Date: Fri, 15 Dec 2023 13:50:12 -0600 Subject: [PATCH] update to php-cs-fixer and NoCompromises standard --- .gitignore | 1 + .php-cs-fixer.php | 5 + README.md | 21 +- app/Console/Kernel.php | 5 +- app/Exceptions/Handler.php | 6 +- app/Http/Middleware/Authenticate.php | 4 +- app/Http/Middleware/EncryptCookies.php | 1 - .../PreventRequestsDuringMaintenance.php | 1 - .../Middleware/RedirectIfAuthenticated.php | 5 +- app/Http/Middleware/VerifyCsrfToken.php | 1 - app/Models/Permission.php | 4 +- app/Models/Role.php | 4 +- app/Providers/AppServiceProvider.php | 5 +- app/Providers/AuthServiceProvider.php | 4 - app/Providers/BroadcastServiceProvider.php | 2 - app/Providers/EventServiceProvider.php | 7 +- app/Providers/RouteServiceProvider.php | 4 - app/Providers/TelescopeServiceProvider.php | 10 +- composer.json | 23 +- composer.lock | 506 +++++++++++++----- config/app.php | 4 - config/auth.php | 2 - config/broadcasting.php | 4 - config/cache.php | 4 - config/cors.php | 2 - config/database.php | 6 - config/filesystems.php | 4 - config/hashing.php | 2 - config/logging.php | 2 - config/mail.php | 2 - config/queue.php | 4 - config/sanctum.php | 2 - config/sentry.php | 8 +- config/services.php | 2 - config/session.php | 2 - config/view.php | 2 - .../2014_10_12_000000_create_users_table.php | 4 - ...12_100000_create_password_resets_table.php | 4 - ..._08_19_000000_create_failed_jobs_table.php | 4 - ...01_create_personal_access_tokens_table.php | 4 - lang/en/auth.php | 2 - lang/en/pagination.php | 2 - lang/en/passwords.php | 2 - lang/en/validation.php | 2 - phpcs.xml | 67 --- public/index.php | 6 +- tests/Concerns/CreatesActingAs.php | 1 + tests/Concerns/DeepInspection.php | 11 +- tests/CreatesApplication.php | 2 +- tests/Exceptions/DatabaseAccessException.php | 6 +- tests/Feature/ExampleTest.php | 2 - tests/Unit/ExampleTest.php | 2 +- 52 files changed, 437 insertions(+), 355 deletions(-) create mode 100644 .php-cs-fixer.php delete mode 100644 phpcs.xml diff --git a/.gitignore b/.gitignore index 89f6dab..4e3f162 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ .env.backup .phpstan.cache .phpunit.cache +.php-cs-fixer.cache auth.json npm-debug.log /.idea diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..0eafd7e --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,5 @@ +, \Psr\Log\LogLevel::*> + * @var array, \Psr\Log\LogLevel::*> */ protected $levels = [ - // ]; /** * A list of the exception types that are not reported. * - * @var array> + * @var array> */ protected $dontReport = [ - // ]; /** diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index f82327f..5f51392 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -11,12 +11,12 @@ class Authenticate extends Middleware /** * Get the path the user should be redirected to when they are not authenticated. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return string|null */ protected function redirectTo($request) { - if (! $request->expectsJson()) { + if (!$request->expectsJson()) { return route('login'); } } diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index a293077..b92fc3a 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -14,6 +14,5 @@ class EncryptCookies extends Middleware * @var array */ protected $except = [ - // ]; } diff --git a/app/Http/Middleware/PreventRequestsDuringMaintenance.php b/app/Http/Middleware/PreventRequestsDuringMaintenance.php index d7353a2..ec89638 100644 --- a/app/Http/Middleware/PreventRequestsDuringMaintenance.php +++ b/app/Http/Middleware/PreventRequestsDuringMaintenance.php @@ -14,6 +14,5 @@ class PreventRequestsDuringMaintenance extends Middleware * @var array */ protected $except = [ - // ]; } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index e91927e..0cf94e0 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -14,9 +14,8 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next - * @param string|null ...$guards + * @param Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next + * @param string|null ...$guards * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ public function handle(Request $request, Closure $next, ...$guards) diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index c4527ee..ca4a6f4 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -14,6 +14,5 @@ class VerifyCsrfToken extends Middleware * @var array */ protected $except = [ - // ]; } diff --git a/app/Models/Permission.php b/app/Models/Permission.php index 85e11b6..d8f7a52 100644 --- a/app/Models/Permission.php +++ b/app/Models/Permission.php @@ -30,6 +30,4 @@ * @method static \Illuminate\Database\Eloquent\Builder|Permission whereUpdatedAt($value) * @mixin \Eloquent */ -class Permission extends \Spatie\Permission\Models\Permission -{ -} +class Permission extends \Spatie\Permission\Models\Permission {} diff --git a/app/Models/Role.php b/app/Models/Role.php index 512e094..ddd3a06 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -27,6 +27,4 @@ * @method static \Illuminate\Database\Eloquent\Builder|Role whereUpdatedAt($value) * @mixin \Eloquent */ -class Role extends \Spatie\Permission\Models\Role -{ -} +class Role extends \Spatie\Permission\Models\Role {} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 9e03f1e..348544c 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -21,8 +21,5 @@ protected function registerTelescopeInLocal(): void } } - public function boot() - { - // - } + public function boot() {} } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 5be952e..90329d7 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -20,13 +20,9 @@ class AuthServiceProvider extends ServiceProvider /** * Register any authentication / authorization services. - * - * @return void */ public function boot() { $this->registerPolicies(); - - // } } diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 9bd2786..4b7c407 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -11,8 +11,6 @@ class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. - * - * @return void */ public function boot() { diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 5c37f82..636bc49 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -23,13 +23,8 @@ class EventServiceProvider extends ServiceProvider /** * Register any events for your application. - * - * @return void */ - public function boot() - { - // - } + public function boot() {} /** * Determine if events and listeners should be automatically discovered. diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 821a5df..6a4a6f0 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -23,8 +23,6 @@ class RouteServiceProvider extends ServiceProvider /** * Define your route model bindings, pattern filters, and other route configuration. - * - * @return void */ public function boot() { @@ -42,8 +40,6 @@ public function boot() /** * Configure the rate limiters for the application. - * - * @return void */ protected function configureRateLimiting() { diff --git a/app/Providers/TelescopeServiceProvider.php b/app/Providers/TelescopeServiceProvider.php index dd92aec..904a95c 100644 --- a/app/Providers/TelescopeServiceProvider.php +++ b/app/Providers/TelescopeServiceProvider.php @@ -22,11 +22,11 @@ public function register(): void return true; } - return $entry->isReportableException() || - $entry->isFailedRequest() || - $entry->isFailedJob() || - $entry->isScheduledTask() || - $entry->hasMonitoredTag(); + return $entry->isReportableException() + || $entry->isFailedRequest() + || $entry->isFailedJob() + || $entry->isScheduledTask() + || $entry->hasMonitoredTag(); }); } diff --git a/composer.json b/composer.json index 7a8a129..4ef0eb5 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "nocompromises/my-project", "type": "project", - "license": "NO-LICENSE", + "license": "proprietary", "require": { "php": "^8.2", "ext-pdo": "*", @@ -22,12 +22,11 @@ "laravel/telescope": "^4.9", "laravel/tinker": "^2.8", "mockery/mockery": "^1.4.4", + "nocompromises/php-cs-fixer-config": "^1.0", "nunomaduro/collision": "^7.0", "phpstan/phpstan-mockery": "^1.1", "phpunit/phpunit": "^10.1", - "roave/security-advisories": "dev-latest", - "slevomat/coding-standard": "^8.3", - "squizlabs/php_codesniffer": "^3.7" + "roave/security-advisories": "dev-latest" }, "autoload": { "psr-4": { @@ -72,11 +71,11 @@ "@php artisan ide-helper:meta", "@php artisan ide-helper:models --write --reset" ], - "phpcbf": [ - "phpcbf" - ], "phpcs": [ - "phpcs -s" + "php-cs-fixer check" + ], + "phpcs-fix": [ + "php-cs-fixer fix" ], "larastan": [ "@php vendor/bin/phpstan analyse" @@ -103,9 +102,7 @@ "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true, - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } + "allow-plugins": {} }, "minimum-stability": "stable", "prefer-stable": true, @@ -114,8 +111,8 @@ "test-coverage": "Runs all unit tests with XDebug code coverage, outputs to tests/html-coverage", "test-external": "Runs the external test suite (tests that hit real APIs)", "ide-helper-update": "Updates the IDE helper files", - "phpcbf": "Runs PHP_CodeSniffer's code beautifier", - "phpcs": "Runs PHP_CodeSniffer", + "phpcs": "Runs php-cs-fixer on the configured files and reports errors", + "phpcs-fix": "Runs php-cs-fixer on the configured files and automatically fixes errors", "larastan": "Runs the Larastan (PHPStan)", "ci": "Runs tasks that should be done for integration: code sniffing, static analysis, and tests", "laravel-cache": "Runs Laravel caching commands (for CI and prod)" diff --git a/composer.lock b/composer.lock index a57ff74..6ac0445 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": "7c39713ac11fce7fb81b34b31afe4326", + "content-hash": "383144f873a0a80e18317c420cac54da", "packages": [ { "name": "brick/math", @@ -6516,39 +6516,35 @@ "time": "2023-10-11T07:11:09+00:00" }, { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", + "name": "composer/semver", + "version": "3.4.0", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.4", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "composer/composer": "*", - "ext-json": "*", - "ext-zip": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0", - "yoast/phpunit-polyfills": "^1.0" + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" }, - "type": "composer-plugin", + "type": "library", "extra": { - "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "branch-alias": { + "dev-main": "3.x-dev" + } }, "autoload": { "psr-4": { - "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -6557,41 +6553,114 @@ ], "authors": [ { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" + "semantic", + "semver", + "validation", + "versioning" ], "support": { - "issues": "https://github.com/PHPCSStandards/composer-installer/issues", - "source": "https://github.com/PHPCSStandards/composer-installer" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, - "time": "2023-01-05T11:28:13+00:00" + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" }, { "name": "doctrine/cache", @@ -7076,6 +7145,97 @@ ], "time": "2023-11-03T12:00:00+00:00" }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.41.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "8b6ae8dcbaf23f09680643ab832a4a3a260265f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8b6ae8dcbaf23f09680643ab832a4a3a260265f6", + "reference": "8b6ae8dcbaf23f09680643ab832a4a3a260265f6", + "shasum": "" + }, + "require": { + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", + "phpunit/phpunit": "^9.6", + "symfony/phpunit-bridge": "^6.3.8 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.41.1" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2023-12-10T19:59:27+00:00" + }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -7566,6 +7726,47 @@ }, "time": "2023-12-10T21:03:43+00:00" }, + { + "name": "nocompromises/php-cs-fixer-config", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/NoCompromises/php-cs-fixer-config.git", + "reference": "5e6a1eb518eff8a658dd44cd1eca3ed287c5520e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/NoCompromises/php-cs-fixer-config/zipball/5e6a1eb518eff8a658dd44cd1eca3ed287c5520e", + "reference": "5e6a1eb518eff8a658dd44cd1eca3ed287c5520e", + "shasum": "" + }, + "require": { + "friendsofphp/php-cs-fixer": "^3.40", + "php": "~8.2.0 || ~8.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "NoCompromises\\PhpCsFixer\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Clermont", + "email": "joel@nocompromises.io" + } + ], + "description": "The standard PHP CS Fixer config for No Compromises projects", + "support": { + "issues": "https://github.com/NoCompromises/php-cs-fixer-config/issues", + "source": "https://github.com/NoCompromises/php-cs-fixer-config/tree/1.0.0" + }, + "time": "2023-12-04T13:42:17+00:00" + }, { "name": "nunomaduro/collision", "version": "v7.10.0", @@ -10314,149 +10515,208 @@ "time": "2023-02-07T11:34:05+00:00" }, { - "name": "slevomat/coding-standard", - "version": "8.14.1", + "name": "symfony/filesystem", + "version": "v7.0.0", "source": { "type": "git", - "url": "https://github.com/slevomat/coding-standard.git", - "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926" + "url": "https://github.com/symfony/filesystem.git", + "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/fea1fd6f137cc84f9cba0ae30d549615dbc6a926", - "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/7da8ea2362a283771478c5f7729cfcb43a76b8b7", + "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", - "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.23.1", - "squizlabs/php_codesniffer": "^3.7.1" - }, - "require-dev": { - "phing/phing": "2.17.4", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.37", - "phpstan/phpstan-deprecation-rules": "1.1.4", - "phpstan/phpstan-phpunit": "1.3.14", - "phpstan/phpstan-strict-rules": "1.5.1", - "phpunit/phpunit": "8.5.21|9.6.8|10.3.5" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-master": "8.x-dev" - } + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" }, + "type": "library", "autoload": { "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard/" - } + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "keywords": [ - "dev", - "phpcs" + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.14.1" + "source": "https://github.com/symfony/filesystem/tree/v7.0.0" }, "funding": [ { - "url": "https://github.com/kukulich", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-10-08T07:28:08+00:00" + "time": "2023-07-27T06:33:22+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.8.0", + "name": "symfony/polyfill-php81", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "php": ">=7.1" }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Greg Sherwood", - "role": "Former lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "Current lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "phpcs", - "standards", - "static analysis" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", - "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", - "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" }, "funding": [ { - "url": "https://github.com/PHPCSStandards", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://github.com/jrfnl", + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a", + "reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2023-12-08T12:32:31+00:00" + "time": "2023-07-05T13:06:06+00:00" }, { "name": "theseer/tokenizer", diff --git a/config/app.php b/config/app.php index adcfc42..a7a8da0 100644 --- a/config/app.php +++ b/config/app.php @@ -5,7 +5,6 @@ use Illuminate\Support\Facades\Facade; return [ - /* |-------------------------------------------------------------------------- | Application Name @@ -157,7 +156,6 @@ */ 'providers' => [ - /* * Laravel Framework Service Providers... */ @@ -196,7 +194,6 @@ // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, - ], /* @@ -213,5 +210,4 @@ 'aliases' => Facade::defaultAliases()->merge([ // 'ExampleClass' => App\Example\ExampleClass::class, ])->toArray(), - ]; diff --git a/config/auth.php b/config/auth.php index 0f8b0ba..12c1e99 100644 --- a/config/auth.php +++ b/config/auth.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Authentication Defaults @@ -109,5 +108,4 @@ */ 'password_timeout' => 10800, - ]; diff --git a/config/broadcasting.php b/config/broadcasting.php index d0b85e7..5ba69c8 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Default Broadcaster @@ -31,7 +30,6 @@ */ 'connections' => [ - 'pusher' => [ 'driver' => 'pusher', 'key' => env('PUSHER_APP_KEY'), @@ -66,7 +64,5 @@ 'null' => [ 'driver' => 'null', ], - ], - ]; diff --git a/config/cache.php b/config/cache.php index 96efffe..f899303 100644 --- a/config/cache.php +++ b/config/cache.php @@ -5,7 +5,6 @@ use Illuminate\Support\Str; return [ - /* |-------------------------------------------------------------------------- | Default Cache Store @@ -34,7 +33,6 @@ */ 'stores' => [ - 'apc' => [ 'driver' => 'apc', ], @@ -93,7 +91,6 @@ 'octane' => [ 'driver' => 'octane', ], - ], /* @@ -108,5 +105,4 @@ */ 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'), - ]; diff --git a/config/cors.php b/config/cors.php index ec8d2d8..e51fb52 100644 --- a/config/cors.php +++ b/config/cors.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Cross-Origin Resource Sharing (CORS) Configuration @@ -32,5 +31,4 @@ 'max_age' => 0, 'supports_credentials' => false, - ]; diff --git a/config/database.php b/config/database.php index d220309..b7ebb90 100644 --- a/config/database.php +++ b/config/database.php @@ -5,7 +5,6 @@ use Illuminate\Support\Str; return [ - /* |-------------------------------------------------------------------------- | Default Database Connection Name @@ -36,7 +35,6 @@ */ 'connections' => [ - 'sqlite' => [ 'driver' => 'sqlite', 'url' => env('DATABASE_URL'), @@ -94,7 +92,6 @@ // 'encrypt' => env('DB_ENCRYPT', 'yes'), // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), ], - ], /* @@ -122,7 +119,6 @@ */ 'redis' => [ - 'client' => env('REDIS_CLIENT', 'phpredis'), 'options' => [ @@ -147,7 +143,5 @@ 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), ], - ], - ]; diff --git a/config/filesystems.php b/config/filesystems.php index 1e82bac..cd87122 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Default Filesystem Disk @@ -31,7 +30,6 @@ */ 'disks' => [ - 'local' => [ 'driver' => 'local', 'root' => storage_path('app'), @@ -57,7 +55,6 @@ 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 'throw' => false, ], - ], /* @@ -74,5 +71,4 @@ 'links' => [ public_path('storage') => storage_path('app/public'), ], - ]; diff --git a/config/hashing.php b/config/hashing.php index 41cba61..c30682f 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Default Hash Driver @@ -50,5 +49,4 @@ 'threads' => 1, 'time' => 4, ], - ]; diff --git a/config/logging.php b/config/logging.php index e360c22..31d8924 100644 --- a/config/logging.php +++ b/config/logging.php @@ -7,7 +7,6 @@ use Monolog\Handler\SyslogUdpHandler; return [ - /* |-------------------------------------------------------------------------- | Default Log Channel @@ -120,5 +119,4 @@ 'path' => storage_path('logs/laravel.log'), ], ], - ]; diff --git a/config/mail.php b/config/mail.php index 1c7e4c7..27985ca 100644 --- a/config/mail.php +++ b/config/mail.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Default Mailer @@ -116,5 +115,4 @@ resource_path('views/vendor/mail'), ], ], - ]; diff --git a/config/queue.php b/config/queue.php index 485dd98..398f210 100644 --- a/config/queue.php +++ b/config/queue.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Default Queue Connection Name @@ -31,7 +30,6 @@ */ 'connections' => [ - 'sync' => [ 'driver' => 'sync', ], @@ -72,7 +70,6 @@ 'block_for' => null, 'after_commit' => false, ], - ], /* @@ -91,5 +88,4 @@ 'database' => env('DB_CONNECTION', 'mysql'), 'table' => 'failed_jobs', ], - ]; diff --git a/config/sanctum.php b/config/sanctum.php index 66598f0..c06b0fb 100644 --- a/config/sanctum.php +++ b/config/sanctum.php @@ -5,7 +5,6 @@ use Laravel\Sanctum\Sanctum; return [ - /* |-------------------------------------------------------------------------- | Stateful Domains @@ -65,5 +64,4 @@ 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, ], - ]; diff --git a/config/sentry.php b/config/sentry.php index c1fa695..48bf0a5 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -9,7 +9,6 @@ declare(strict_types=1); return [ - // @see https://docs.sentry.io/product/sentry-basics/dsn-explainer/ 'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), @@ -21,13 +20,13 @@ 'environment' => env('SENTRY_ENVIRONMENT'), // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#sample-rate - 'sample_rate' => env('SENTRY_SAMPLE_RATE') === null ? 1.0 : (float)env('SENTRY_SAMPLE_RATE'), + 'sample_rate' => env('SENTRY_SAMPLE_RATE') === null ? 1.0 : (float) env('SENTRY_SAMPLE_RATE'), // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate - 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_TRACES_SAMPLE_RATE'), + 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_TRACES_SAMPLE_RATE'), // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#profiles-sample-rate - 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_PROFILES_SAMPLE_RATE'), + 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_PROFILES_SAMPLE_RATE'), // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send-default-pii 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false), @@ -107,5 +106,4 @@ // Enable the tracing integrations supplied by Sentry (recommended) 'default_integrations' => env('SENTRY_TRACE_DEFAULT_INTEGRATIONS_ENABLED', true), ], - ]; diff --git a/config/services.php b/config/services.php index 104826f..70d6d50 100644 --- a/config/services.php +++ b/config/services.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Third Party Services @@ -32,5 +31,4 @@ 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], - ]; diff --git a/config/session.php b/config/session.php index 5593f4e..e4cf628 100644 --- a/config/session.php +++ b/config/session.php @@ -5,7 +5,6 @@ use Illuminate\Support\Str; return [ - /* |-------------------------------------------------------------------------- | Default Session Driver @@ -199,5 +198,4 @@ */ 'same_site' => 'lax', - ]; diff --git a/config/view.php b/config/view.php index d9c90c0..89d7177 100644 --- a/config/view.php +++ b/config/view.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | View Storage Paths @@ -34,5 +33,4 @@ 'VIEW_COMPILED_PATH', realpath(storage_path('framework/views')) ), - ]; 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 84dfc30..5b6c74a 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -10,8 +10,6 @@ { /** * Run the migrations. - * - * @return void */ public function up() { @@ -28,8 +26,6 @@ public function up() /** * Reverse the migrations. - * - * @return void */ public function down() { 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 7c71d41..e208377 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 @@ -10,8 +10,6 @@ { /** * Run the migrations. - * - * @return void */ public function up() { @@ -24,8 +22,6 @@ public function up() /** * Reverse the migrations. - * - * @return void */ public function down() { 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 7c0cca6..7a47433 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 @@ -10,8 +10,6 @@ { /** * Run the migrations. - * - * @return void */ public function up() { @@ -28,8 +26,6 @@ public function up() /** * Reverse the migrations. - * - * @return void */ public function down() { 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 3924177..00eb8e4 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 @@ -10,8 +10,6 @@ { /** * Run the migrations. - * - * @return void */ public function up() { @@ -28,8 +26,6 @@ public function up() /** * Reverse the migrations. - * - * @return void */ public function down() { diff --git a/lang/en/auth.php b/lang/en/auth.php index e2de2ac..0564773 100644 --- a/lang/en/auth.php +++ b/lang/en/auth.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Authentication Language Lines @@ -18,5 +17,4 @@ 'failed' => 'These credentials do not match our records.', 'password' => 'The provided password is incorrect.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', - ]; diff --git a/lang/en/pagination.php b/lang/en/pagination.php index f03c42c..b106346 100644 --- a/lang/en/pagination.php +++ b/lang/en/pagination.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Pagination Language Lines @@ -17,5 +16,4 @@ 'previous' => '« Previous', 'next' => 'Next »', - ]; diff --git a/lang/en/passwords.php b/lang/en/passwords.php index 05f156a..b2a7d13 100644 --- a/lang/en/passwords.php +++ b/lang/en/passwords.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Password Reset Language Lines @@ -20,5 +19,4 @@ 'throttled' => 'Please wait before retrying.', 'token' => 'This password reset token is invalid.', 'user' => "We can't find a user with that email address.", - ]; diff --git a/lang/en/validation.php b/lang/en/validation.php index a97e61f..76872e0 100644 --- a/lang/en/validation.php +++ b/lang/en/validation.php @@ -3,7 +3,6 @@ declare(strict_types=1); return [ - /* |-------------------------------------------------------------------------- | Validation Language Lines @@ -168,5 +167,4 @@ */ 'attributes' => [], - ]; diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index bab4f92..0000000 --- a/phpcs.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - Coding standard for this project - - app - config - database - lang - routes - tests - - */bootstrap/cache/* - */tests/html-coverage/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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/Concerns/CreatesActingAs.php b/tests/Concerns/CreatesActingAs.php index a4d6292..91fb9ac 100644 --- a/tests/Concerns/CreatesActingAs.php +++ b/tests/Concerns/CreatesActingAs.php @@ -23,6 +23,7 @@ protected function createActingAs(array $properties = []): User { $this->actingAs = User::factory()->create($properties); $this->actingAs($this->actingAs); + return $this->actingAs; } } diff --git a/tests/Concerns/DeepInspection.php b/tests/Concerns/DeepInspection.php index 776fb05..6f2eda6 100644 --- a/tests/Concerns/DeepInspection.php +++ b/tests/Concerns/DeepInspection.php @@ -11,17 +11,13 @@ * Call protected or private method * * @note if you put a @throws on this, it'll start generating "non caught exceptions" in all of the tests in your IDE - * - * @param $object - * @param $methodName - * @param array $arguments - * @return mixed */ function callMethod($object, $methodName, array $arguments = []) { $class = new \ReflectionClass($object); $method = $class->getMethod($methodName); $method->setAccessible(true); + return empty($arguments) ? $method->invoke($object) : $method->invokeArgs($object, $arguments); } } @@ -31,16 +27,13 @@ function callMethod($object, $methodName, array $arguments = []) * Get protected or private property * * @note if you put a @throws on this, it'll start generating "non caught exceptions" in all of the tests in your IDE - * - * @param $object - * @param $propertyName - * @return mixed */ function getProperty($object, $propertyName) { $reflection = new \ReflectionClass($object); $property = $reflection->getProperty($propertyName); $property->setAccessible(true); + return $property->getValue($object); } } diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index c63a769..d6c0e07 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -4,8 +4,8 @@ namespace Tests; -use Illuminate\Foundation\Application; use Illuminate\Contracts\Console\Kernel; +use Illuminate\Foundation\Application; trait CreatesApplication { diff --git a/tests/Exceptions/DatabaseAccessException.php b/tests/Exceptions/DatabaseAccessException.php index 6219539..63e9ad2 100644 --- a/tests/Exceptions/DatabaseAccessException.php +++ b/tests/Exceptions/DatabaseAccessException.php @@ -8,6 +8,6 @@ namespace Tests\Exceptions; -class DatabaseAccessException extends \RuntimeException -{ -} +use RuntimeException; + +class DatabaseAccessException extends RuntimeException {} diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index 2a71f9a..99b7711 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -8,8 +8,6 @@ class ExampleTest extends FeatureTestCase { /** * A basic test example. - * - * @return void */ public function testHomeSuccess() { diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index 9a582f9..31ed3ff 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -8,6 +8,6 @@ class ExampleTest extends UnitTestCase { public function testTrueIsTrue() { - $this->assertTrue(true); + self::assertTrue(true); } }