From 0570658d2beb757ced6b9fdbd60c22b920c26e08 Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Fri, 12 Aug 2022 12:44:52 -0400 Subject: [PATCH 01/16] Update php style fixer yaml --- .github/workflows/php-cs-fixer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 7f44633..bca5c49 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -13,9 +13,9 @@ jobs: ref: ${{ github.head_ref }} - name: Run PHP CS Fixer - uses: docker://oskarstark/php-cs-fixer-ga:2.18.6 + uses: docker://oskarstark/php-cs-fixer-ga with: - args: --config=.php_cs.dist --allow-risky=yes + args: --allow-risky=yes - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 From 14c985d64bee54bd6c22203b9d47f010c4ecfbda Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Fri, 12 Aug 2022 12:47:10 -0400 Subject: [PATCH 02/16] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0296b57..d003269 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .idea .php_cs .php_cs.cache +.php-cs-fixer.cache .phpunit.result.cache build composer.lock From f157f4d3c6e9f121ce10a874c6df5a5a24c60c97 Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Fri, 12 Aug 2022 12:50:50 -0400 Subject: [PATCH 03/16] Update and rename .php-cs-fixer.dist.php --- .php_cs.dist => .php-cs-fixer.dist.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename .php_cs.dist => .php-cs-fixer.dist.php (80%) diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 80% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index c7d380c..040cfb5 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -13,14 +13,16 @@ ->ignoreDotFiles(true) ->ignoreVCS(true); -return PhpCsFixer\Config::create() +$config = new PhpCsFixer\Config(); +$config + ->setRiskyAllowed(true) ->setRules([ '@PSR2' => true, 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sortAlgorithm' => 'alpha'], + 'ordered_imports' => ['sort_algorithm' => 'alpha'], 'no_unused_imports' => true, 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline_array' => true, + 'trailing_comma_in_multiline' => true, 'phpdoc_scalar' => true, 'unary_operator_spaces' => true, 'binary_operator_spaces' => true, @@ -29,11 +31,6 @@ ], 'phpdoc_single_line_var_spacing' => true, 'phpdoc_var_without_name' => true, - 'class_attributes_separation' => [ - 'elements' => [ - 'method', - ], - ], 'method_argument_space' => [ 'on_multiline' => 'ensure_fully_multiline', 'keep_multiple_spaces_after_comma' => true, @@ -41,3 +38,5 @@ 'single_trait_insert_per_statement' => true, ]) ->setFinder($finder); + +return $config; From 54d4239bfdee2ec3ac82baa01d4e69c67670967e Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Sun, 14 Aug 2022 20:10:22 -0400 Subject: [PATCH 04/16] Decrease size of svg --- resources/views/partials/header.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/partials/header.blade.php b/resources/views/partials/header.blade.php index f3ab0c8..6eace83 100644 --- a/resources/views/partials/header.blade.php +++ b/resources/views/partials/header.blade.php @@ -12,7 +12,7 @@ version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" - class="location-pin" + class="location-pin w-4" viewBox="0 0 230.4 436.7" xml:space="preserve"> Date: Mon, 15 Aug 2022 11:19:13 -0400 Subject: [PATCH 05/16] Rename tipoff package variable --- src/SupportServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SupportServiceProvider.php b/src/SupportServiceProvider.php index 1f4dd2d..ac0894c 100644 --- a/src/SupportServiceProvider.php +++ b/src/SupportServiceProvider.php @@ -6,9 +6,9 @@ class SupportServiceProvider extends TipoffServiceProvider { - public function configureTipoffPackage(TipoffPackage $package): void + public function configureTipoffPackage(TipoffPackage $tipoffpackage): void { - $package + $tipoffpackage ->hasBladeComponents([ 'money' => Money::class, ]) From f5791b7d7f24a75bf482c919f65882630613382b Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Mon, 15 Aug 2022 11:21:17 -0400 Subject: [PATCH 06/16] Fix capitalization typo --- src/SupportServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SupportServiceProvider.php b/src/SupportServiceProvider.php index ac0894c..088f2c0 100644 --- a/src/SupportServiceProvider.php +++ b/src/SupportServiceProvider.php @@ -6,9 +6,9 @@ class SupportServiceProvider extends TipoffServiceProvider { - public function configureTipoffPackage(TipoffPackage $tipoffpackage): void + public function configureTipoffPackage(TipoffPackage $tipoffPackage): void { - $tipoffpackage + $tipoffPackage ->hasBladeComponents([ 'money' => Money::class, ]) From ac62025005ecd9799ad07e4fa56fa6757884984c Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Mon, 15 Aug 2022 11:26:15 -0400 Subject: [PATCH 07/16] Remove string condition to pass psalm test --- src/Nova/Fields/Enum.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Nova/Fields/Enum.php b/src/Nova/Fields/Enum.php index e9e95fb..34fb12a 100644 --- a/src/Nova/Fields/Enum.php +++ b/src/Nova/Fields/Enum.php @@ -26,8 +26,9 @@ function ($value) { } ); } - - public function attach(string $class): self + + // public function attach(string $class): self + public function attach($class): self { Assert::that($class)->subclassOf(BaseEnum::class); $options = call_user_func([$class, 'optionsArray']); From cf10781c314a483507fb5561ade94a4f06c758aa Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Mon, 15 Aug 2022 11:32:25 -0400 Subject: [PATCH 08/16] Add docblock for psalm --- src/Nova/Fields/Enum.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Nova/Fields/Enum.php b/src/Nova/Fields/Enum.php index 34fb12a..3176ea8 100644 --- a/src/Nova/Fields/Enum.php +++ b/src/Nova/Fields/Enum.php @@ -27,8 +27,10 @@ function ($value) { ); } - // public function attach(string $class): self - public function attach($class): self + /** + * @param-out string $s + */ + public function attach(string $class): self { Assert::that($class)->subclassOf(BaseEnum::class); $options = call_user_func([$class, 'optionsArray']); From 754fb2c1b4ca0745af8f05fe6c718037611289ac Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Mon, 15 Aug 2022 11:35:34 -0400 Subject: [PATCH 09/16] Update psalm docblock --- src/Nova/Fields/Enum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nova/Fields/Enum.php b/src/Nova/Fields/Enum.php index 3176ea8..99f810f 100644 --- a/src/Nova/Fields/Enum.php +++ b/src/Nova/Fields/Enum.php @@ -28,7 +28,7 @@ function ($value) { } /** - * @param-out string $s + * @param-out string $class */ public function attach(string $class): self { From d94677822fd336abc66b616ec0076ba19895e261 Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Mon, 15 Aug 2022 16:30:30 -0400 Subject: [PATCH 10/16] Change docblock to var --- src/Nova/Fields/Enum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nova/Fields/Enum.php b/src/Nova/Fields/Enum.php index 99f810f..d2a95c0 100644 --- a/src/Nova/Fields/Enum.php +++ b/src/Nova/Fields/Enum.php @@ -28,7 +28,7 @@ function ($value) { } /** - * @param-out string $class + * @var string $class */ public function attach(string $class): self { From 5ec2db2548aac86d5c7c76c0e4641ae1f979242f Mon Sep 17 00:00:00 2001 From: drewroberts Date: Mon, 15 Aug 2022 20:30:50 +0000 Subject: [PATCH 11/16] Fix styling --- src/Nova/Fields/Enum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nova/Fields/Enum.php b/src/Nova/Fields/Enum.php index d2a95c0..a7697cc 100644 --- a/src/Nova/Fields/Enum.php +++ b/src/Nova/Fields/Enum.php @@ -28,7 +28,7 @@ function ($value) { } /** - * @var string $class + * @var string */ public function attach(string $class): self { From fb1f6fb213a1bbdde19d0a47b46ccea7e92343f3 Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Tue, 16 Aug 2022 15:51:54 -0400 Subject: [PATCH 12/16] Upadate docblock to param --- src/Nova/Fields/Enum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nova/Fields/Enum.php b/src/Nova/Fields/Enum.php index a7697cc..02fc729 100644 --- a/src/Nova/Fields/Enum.php +++ b/src/Nova/Fields/Enum.php @@ -28,7 +28,7 @@ function ($value) { } /** - * @var string + * @param string */ public function attach(string $class): self { From eb7e7e08fc9a081d0e6a3f2234fa2be062bb8320 Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Wed, 17 Aug 2022 10:57:41 -0400 Subject: [PATCH 13/16] Update docblock to suppress psalm --- src/Nova/Fields/Enum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nova/Fields/Enum.php b/src/Nova/Fields/Enum.php index 02fc729..b76962b 100644 --- a/src/Nova/Fields/Enum.php +++ b/src/Nova/Fields/Enum.php @@ -28,7 +28,7 @@ function ($value) { } /** - * @param string + * @psalm-suppress PossiblyNullOperand */ public function attach(string $class): self { From 1b233bc7608309addfdc1dff6f10349edba1eacc Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Wed, 17 Aug 2022 11:04:12 -0400 Subject: [PATCH 14/16] Update docblock to return string --- src/Nova/Fields/Enum.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Nova/Fields/Enum.php b/src/Nova/Fields/Enum.php index b76962b..687f097 100644 --- a/src/Nova/Fields/Enum.php +++ b/src/Nova/Fields/Enum.php @@ -27,9 +27,7 @@ function ($value) { ); } - /** - * @psalm-suppress PossiblyNullOperand - */ + /** @return string */ public function attach(string $class): self { Assert::that($class)->subclassOf(BaseEnum::class); From e1bdaa932bbc635276da176cf121a6f341cf0b74 Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Wed, 17 Aug 2022 11:10:30 -0400 Subject: [PATCH 15/16] Update docblock for return rules --- src/Nova/Fields/Enum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nova/Fields/Enum.php b/src/Nova/Fields/Enum.php index 687f097..b52956e 100644 --- a/src/Nova/Fields/Enum.php +++ b/src/Nova/Fields/Enum.php @@ -27,7 +27,7 @@ function ($value) { ); } - /** @return string */ + /** @return Tipoff\Support\Nova\Fields\Enum */ public function attach(string $class): self { Assert::that($class)->subclassOf(BaseEnum::class); From a86b05e7643e901f5a2d30a9f3cb3ffd03179ddc Mon Sep 17 00:00:00 2001 From: Drew Roberts Date: Wed, 17 Aug 2022 11:14:33 -0400 Subject: [PATCH 16/16] Return tipoff enum --- src/Nova/Fields/Enum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nova/Fields/Enum.php b/src/Nova/Fields/Enum.php index b52956e..aeef3c6 100644 --- a/src/Nova/Fields/Enum.php +++ b/src/Nova/Fields/Enum.php @@ -27,7 +27,7 @@ function ($value) { ); } - /** @return Tipoff\Support\Nova\Fields\Enum */ + /** @return 'Tipoff\Support\Nova\Fields\Enum' */ public function attach(string $class): self { Assert::that($class)->subclassOf(BaseEnum::class);