Skip to content
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

feat: test usage of php 8.3 and remove support of php 8.0 #229

Merged
merged 1 commit into from
Feb 23, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2.15
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, 6.4 or 7.*

## 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.4 || ^7.0@dev",
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0@dev",
"symfony/form": "^5.4 || ^6.4 || ^7.0@dev",
Expand Down
4 changes: 2 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Rector\ValueObject\PhpVersion;

return RectorConfig::configure()
->withPhpVersion(PhpVersion::PHP_80)
->withPhpSets(php80: true)
->withPhpVersion(PhpVersion::PHP_81)
->withPhpSets(php81: true)
->withPaths([__DIR__.'/src'])
;
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
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
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 @@ -32,7 +32,7 @@ public function validate(mixed $value, Constraint $constraint): void
$constraint->message,
[
'{{ key }}' => $this->varToString($value),
'{{ keys }}' => implode(', ', array_map([$this, 'varToString'], $values)),
'{{ keys }}' => implode(', ', array_map($this->varToString(...), $values)),
]
);
}
Expand Down