symplify / parameter-name-guard
此包已被废弃且不再维护。未建议替代包。
防止参数拼写错误导致应用程序无法正常运行
资助包维护!
tomasvotruba
v8.2.1
2020-08-07 20:33 UTC
Requires
- php: ^7.2
- nette/utils: ^3.0
- symfony/config: ^4.4|^5.0
- symfony/dependency-injection: ^4.4|^5.0
- symfony/http-kernel: ^4.4|^5.0
Requires (Dev)
- phpunit/phpunit: ^8.5|^9.0
- dev-master / 8.3.x-dev
- v8.2.1
- v8.2.0
- v8.1.20
- v8.1.19
- v8.1.18
- v8.1.17
- v8.1.16
- v8.1.15
- v8.1.14
- v8.1.13
- v8.1.12
- v8.1.11
- v8.1.10
- v8.1.9
- v8.1.8
- v8.1.7
- v8.1.6
- v8.1.4
- v8.1.3
- v8.1.2
- v8.1.1
- v8.1.0
- v8.0.1
- v8.0.0
- v8.0.0-beta4
- v8.0.0-beta3
- v8.0.0-beta2
- v8.0.0-beta1
- v7.3.18
- v7.3.17
- v7.3.16
- v7.3.15
- v7.3.14
- v7.3.13
- v7.3.11
- dev-symplify7
This package is auto-updated.
Last update: 2020-08-12 12:08:32 UTC
README
防止参数拼写错误导致应用程序无法正常运行。
安装
composer require symplify/parameter-name-guard
注册包
# config/bundles.php return [ Symplify\ParameterNameGuard\Bundle\ParameterNameGuardBundle::class => ['all' => true], ];
使用
防止参数拼写错误
是不是 ignoreFiles
?还是 ignored_files
?或者 ignore_file
?你懒得阅读每个 README.md
来找到正确的名称?通过帮助他们,让开发者们的生活更加愉快。
# app/config/services.yaml parameters: correctKey: 'value' # you need to get just this one right :D correct_to_typos: # correct key name correct_key: # the most common typos that people make - 'correctKey' # regexp also works! - '#correctKey(s)?#i'
这样,用户会通过异常了解到他们犯的每一个拼写错误
Parameter "parameters > correctKey" does not exist. Use "parameters > correct_key" instead.
他们可以少花时间记住所有键,更多时间进行编程。