82 Star 392 Fork 230

Discuz / DiscuzQ

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.php_cs 1.79 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
yulei745 提交于 2020-07-21 09:53 . fix: php_cs
<?php
$header = <<<'EOF'
Copyright (C) 2020 Tencent Cloud.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
EOF;
$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/app')
->in(__DIR__.'/framework')
->in(__DIR__.'/database');
$config = PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'header_comment' => [
'commentType' => 'PHPDoc',
'header' => $header,
],
'array_syntax' => [
'syntax' => 'short'
],
'single_quote' => true,
'class_attributes_separation' => true,
'no_unused_imports' => true,
'standardize_not_equals' => true,
])
->setFinder($finder)
;
// special handling of fabbot.io service if it's using too old PHP CS Fixer version
if (false !== getenv('FABBOT_IO')) {
try {
PhpCsFixer\FixerFactory::create()
->registerBuiltInFixers()
->registerCustomFixers($config->getCustomFixers())
->useRuleSet(new PhpCsFixer\RuleSet($config->getRules()));
} catch (PhpCsFixer\ConfigurationException\InvalidConfigurationException $e) {
$config->setRules([]);
} catch (UnexpectedValueException $e) {
$config->setRules([]);
} catch (InvalidArgumentException $e) {
$config->setRules([]);
}
}
return $config;
PHP
1
https://gitee.com/Discuz/Discuz-Q.git
git@gitee.com:Discuz/Discuz-Q.git
Discuz
Discuz-Q
DiscuzQ
master

搜索帮助

14c37bed 8189591 565d56ea 8189591