Skip to content

Commit

Permalink
feat: test usage of php 8.3 and remove support of php 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroTroller committed Feb 23, 2024
1 parent 0d60ea3 commit 3fad545
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$config->setRules(
PedroTroller\CS\Fixer\RuleSetFactory::create()
->phpCsFixer(true)
->php(8.0, true)
->php(8.1, true)
->pedrotroller(true)
->enable('align_multiline_comment')
->enable('array_indentation')
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build:
analysis:
environment:
php:
version: 8.0.2
version: 8.3.3
tests:
override:
- php-scrutinizer-run
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Are you often tired to repeat static choices like gender or civility in your app

## Requirements

- PHP >= 8.0
- PHP >= 8.1
- Symfony 5.4 or 6.*

## Installation
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"php": ">=8.0",
"php": ">=8.1",
"symfony/config": "^5.4 || ^6.2@dev",
"symfony/dependency-injection": "^5.4 || ^6.2@dev",
"symfony/form": "^5.4 || ^6.2@dev",
Expand Down
24 changes: 2 additions & 22 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,9 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig
->paths(
[
__DIR__.'/src',
]
)
;

$rectorConfig
->phpVersion(
PhpVersion::PHP_80
)
;

$rectorConfig
->sets(
[
LevelSetList::UP_TO_PHP_80,
]
)
;
$rectorConfig->paths([__DIR__.'/src']);
$rectorConfig->sets([LevelSetList::UP_TO_PHP_81]);
};
2 changes: 1 addition & 1 deletion src/Knp/DictionaryBundle/Dictionary/Factory/Extended.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

final class Extended implements Factory
{
public function __construct(private Factory $factory, private Collection $dictionaries) {}
public function __construct(private readonly Factory $factory, private Collection $dictionaries) {}

public function create(string $name, array $config): Dictionary
{
Expand Down
2 changes: 1 addition & 1 deletion src/Knp/DictionaryBundle/Dictionary/Factory/Invokable.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

final class Invokable implements Factory
{
public function __construct(private ContainerInterface $container) {}
public function __construct(private readonly ContainerInterface $container) {}

/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion src/Knp/DictionaryBundle/Dictionary/Factory/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

final class Iterator implements Factory
{
public function __construct(private ContainerInterface $container) {}
public function __construct(private readonly ContainerInterface $container) {}

/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion src/Knp/DictionaryBundle/Dictionary/Factory/KeyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

final class KeyValue implements Factory
{
public function __construct(private ValueTransformer $transformer) {}
public function __construct(private readonly ValueTransformer $transformer) {}

/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion src/Knp/DictionaryBundle/Dictionary/Factory/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

final class Value implements Factory
{
public function __construct(private ValueTransformer $transformer) {}
public function __construct(private readonly ValueTransformer $transformer) {}

/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion src/Knp/DictionaryBundle/Dictionary/Factory/ValueAsKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

final class ValueAsKey implements Factory
{
public function __construct(private ValueTransformer $transformer) {}
public function __construct(private readonly ValueTransformer $transformer) {}

/**
* {@inheritdoc}
Expand Down
7 changes: 5 additions & 2 deletions src/Knp/DictionaryBundle/Dictionary/Invokable.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ final class Invokable implements Dictionary
/**
* @param mixed[] $callableArgs
*/
public function __construct(private string $name, callable $callable, private array $callableArgs = [])
{
public function __construct(
private readonly string $name,
callable $callable,
private readonly array $callableArgs = []
) {
$this->callable = $callable;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Knp/DictionaryBundle/Dictionary/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class Simple implements Dictionary
/**
* @param array<mixed, E> $values
*/
public function __construct(private string $name, private array $values) {}
public function __construct(private readonly string $name, private array $values) {}

public function getName(): string
{
Expand Down
5 changes: 4 additions & 1 deletion src/Knp/DictionaryBundle/Dictionary/Traceable.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ final class Traceable implements Dictionary
/**
* @param Dictionary<E> $dictionary
*/
public function __construct(private Dictionary $dictionary, private DictionaryDataCollector $collector) {}
public function __construct(
private readonly Dictionary $dictionary,
private readonly DictionaryDataCollector $collector
) {}

public function getName(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Knp/DictionaryBundle/Dictionary/Wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract class Wrapper implements Dictionary
/**
* @param Dictionary<E> $wrapped
*/
public function __construct(private Dictionary $wrapped) {}
public function __construct(private readonly Dictionary $wrapped) {}

public function getName(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(private Collection $dictionaries) {}
public function getFunctions()
{
return [
new TwigFunction('dictionary', [$this->dictionaries, 'offsetGet']),
new TwigFunction('dictionary', $this->dictionaries->offsetGet(...)),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class DictionaryValidator extends ConstraintValidator
{
use DictionaryValidator\SymfonyCompatibilityTrait;

public function __construct(private Collection $dictionaries) {}
public function __construct(private readonly Collection $dictionaries) {}

private function varToString(mixed $var): string
{
Expand Down

0 comments on commit 3fad545

Please sign in to comment.