From d32a57d231126600e1665d4e53b1d23b27bbcd09 Mon Sep 17 00:00:00 2001 From: s-damian Date: Tue, 8 Aug 2023 18:37:09 +0300 Subject: [PATCH] Optimize PHP CS Fixer rules --- composer.json | 2 +- pint.json | 19 +++++++++++++++++++ src/LarasortServiceProvider.php | 8 ++++---- src/Relations/Related.php | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 906d02a..f8b2cd8 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "laravel/pint": "^1.0", "phpunit/phpunit": "9.5.*", "orchestra/testbench": "^6", - "phpstan/phpstan": "^1.9" + "phpstan/phpstan": "^1.10" }, "autoload": { "psr-4" : { diff --git a/pint.json b/pint.json index 827ada5..400f0c1 100644 --- a/pint.json +++ b/pint.json @@ -1,6 +1,25 @@ { "preset": "laravel", "rules": { + "explicit_string_variable" : true, + "new_with_braces": { + "anonymous_class": true, + "named_class": true + }, + "ordered_class_elements" : { + "order" : [ + "use_trait", + "case", + "constant", + "property", + "construct", + "destruct", + "magic", + "phpunit", + "method_abstract", + "method" + ] + }, "ordered_traits": true } } \ No newline at end of file diff --git a/src/LarasortServiceProvider.php b/src/LarasortServiceProvider.php index df35fed..b62d98e 100644 --- a/src/LarasortServiceProvider.php +++ b/src/LarasortServiceProvider.php @@ -39,22 +39,22 @@ public function boot(): void // Blade Directives: Blade::directive('sortableUrl', function ($expression) { - return ""; + return ""; }); Blade::directive('sortableHref', function ($expression) { - return ""; + return ""; }); Blade::directive('sortableIcon', function ($expression) { - return ""; + return ""; }); Blade::directive('sortableLink', function ($expression) { $ex = explode(', ', $expression); $label = $ex[1] ?? null; - return ""; + return ""; }); } diff --git a/src/Relations/Related.php b/src/Relations/Related.php index 076deca..37164dc 100644 --- a/src/Relations/Related.php +++ b/src/Relations/Related.php @@ -178,6 +178,6 @@ final public function getTableColumnByUrl(): ?string $ex = explode(config('larasort.relation_column_separator'), request()->orderby); - return $this->getRelatedTable().'.'.$ex[1]; + return $this->getRelatedTable().'.'.$ex[1]; } }