Skip to content

Commit

Permalink
use read-only properties (@see https://php.watch/versions/8.1/readonly)
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Jul 30, 2024
1 parent 57629c3 commit 5feb7ff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Composer/DefaultStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
final class DefaultStrategy implements ManifestBuildStrategy
{
public function __construct(private ManifestFactory $factory)
public function __construct(private readonly ManifestFactory $factory)
{
}

Expand Down
8 changes: 4 additions & 4 deletions src/Composer/ManifestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ final class ManifestFactory
private ManifestBuildStrategy $strategy;

public function __construct(
private Configuration $config,
private bool $isDecorated,
private string $boxVersion,
private string $boxManifestVersion
private readonly Configuration $config,
private readonly bool $isDecorated,
private readonly string $boxVersion,
private readonly string $boxManifestVersion
) {
$this->setStrategy(new DefaultStrategy($this));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Composer/ManifestOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class ManifestOptions
public const TEMPLATE_OPTION = 'template';
public const RESOURCE_OPTION = 'resource';

public function __construct(private IO $io)
public function __construct(private readonly IO $io)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Composer/PostInstallStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
*/
final class PostInstallStrategy implements ManifestBuildStrategy
{
public function __construct(private ManifestFactory $factory)
public function __construct(private readonly ManifestFactory $factory)
{
}

Expand Down

0 comments on commit 5feb7ff

Please sign in to comment.