Browse Source

Composer require baijunyao/php-cs-fixer-config

baijunyao 3 năm trước cách đây
mục cha
commit
0f30285580
4 tập tin đã thay đổi với 80 bổ sung82 xóa
  1. 7 75
      .php-cs-fixer.php
  2. 22 3
      _ide_helper.php
  3. 1 2
      composer.json
  4. 50 2
      composer.lock

+ 7 - 75
.php-cs-fixer.php

@@ -1,6 +1,11 @@
 <?php
 
-$finder = PhpCsFixer\Finder::create()
+declare(strict_types=1);
+
+use Baijunyao\PhpCsFixer\Config;
+use PhpCsFixer\Finder;
+
+$finder = Finder::create()
     ->notPath('app/Console/Kernel.php')
     ->notPath('app/Http/Kernel.php')
     ->exclude('bootstrap')
@@ -14,77 +19,4 @@ $finder = PhpCsFixer\Finder::create()
     ->notPath('server.php')
     ->in(__DIR__);
 
-$config = new PhpCsFixer\Config();
-
-return $config->setRiskyAllowed(true)
-    ->registerCustomFixers([
-        new AdamWojs\PhpCsFixerPhpdocForceFQCN\Fixer\Phpdoc\ForceFQCNFixer(),
-    ])
-    ->setRules([
-        '@Symfony' => true,
-        '@Symfony:risky' => true,
-        '@PHP71Migration' => true,
-        '@PHP71Migration:risky' => true,
-        'align_multiline_comment' => true,
-        'array_indentation' => true,
-        'array_syntax' => ['syntax' => 'short'],
-        'binary_operator_spaces'=> ['operators' => ['=' => 'align_single_space', '=>' => 'align_single_space']],
-        'combine_consecutive_issets' => true,
-        'combine_consecutive_unsets' => true,
-        'combine_nested_dirname' => true,
-        'concat_space' => ['spacing' => 'one'],
-        'ereg_to_preg' => true,
-        'escape_implicit_backslashes' => true,
-        'fopen_flags' => false,
-        'fopen_flag_order' => true,
-        'function_to_constant' => ['functions' => ['get_class', 'get_called_class', 'php_sapi_name', 'phpversion', 'pi']],
-        'heredoc_to_nowdoc' => true,
-        'linebreak_after_opening_tag' => true,
-        'list_syntax' => ['syntax' => 'short'],
-        'logical_operators' => true,
-        'magic_method_casing' => true,
-        'method_chaining_indentation' => true,
-        'modernize_types_casting' => false,
-        'multiline_comment_opening_closing' => true,
-        'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
-        'native_constant_invocation' => false,
-        'native_function_invocation' => false,
-        'no_alternative_syntax' => true,
-        'no_homoglyph_names' => true,
-        'no_null_property_initialization' => true,
-        'no_php4_constructor' => true,
-        'echo_tag_syntax' => ['format' => 'long'],
-        'no_unneeded_curly_braces' => true,
-        'no_unneeded_final_method' => true,
-        'no_unreachable_default_argument_value' => true,
-        'no_useless_return' => true,
-        'no_whitespace_in_blank_line' => true,
-        'not_operator_with_space' => false,
-        'ordered_class_elements' => true,
-        'ordered_imports' => true,
-        'phpdoc_add_missing_param_annotation' => true,
-        'phpdoc_annotation_without_dot' => false,
-        'phpdoc_no_alias_tag' => false,
-        'phpdoc_no_empty_return' => false,
-        'phpdoc_order' => true,
-        'phpdoc_trim_consecutive_blank_line_separation' => true,
-        'phpdoc_summary' => false, // no need to add dot at the end of short description
-        'phpdoc_to_comment' => false, // allow use of docblock comment in function body
-        'phpdoc_var_annotation_correct_order' => true,
-        'php_unit_construct' => true,
-        'php_unit_method_casing' => ['case' => 'camel_case'],
-        'php_unit_set_up_tear_down_visibility' => true,
-        'php_unit_test_case_static_method_calls' => true,
-        'pow_to_exponentiation' => false,
-        'increment_style' => ['style' => 'post'],
-        'return_assignment' => true,
-        'simplified_null_return' => false,
-        'short_scalar_cast' => true,
-        'string_line_ending' => true,
-        'yoda_style' => false,
-        'void_return' => false,
-        'single_trait_insert_per_statement' => false,
-        'ordered_traits' => false,
-        'AdamWojs/phpdoc_force_fqcn_fixer' => true,
-    ])
-    ->setFinder($finder);
+return (new Config())->setFinder($finder);

+ 22 - 3
_ide_helper.php

@@ -1,9 +1,10 @@
 <?php
 // @formatter:off
