p2 project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.0 KiB

<?php
declare(strict_types=1);
/**
* This file is part of the Carbon package.
*
* (c) Brian Nesbitt <brian@nesbot.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$files = [
__DIR__.'/../src/Carbon/Traits/Date.php',
__DIR__.'/../src/Carbon/Traits/Units.php',
__DIR__.'/../src/Carbon/Lang/fr.php',
];
$comments = [
'// @--property',
'// @property',
'// @call ',
'// Words with feminine grammatical gender: semaine',
];
foreach ($files as $file) {
$contents = str_replace("\r", '', file_get_contents($file));
$newContents = implode("\n", array_filter(explode("\n", $contents), static function ($line) use ($comments) {
$code = trim($line);
foreach ($comments as $comment) {
if (str_starts_with($code, $comment)) {
return false;
}
}
return true;
}));
if ($newContents !== $contents) {
file_put_contents($file, $newContents);
}
}