diff --git a/.php_cs b/.php_cs deleted file mode 100755 index 56c5149..0000000 --- a/.php_cs +++ /dev/null @@ -1,49 +0,0 @@ -setRules([ - '@PSR2' => true, - 'binary_operator_spaces' => true, - 'blank_line_after_opening_tag' => true, - 'compact_nullable_typehint' => true, - 'declare_equal_normalize' => true, - 'lowercase_cast' => true, - 'lowercase_static_reference' => true, - 'new_with_braces' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_leading_import_slash' => true, - 'no_whitespace_in_blank_line' => true, - 'no_unused_imports' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - ], - ], - 'ordered_imports' => [ - 'imports_order' => [ - 'class', - 'function', - 'const', - ], - 'sort_algorithm' => 'none', - ], - 'return_type_declaration' => true, - 'short_scalar_cast' => true, - 'single_blank_line_before_namespace' => true, - 'single_trait_insert_per_statement' => true, - 'ternary_operator_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => [ - 'const', - 'method', - 'property', - ], - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('vendor') - ->in([__DIR__.'/src/']) - ) -; diff --git a/README.md b/README.md index f4279a5..bb59719 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ | Laravel 5 | `composer require overtrue/laravel-lang:~1.0` | ```shell -$ composer require "overtrue/laravel-lang:~6.0" +composer require "overtrue/laravel-lang:~6.0" ``` #### Lumen @@ -99,16 +99,16 @@ return [ You need only add the partials item what you want. -### publish the language files to your project `resources/lang/` directory: +### publish the language files to your project `resources/lang/` directory ```shell -$ php artisan lang:publish [LOCALES] {--force} +php artisan lang:publish [LOCALES] {--force} ``` examples: ```shell -$ php artisan lang:publish zh_CN,zh_HK,th,tk +php artisan lang:publish zh_CN,zh_HK,th,tk ``` ## PHP 扩展包开发 diff --git a/composer.json b/composer.json index 6c5f5c6..3a65861 100644 --- a/composer.json +++ b/composer.json @@ -1,42 +1,58 @@ { - "name": "overtrue/laravel-lang", - "description": "List of 75 languages for Laravel.", - "keywords": [ - "laravel", - "languages", - "i18n", - "locale", - "overtrue" + "name": "overtrue/laravel-lang", + "description": "List of 75 languages for Laravel.", + "keywords": [ + "laravel", + "languages", + "i18n", + "locale", + "overtrue" + ], + "require": { + "laravel-lang/lang": "^9.0", + "symfony/process": "^6.0", + "ext-json": "*" + }, + "autoload": { + "psr-4": { + "Overtrue\\LaravelLang\\": "src/" + } + }, + "license": "MIT", + "authors": [ + { + "name": "overtrue", + "email": "anzhengchao@gmail.com" + } + ], + "extra": { + "laravel": { + "providers": [ + "Overtrue\\LaravelLang\\TranslationServiceProvider" + ] + } + }, + "require-dev": { + "laravel/framework": "^9.0" + }, + "scripts": { + "post-update-cmd": [ + "cghooks remove", + "cghooks add --ignore-lock", + "cghooks update" ], - "require": { - "laravel-lang/lang": "^9.0", - "symfony/process": "^5.0.0", - "ext-json": "*" - }, - "autoload": { - "psr-4": { - "Overtrue\\LaravelLang\\": "src/" - } - }, - "license": "MIT", - "authors": [ - { - "name": "overtrue", - "email": "anzhengchao@gmail.com" - } + "post-merge": "composer install", + "post-install-cmd": [ + "cghooks remove", + "cghooks add --ignore-lock", + "cghooks update" ], - "extra": { - "laravel": { - "providers": [ - "Overtrue\\LaravelLang\\TranslationServiceProvider" - ] - } - }, - "require-dev": { - "laravel/framework": "~8.1" - }, - "scripts": { - "check-style": "php-cs-fixer fix --using-cache=no --diff --config=.php_cs --dry-run --ansi", - "fix-style": "php-cs-fixer fix --using-cache=no --config=.php_cs --ansi" - } -} \ No newline at end of file + "cghooks": "vendor/bin/cghooks", + "check-style": "php-cs-fixer fix --using-cache=no --diff --dry-run --ansi", + "fix-style": "php-cs-fixer fix --using-cache=no --ansi" + }, + "scripts-descriptions": { + "check-style": "Run style checks (only dry run - no fixing!).", + "fix-style": "Run style checks and fix violations." + } +}