+// phpcs:ignoreFile
 
 /**
  * A helper file for Laravel, to provide autocomplete information to your IDE
- * Generated for Laravel 8.79.0.
+ * Generated for Laravel 8.82.0.
  *
  * This file should not be included in your code, only analyzed by your IDE!
  *
@@ -2337,6 +2338,19 @@
                         return $instance->compileString($value);
         }
                     /**
+         * Evaluate and render a Blade string to HTML.
+         *
+         * @param string $string
+         * @param array $data
+         * @param bool $deleteCachedView
+         * @return string 
+         * @static 
+         */ 
+        public static function render($string, $data = [], $deleteCachedView = false)
+        {
+                        return \Illuminate\View\Compilers\BladeCompiler::render($string, $data, $deleteCachedView);
+        }
+                    /**
          * Strip the parentheses from the given expression.
          *
          * @param string $expression
@@ -7716,6 +7730,10 @@
             /**
      * 
      *
+     * @method static void alwaysFrom(string $address, string|null $name = null)
+     * @method static void alwaysReplyTo(string $address, string|null $name = null)
+     * @method static void alwaysReturnPath(string $address)
+     * @method static void alwaysTo(string $address, string|null $name = null)
      * @method static mixed laterOn(string $queue, \DateTimeInterface|\DateInterval|int $delay, \Illuminate\Contracts\Mail\Mailable|string|array $view)
      * @method static mixed queueOn(string $queue, \Illuminate\Contracts\Mail\Mailable|string|array $view)
      * @method static void plain(string $view, array $data, $callback)
@@ -11683,6 +11701,7 @@
      * 
      *
      * @method static \Illuminate\Routing\RouteRegistrar as(string $value)
+     * @method static \Illuminate\Routing\RouteRegistrar controller(string $controller)
      * @method static \Illuminate\Routing\RouteRegistrar domain(string $value)
      * @method static \Illuminate\Routing\RouteRegistrar middleware(array|string|null $middleware)
      * @method static \Illuminate\Routing\RouteRegistrar name(string $value)
@@ -18917,7 +18936,7 @@ namespace  {
                 /**
              * Query lazily, by chunking the results of a query by comparing IDs.
              *
-             * @param int $count
+             * @param int $chunkSize
              * @param string|null $column
              * @param string|null $alias
              * @return \Illuminate\Support\LazyCollection 
@@ -18933,7 +18952,7 @@ namespace  {
                 /**
              * Query lazily, by chunking the results of a query by comparing IDs in descending order.
              *
-             * @param int $count
+             * @param int $chunkSize
              * @param string|null $column
              * @param string|null $alias
              * @return \Illuminate\Support\LazyCollection 

+ 1 - 2
composer.json

@@ -53,14 +53,13 @@
         "ytake/laravel-fluent-logger": "^5.0"
     },
     "require-dev": {
-        "adamwojs/php-cs-fixer-phpdoc-force-fqcn": "^2.0",
         "baijunyao/laravel-test-support": "^7.0",
+        "baijunyao/php-cs-fixer-config": "^0.1.0",
         "barryvdh/laravel-ide-helper": "^2.4",
         "beyondcode/laravel-dump-server": "^1.0",
         "facade/ignition": "^2.3.6",
         "fakerphp/faker": "^1.9.1",
         "filp/whoops": "^2.0",
-        "friendsofphp/php-cs-fixer": "^3.4",
         "itsgoingd/clockwork": "^5.0",
         "laravel/dusk": "^6.7",
         "mockery/mockery": "^1.3.1",

+ 50 - 2
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": "a8f694b7dd69aee6c59154c1def99daa",
+    "content-hash": "841808c044992b3afecb3aea5d27a724",
     "packages": [
         {
             "name": "algolia/algoliasearch-client-php",
@@ -11492,6 +11492,54 @@
             "time": "2021-11-18T14:54:41+00:00"
         },
         {
+            "name": "baijunyao/php-cs-fixer-config",
+            "version": "v0.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/baijunyao/php-cs-fixer-config.git",
+                "reference": "07b9a6dfa590859d2ff650cab693048d8b18ea32"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/baijunyao/php-cs-fixer-config/zipball/07b9a6dfa590859d2ff650cab693048d8b18ea32",
+                "reference": "07b9a6dfa590859d2ff650cab693048d8b18ea32",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "adamwojs/php-cs-fixer-phpdoc-force-fqcn": "^2.0",
+                "friendsofphp/php-cs-fixer": "^3.5",
+                "php": ">=7.2.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Baijunyao\\PhpCsFixer\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "baijunyao",
+                    "email": "baijunyao@baijunyao.com"
+                }
+            ],
+            "description": "Custom PHP CS Fixer",
+            "support": {
+                "issues": "https://github.com/baijunyao/php-cs-fixer-config/issues",
+                "source": "https://github.com/baijunyao/php-cs-fixer-config/tree/v0.1.0"
+            },
+            "time": "2022-02-06T12:43:56+00:00"
+        },
+        {
             "name": "barryvdh/laravel-ide-helper",
             "version": "v2.12.1",
             "source": {
@@ -16702,5 +16750,5 @@
         "php": "^8.0"
     },
     "platform-dev": [],
-    "plugin-api-version": "2.2.0"
+    "plugin-api-version": "2.1.0"
 }