Slide 14
Slide 14 text
2018/3/20 Connehito Marché vol.5 〜PHP市〜
PSRチェックの更新
●PHP-CS-Fixerを利用
○.php_cs
○NGの場合はSlackで通知
notName('.php_cs')
->notName('*.html')
->notName('*.md')
->notName('*.rb')
->notName('*.sh')
->notName('*.xml')
->exclude('tmp')
->in(__DIR__);
return PhpCsFixer¥Config::create()
->setRules(array(
'@PSR2' => true,
'@PHP56Migration' => true,
// 'cast_spaces' => array('space' => 'none'), // PHP CS Fixer 2.2.20 では設定不可
// 'combine_consecutive_issets' => true, // PHP CS Fixer 2.2.20 では設定不可
'combine_consecutive_unsets' => true,
// 'ereg_to_preg' => true, // PHP 5.6対応後に設定
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_whitespace_before_comma_in_array' => true,
'whitespace_after_comma_in_array' => true,
'braces' => array()
))
->setUsingCache(false)
->setFinder($finder);
PHP5.6チェック
PHP5.6後に
設定予定