Skip to content

Normalize and add file-level headers to system/, tests/, utils/ #4949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
35 changes: 35 additions & 0 deletions .no-header.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

use Nexus\CsConfig\Factory;
use PhpCsFixer\Finder;
use Utils\PhpCsFixer\CodeIgniter4;

$finder = Finder::create()
->files()
->in([
__DIR__ . '/admin',
__DIR__ . '/app',
__DIR__ . '/public',
]);

$overrides = [
'no_blank_lines_after_phpdoc' => false,
];

$options = [
'cacheFile' => 'build/.no-header.php-cs-fixer.cache',
'finder' => $finder,
];

return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
20 changes: 15 additions & 5 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

declare(strict_types=1);

/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

use Nexus\CsConfig\Factory;
use PhpCsFixer\Finder;
use Utils\PhpCsFixer\CodeIgniter4;

$finder = Finder::create()
->files()
->in([
__DIR__ . '/admin', // @todo relocate when `header_comment` is enabled
__DIR__ . '/app', // @todo relocate when `header_comment` is enabled
__DIR__ . '/public', // @todo relocate when `header_comment` is enabled
__DIR__ . '/system',
__DIR__ . '/tests',
__DIR__ . '/utils',
Expand All @@ -20,6 +26,7 @@
->notName('#Foobar.php$#')
->append([
__FILE__,
__DIR__ . '/.no-header.php-cs-fixer.dist.php',
__DIR__ . '/rector.php',
__DIR__ . '/spark',
]);
Expand All @@ -31,5 +38,8 @@
'finder' => $finder,
];

// @todo change to `forLibrary()` when `header_comment` is enabled
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
'CodeIgniter 4 framework',
'CodeIgniter Foundation',
'[email protected]'
);
9 changes: 9 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
use Rector\CodeQuality\Rector\For_\ForToForeachRector;
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
Expand Down
6 changes: 3 additions & 3 deletions system/API/ResponseTrait.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\API;
Expand Down
6 changes: 3 additions & 3 deletions system/Autoloader/Autoloader.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\Autoloader;
Expand Down
6 changes: 3 additions & 3 deletions system/Autoloader/FileLocator.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\Autoloader;
Expand Down
6 changes: 3 additions & 3 deletions system/BaseModel.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter;
Expand Down
6 changes: 3 additions & 3 deletions system/CLI/BaseCommand.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\CLI;
Expand Down
6 changes: 3 additions & 3 deletions system/CLI/CLI.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\CLI;
Expand Down
6 changes: 3 additions & 3 deletions system/CLI/CommandRunner.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\CLI;
Expand Down
6 changes: 3 additions & 3 deletions system/CLI/Commands.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\CLI;
Expand Down
6 changes: 3 additions & 3 deletions system/CLI/Console.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\CLI;
Expand Down
6 changes: 3 additions & 3 deletions system/CLI/Exceptions/CLIException.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\CLI\Exceptions;
Expand Down
6 changes: 3 additions & 3 deletions system/CLI/GeneratorTrait.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\CLI;
Expand Down
6 changes: 3 additions & 3 deletions system/Cache/CacheFactory.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\Cache;
Expand Down
6 changes: 3 additions & 3 deletions system/Cache/CacheInterface.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\Cache;
Expand Down
6 changes: 3 additions & 3 deletions system/Cache/Exceptions/CacheException.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\Cache\Exceptions;
Expand Down
6 changes: 3 additions & 3 deletions system/Cache/Exceptions/ExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\Cache\Exceptions;
Expand Down
6 changes: 3 additions & 3 deletions system/Cache/Handlers/BaseHandler.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\Cache\Handlers;
Expand Down
6 changes: 3 additions & 3 deletions system/Cache/Handlers/DummyHandler.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\Cache\Handlers;
Expand Down
6 changes: 3 additions & 3 deletions system/Cache/Handlers/FileHandler.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\Cache\Handlers;
Expand Down
6 changes: 3 additions & 3 deletions system/Cache/Handlers/MemcachedHandler.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* This file is part of the CodeIgniter 4 framework.
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

namespace CodeIgniter\Cache\Handlers;
Expand Down
Loading