Skip to content

Commit

Permalink
Config optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
haringsrob committed May 31, 2022
1 parent 9aed018 commit 02afa31
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
22 changes: 17 additions & 5 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare(strict_types=1);

use Rector\Core\ValueObject\PhpVersion;
use Rector\Laravel\Set\LaravelSetList;
use Rector\Set\ValueObject\SetList;

/**
Expand All @@ -10,11 +12,21 @@
return static function (\Rector\Config\RectorConfig $rectorConfig): void {
$rectorConfig->sets([
SetList::DEAD_CODE,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
LaravelSetList::LARAVEL_80
]);

$rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/tests']);
$rectorConfig->phpVersion(PhpVersion::PHP_80);
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon');

$rectorConfig->skip([
\Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class,
\Rector\CodingStyle\Rector\If_\NullableCompareToNullRector::class,
\Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector::class,
\Rector\CodeQuality\Rector\PropertyFetch\ExplicitMethodCallOverMagicGetSetRector::class,
Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector::class
]);
$rectorConfig->import(SetList::TYPE_DECLARATION);
$rectorConfig->import(SetList::CODE_QUALITY);
$rectorConfig->import(SetList::CODING_STYLE);
$rectorConfig->import(SetList::PHP_80);
$rectorConfig->import(SetList::PHP_81);
};

2 changes: 1 addition & 1 deletion src/Commands/UpgradeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected function runRector(): void
$this->info('Running rector refactorings');

$process = new \Symfony\Component\Process\Process(
['php', 'vendor/bin/rector', 'process', '--config=vendor/area17/twill/rector.php'],
['php', 'vendor/bin/rector', 'process', '--config=vendor/area17/twill/rector-upgrade.php'],
null,
null,
null,
Expand Down
6 changes: 3 additions & 3 deletions src/Services/Forms/Fields/DatePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function timeOnly(bool $timeOnly = true): self
{
$this->withTime = true;
$this->timeOnly = $timeOnly;
$this->altFormat = $this->altFormat ?? (($this->time24Hr ?? false) ? 'H:i' : 'h:i K');
$this->altFormat = $this->altFormat ?? (($this->time24h ?? false) ? 'H:i' : 'h:i K');

return $this;
}
Expand Down Expand Up @@ -102,9 +102,9 @@ public function hourIncrement(int $hourIncrement = 1): self
/**
* Set how many minutes are increment when using the + and - actions.
*/
public function minuteIncrement(int $minutIncrement = 1): self
public function minuteIncrement(int $minuteIncrement = 1): self
{
$this->minuteIncrement = $minutIncrement;
$this->minuteIncrement = $minuteIncrement;

return $this;
}
Expand Down

0 comments on commit 02afa31

Please sign in to comment.