mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Depend on main config
This commit is contained in:
parent
e9f3369151
commit
b679711915
@ -11,12 +11,12 @@ declare(strict_types=1);
|
|||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use CodeIgniter\CodingStandard\CodeIgniter4;
|
use PhpCsFixer\ConfigInterface;
|
||||||
use Nexus\CsConfig\Factory;
|
|
||||||
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
|
|
||||||
use Nexus\CsConfig\FixerGenerator;
|
|
||||||
use PhpCsFixer\Finder;
|
use PhpCsFixer\Finder;
|
||||||
|
|
||||||
|
/** @var ConfigInterface $config */
|
||||||
|
$config = require __DIR__ . '/.php-cs-fixer.dist.php';
|
||||||
|
|
||||||
$finder = Finder::create()
|
$finder = Finder::create()
|
||||||
->files()
|
->files()
|
||||||
->in([
|
->in([
|
||||||
@ -29,15 +29,11 @@ $finder = Finder::create()
|
|||||||
__DIR__ . '/admin/starter/builds',
|
__DIR__ . '/admin/starter/builds',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$overrides = [];
|
$overrides = [
|
||||||
|
'header_comment' => false,
|
||||||
$options = [
|
|
||||||
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
|
|
||||||
'finder' => $finder,
|
|
||||||
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
|
|
||||||
'customRules' => [
|
|
||||||
NoCodeSeparatorCommentFixer::name() => true,
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
|
return $config
|
||||||
|
->setFinder($finder)
|
||||||
|
->setCacheFile('build/.php-cs-fixer.no-header.cache')
|
||||||
|
->setRules(array_merge($config->getRules(), $overrides));
|
||||||
|
@ -11,43 +11,29 @@ declare(strict_types=1);
|
|||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use CodeIgniter\CodingStandard\CodeIgniter4;
|
use PhpCsFixer\ConfigInterface;
|
||||||
use Nexus\CsConfig\Factory;
|
|
||||||
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
|
|
||||||
use Nexus\CsConfig\FixerGenerator;
|
|
||||||
use PhpCsFixer\Finder;
|
use PhpCsFixer\Finder;
|
||||||
|
|
||||||
|
/** @var ConfigInterface $config */
|
||||||
|
$config = require __DIR__ . '/.php-cs-fixer.dist.php';
|
||||||
|
|
||||||
$finder = Finder::create()
|
$finder = Finder::create()
|
||||||
->files()
|
->files()
|
||||||
->in([
|
->in([
|
||||||
__DIR__ . '/tests',
|
__DIR__ . '/tests',
|
||||||
])
|
])
|
||||||
->exclude([
|
|
||||||
])
|
|
||||||
->notPath([
|
->notPath([
|
||||||
'_support/View/Cells/multiplier.php',
|
'_support/View/Cells/multiplier.php',
|
||||||
'_support/View/Cells/colors.php',
|
'_support/View/Cells/colors.php',
|
||||||
'_support/View/Cells/addition.php',
|
'_support/View/Cells/addition.php',
|
||||||
])
|
])
|
||||||
->notName('#Foobar.php$#')
|
->notName('#Foobar.php$#');
|
||||||
->append([
|
|
||||||
]);
|
|
||||||
|
|
||||||
$overrides = [
|
$overrides = [
|
||||||
'void_return' => true,
|
'void_return' => true,
|
||||||
];
|
];
|
||||||
|
|
||||||
$options = [
|
return $config
|
||||||
'cacheFile' => 'build/.php-cs-fixer.tests.cache',
|
->setFinder($finder)
|
||||||
'finder' => $finder,
|
->setCacheFile('build/.php-cs-fixer.tests.cache')
|
||||||
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
|
->setRules(array_merge($config->getRules(), $overrides));
|
||||||
'customRules' => [
|
|
||||||
NoCodeSeparatorCommentFixer::name() => true,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
|
|
||||||
'CodeIgniter 4 framework',
|
|
||||||
'CodeIgniter Foundation',
|
|
||||||
'admin@codeigniter.com'
|
|
||||||
);
|
|
||||||
|
@ -11,12 +11,12 @@ declare(strict_types=1);
|
|||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use CodeIgniter\CodingStandard\CodeIgniter4;
|
use PhpCsFixer\ConfigInterface;
|
||||||
use Nexus\CsConfig\Factory;
|
|
||||||
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
|
|
||||||
use Nexus\CsConfig\FixerGenerator;
|
|
||||||
use PhpCsFixer\Finder;
|
use PhpCsFixer\Finder;
|
||||||
|
|
||||||
|
/** @var ConfigInterface $config */
|
||||||
|
$config = require __DIR__ . '/.php-cs-fixer.dist.php';
|
||||||
|
|
||||||
$finder = Finder::create()
|
$finder = Finder::create()
|
||||||
->files()
|
->files()
|
||||||
->in([
|
->in([
|
||||||
@ -32,6 +32,7 @@ $finder = Finder::create()
|
|||||||
|
|
||||||
$overrides = [
|
$overrides = [
|
||||||
'echo_tag_syntax' => false,
|
'echo_tag_syntax' => false,
|
||||||
|
'header_comment' => false,
|
||||||
'php_unit_internal_class' => false,
|
'php_unit_internal_class' => false,
|
||||||
'no_unused_imports' => false,
|
'no_unused_imports' => false,
|
||||||
'class_attributes_separation' => false,
|
'class_attributes_separation' => false,
|
||||||
@ -41,13 +42,7 @@ $overrides = [
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$options = [
|
return $config
|
||||||
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
|
->setFinder($finder)
|
||||||
'finder' => $finder,
|
->setCacheFile('build/.php-cs-fixer.user-guide.cache')
|
||||||
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
|
->setRules(array_merge($config->getRules(), $overrides));
|
||||||
'customRules' => [
|
|
||||||
NoCodeSeparatorCommentFixer::name() => true,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user