Skip to content

Commit

Permalink
Make some classes read-only
Browse files Browse the repository at this point in the history
Signed-off-by: Luís Cobucci <[email protected]>
  • Loading branch information
lcobucci committed Nov 10, 2024
1 parent 0e5dea3 commit 7b2427b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use function is_array;
use function is_string;

final class Compiler
final readonly class Compiler
{
private const DEFAULT_PASS_CONFIG = [null, PassConfig::TYPE_BEFORE_OPTIMIZATION, 0];

Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/DumpXmlContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Dumper\XmlDumper;

final class DumpXmlContainer implements CompilerPassInterface
final readonly class DumpXmlContainer implements CompilerPassInterface
{
public function __construct(private ConfigCacheInterface $configCache)
{
Expand Down
2 changes: 1 addition & 1 deletion src/ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use function assert;
use function is_bool;

final class ContainerBuilder implements Builder
final readonly class ContainerBuilder implements Builder
{
public function __construct(
private ContainerConfiguration $config,
Expand Down
6 changes: 3 additions & 3 deletions src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
use function assert;
use function is_a;

abstract class Generator
abstract readonly class Generator
{
private Compiler $compiler;

/** @param class-string<SymfonyBuilder> $builderClass */
public function __construct(
private readonly string $configurationFile,
private readonly string $builderClass = SymfonyBuilder::class,
private string $configurationFile,
private string $builderClass = SymfonyBuilder::class,
) {
$this->compiler = new Compiler();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Generators/Delegating.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* The dependency injection generator that allows XML, YAML and PHP files
*/
final class Delegating extends Generator
final readonly class Delegating extends Generator
{
/** @inheritDoc */
public function getLoader(SymfonyBuilder $container, array $paths, ?string $profileName = null): LoaderInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Generators/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* The dependency injection generator for PHP files
*/
final class Php extends Generator
final readonly class Php extends Generator
{
/** @inheritDoc */
public function getLoader(SymfonyBuilder $container, array $paths, ?string $profileName = null): LoaderInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Generators/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* The dependency injection generator for XML files
*/
final class Xml extends Generator
final readonly class Xml extends Generator
{
/** @inheritDoc */
public function getLoader(SymfonyBuilder $container, array $paths, ?string $profileName = null): LoaderInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Generators/Yaml.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* The dependency injection generator for YAML files
*/
final class Yaml extends Generator
final readonly class Yaml extends Generator
{
/** @inheritDoc */
public function getLoader(SymfonyBuilder $container, array $paths, ?string $profileName = null): LoaderInterface
Expand Down

0 comments on commit 7b2427b

Please sign in to comment.