Skip to content

Commit

Permalink
PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
iLexN committed Nov 26, 2021
1 parent 42252f6 commit cef8213
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
]
},
"require":{
"php": ">=8.0"
"php": ">=8.1"
},
"require-dev": {
"infection/infection": "^0.25",
Expand Down
5 changes: 3 additions & 2 deletions rector-ci.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
declare(strict_types=1);

use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

Expand All @@ -13,8 +14,8 @@
$containerConfigurator->import(SetList::DEAD_CODE);
$containerConfigurator->import(SetList::CODING_STYLE);
$containerConfigurator->import(SetList::PHP_80);
$containerConfigurator->import(SetList::PHP_81);
$containerConfigurator->import(SetList::PSR_4);
$containerConfigurator->import(SetList::CODE_QUALITY_STRICT);
$containerConfigurator->import(SetList::EARLY_RETURN);
$containerConfigurator->import(SetList::NAMING);

Expand All @@ -23,5 +24,5 @@
Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector::class,
Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector::class,
]);

$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_81);
};
2 changes: 1 addition & 1 deletion src/ChangeLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ChangeLog
/**
* ChangeLog constructor.
*/
public function __construct(private string $title, private string $description, private FormatterInterface $formatter)
public function __construct(private readonly string $title, private readonly string $description, private readonly FormatterInterface $formatter)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/DefaultFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DefaultFormatter implements FormatterInterface
/**
* DefaultFormatter constructor.
*/
public function __construct(private string $url)
public function __construct(private readonly string $url)
{
}

Expand Down
6 changes: 3 additions & 3 deletions src/Release.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ class Release
/**
* @var \Ilex\ChangeLog\Type\ChangeTypeFactoryInterface
*/
private ChangeTypeFactoryInterface $changeTypeFactory;
private readonly ChangeTypeFactoryInterface $changeTypeFactory;

/**
* Release constructor.
*/
public function __construct(
public string $tag,
public string $date,
public readonly string $tag,
public readonly string $date,
?ChangeTypeFactoryInterface $changeTypeFactory = null
) {
$this->changeTypeFactory = $this->setFactory($changeTypeFactory);
Expand Down
12 changes: 6 additions & 6 deletions src/Type/ChangeTypeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,37 @@ class ChangeTypeFactory implements ChangeTypeFactoryInterface
* ADDED
* @var int
*/
public const ADDED = 1;
public final const ADDED = 1;

/**
* CHANGED
* @var int
*/
public const CHANGED = 2;
public final const CHANGED = 2;

/**
* DEPRECATED
* @var int
*/
public const DEPRECATED = 3;
public final const DEPRECATED = 3;

/**
* REMOVED
* @var int
*/
public const REMOVED = 4;
public final const REMOVED = 4;

/**
* FIXED
* @var int
*/
public const FIXED = 5;
public final const FIXED = 5;

/**
* SECURITY
* @var int
*/
public const SECURITY = 6;
public final const SECURITY = 6;

public function create(int $type): TypeInterface
{
Expand Down

0 comments on commit cef8213

Please sign in to comment.