diff --git a/.gitattributes b/.gitattributes index f8ab467..b76132f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ /.editorconfig export-ignore /.gitattributes export-ignore -/.php-cs-fixer.dist.php export-ignore +/.gitignore export-ignore +/pint.json export-ignore /rector.php export-ignore \ No newline at end of file diff --git a/.gitignore b/.gitignore index 97eb8a7..15e9032 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ +/.rector_cache /vendor -.php-cs-fixer.cache composer.lock \ No newline at end of file diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php deleted file mode 100644 index f0d08e5..0000000 --- a/.php-cs-fixer.dist.php +++ /dev/null @@ -1,164 +0,0 @@ - true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'default' => 'single_space', - 'operators' => ['=>' => null], - ], - 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => true, - 'blank_line_before_statement' => [ - 'statements' => ['return'], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => [ - 'elements' => [ - 'const' => 'one', - 'method' => 'one', - 'property' => 'one', - 'trait_import' => 'none', - ], - ], - 'class_definition' => [ - 'multi_line_extends_each_single_line' => true, - 'single_item_single_line' => true, - 'single_line' => true, - ], - 'concat_space' => [ - 'spacing' => 'none', - ], - 'constant_case' => ['case' => 'lower'], - 'declare_equal_normalize' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'fully_qualified_strict_types' => true, // added by Shift - 'function_declaration' => true, - 'function_typehint_space' => true, - 'general_phpdoc_tag_rename' => true, - 'heredoc_to_nowdoc' => true, - 'include' => true, - 'increment_style' => ['style' => 'post'], - 'indentation_type' => true, - 'linebreak_after_opening_tag' => true, - 'line_ending' => true, - 'lowercase_cast' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, // added from Symfony - 'magic_method_casing' => true, // added from Symfony - 'magic_constant_casing' => true, - 'method_argument_space' => [ - 'on_multiline' => 'ignore', - ], - 'multiline_whitespace_before_semicolons' => [ - 'strategy' => 'no_multi_line', - ], - 'native_function_casing' => true, - 'no_alias_functions' => true, - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'extra', - 'throw', - 'use', - ], - ], - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_closing_tag' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => [ - 'use' => 'echo', - ], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_short_bool_cast' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_around_offset' => [ - 'positions' => ['inside', 'outside'], - ], - 'no_spaces_inside_parenthesis' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => [ - 'statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield'], - ], - 'no_unreachable_default_argument_value' => true, - 'no_unused_imports' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'normalize_index_brace' => true, - 'not_operator_with_successor_space' => true, - 'object_operator_without_whitespace' => true, - 'ordered_imports' => ['sort_algorithm' => 'alpha'], - 'psr_autoloading' => true, - 'phpdoc_indent' => true, - 'phpdoc_inline_tag_normalizer' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_scalar' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_summary' => false, - 'phpdoc_to_comment' => false, // override to preserve user preference - 'phpdoc_tag_type' => true, - 'phpdoc_trim' => true, - 'phpdoc_types' => true, - 'phpdoc_var_without_name' => true, - 'self_accessor' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => false, // disabled as "risky" - 'single_blank_line_at_eof' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => [ - 'elements' => ['const', 'property'], - ], - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_line_comment_style' => [ - 'comment_types' => ['hash'], - ], - 'single_quote' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'switch_case_semicolon_to_colon' => true, - 'switch_case_space' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline' => ['elements' => ['arrays']], - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => ['method', 'property'], - ], - 'whitespace_after_comma_in_array' => true, -]; - - -$finder = Finder::create() - ->in([ - __DIR__ . '/config', - __DIR__ . '/lang', - __DIR__ . '/src', - ]) - ->name('*.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -return (new Config) - ->setFinder($finder) - ->setRules($rules) - ->setRiskyAllowed(true) - ->setUsingCache(true); diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d8cdf4..7694ec9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +0.8.4 (2023-11-03) +------------------ + +- Updated QA tools + + 0.8.3 (2023-08-19) ------------------ diff --git a/README.md b/README.md index 24f0548..d58a725 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This package provides several Blade components prepared for use with Bootstrap ( This package was initially an extension of [Blade UI Kit](https://blade-ui-kit.com/) to provide pre-styled components for Bootstrap. But by making it evolve we decided to decouple it from its parent. This simplifies the code as well as its use in our case. -This package is therefore largely inspired by [Blade UI Kit](https://blade-ui-kit.com/). A very large part of the documentation comes from it. And we sincerely thank its contributors for the idea and what they have developed. This package wouldn't exist without it. +This package is therefore largely inspired by [Blade UI Kit](https://blade-ui-kit.com/). A large part of the documentation comes from it. And we sincerely thank its contributors for the idea and what they have developed. This package wouldn't exist without it. Example ------- @@ -128,13 +128,13 @@ You don't have to, but you can publish: the configuration file, the views and th Publish the configuration file with this command: -``` +```bash php artisan vendor:publish --tag="blade-ui-kit-bootstrap-config" ``` Publish views with this command: -``` +```bash php artisan vendor:publish --tag="blade-ui-kit-bootstrap-views" ``` @@ -142,7 +142,7 @@ Note that it is not necessary to publish all views in your application. It is ev Publish translation files with this command: -``` +```bash php artisan vendor:publish --tag="blade-ui-kit-bootstrap-translations" ``` diff --git a/composer.json b/composer.json index 37434c2..2fde9f1 100644 --- a/composer.json +++ b/composer.json @@ -24,8 +24,9 @@ "illuminate/view": "^10.0" }, "require-dev": { - "driftingly/rector-laravel": "^0.21", - "rector/rector": "^0.17" + "laravel/pint": "^1.13.5", + "driftingly/rector-laravel": ">=0.26.2", + "rector/rector": ">=0.18.6" }, "autoload": { "psr-4": { diff --git a/config/blade-ui-kit-bootstrap.php b/config/blade-ui-kit-bootstrap.php index f1be8ff..8da94fd 100644 --- a/config/blade-ui-kit-bootstrap.php +++ b/config/blade-ui-kit-bootstrap.php @@ -1,21 +1,21 @@ paths([ - __DIR__ . '/config', - __DIR__ . '/lang', - __DIR__ . '/src', + __DIR__.'/config', + __DIR__.'/lang', + __DIR__.'/src', ]); $rectorConfig->parallel( @@ -32,48 +23,38 @@ $rectorConfig->importNames(); - // skip paths and/or rules + // cache settings //---------------------------------------------------------- - $rectorConfig->skip([ - // Pour la mise à jour PHP 8.1, ne pas prendre en compte MyCLabs enum to natives PHP enum - //MyCLabsClassToEnumRector::class, - //MyCLabsMethodCallToEnumConstRector::class, - // Transforme des faux-positifs, je préfère désactiver ça (PHP 8.1) - NullToStrictStringFuncCallArgRector::class, - - // Pas de ça dans les routes car transforme : - // [Controller::class, 'method'] en (new Controller)->method(...) - //StaticCallOnNonStaticToInstanceCallRector::class => [__DIR__.'/routes'], - //FirstClassCallableRector::class => [__DIR__.'/routes'], + // Ensure file system caching is used instead of in-memory. + $rectorConfig->cacheClass(FileCacheStorage::class); - // Également, si SetList::CODE_QUALITY, éviter de transformer dans les routes - // [GlideController::class, 'images'] en fn($path, Request $request) => (new GlideController())->images($path, $request) - //CallableThisArrayToAnonymousFunctionRector::class => [__DIR__.'/routes'], - //ClosureToArrowFunctionRector::class => [__DIR__.'/routes'], - ]); + // Specify a path that works locally as well as on CI job runners. + $rectorConfig->cacheDirectory(__DIR__.'/.rector_cache'); - // register single rules + // skip paths and/or rules //---------------------------------------------------------- + $rectorConfig->skip([ + // Transforms false positives, I prefer to disable that (PHP 8.1) + NullToStrictStringFuncCallArgRector::class, - // TYPE_DECLARATION - //$rectorConfig->rule(TypedPropertyFromStrictConstructorRector::class); - //$rectorConfig->rule(AddVoidReturnTypeWhereNoReturnRector::class); - //$rectorConfig->rule(AddClosureReturnTypeRector::class); - - // CODE_QUALITY - //$rectorConfig->rule(ReturnTypeFromStrictScalarReturnExprRector::class); - //$rectorConfig->rule(UseIdenticalOverEqualWithSameTypeRector::class); + // Ne pas changer les closure et Arrow Function en Static + StaticClosureRector::class, + StaticArrowFunctionRector::class, + ]); // define what sets of rules will be applied // tip: use "SetList" class to autocomplete sets with your IDE //---------------------------------------------------------- $rectorConfig->sets([ LaravelSetList::LARAVEL_FACADE_ALIASES_TO_FULL_NAMES, - LevelSetList::UP_TO_PHP_82, - SetList::CODE_QUALITY, + SetList::PHP_82, SetList::DEAD_CODE, - SetList::EARLY_RETURN, + SetList::CODE_QUALITY, + SetList::CODING_STYLE, SetList::TYPE_DECLARATION, + //SetList::PRIVATIZATION, + SetList::EARLY_RETURN, + SetList::INSTANCEOF, ]); }; diff --git a/resources/views/bootstrap-4/components/modals/confirm.blade.php b/resources/views/bootstrap-4/components/modals/confirm.blade.php index 5f4dddc..68cb655 100644 --- a/resources/views/bootstrap-4/components/modals/confirm.blade.php +++ b/resources/views/bootstrap-4/components/modals/confirm.blade.php @@ -1,4 +1,3 @@ - @push ('blade-ui-kit-bs-html')