Skip to content

Commit

Permalink
readonly properties
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 15, 2023
1 parent 550fccf commit 1401b5d
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/Application/ErrorPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
final class ErrorPresenter implements Application\IPresenter
{
public function __construct(
private ?ILogger $logger = null,
private readonly ?ILogger $logger = null,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Application/LinkGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
final class LinkGenerator
{
public function __construct(
private Router $router,
private UrlScript $refUrl,
private ?IPresenterFactory $presenterFactory = null,
private readonly Router $router,
private readonly UrlScript $refUrl,
private readonly ?IPresenterFactory $presenterFactory = null,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Application/MicroPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ final class MicroPresenter implements Application\IPresenter


public function __construct(
private ?Nette\DI\Container $context = null,
private ?Nette\Http\IRequest $httpRequest = null,
private ?Router $router = null,
private readonly ?Nette\DI\Container $context = null,
private readonly ?Nette\Http\IRequest $httpRequest = null,
private readonly ?Router $router = null,
) {
}

Expand Down
8 changes: 4 additions & 4 deletions src/Bridges/ApplicationDI/ApplicationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
*/
final class ApplicationExtension extends Nette\DI\CompilerExtension
{
private array $scanDirs;
private readonly array $scanDirs;
private int $invalidLinkMode;


public function __construct(
private bool $debugMode = false,
private readonly bool $debugMode = false,
?array $scanDirs = null,
private ?string $tempDir = null,
private ?Nette\Loaders\RobotLoader $robotLoader = null,
private readonly ?string $tempDir = null,
private readonly ?Nette\Loaders\RobotLoader $robotLoader = null,
) {
$this->scanDirs = (array) $scanDirs;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Bridges/ApplicationDI/LatteExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
final class LatteExtension extends Nette\DI\CompilerExtension
{
public function __construct(
private string $tempDir,
private bool $debugMode = false,
private readonly string $tempDir,
private readonly bool $debugMode = false,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Bridges/ApplicationDI/PresenterFactoryCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
final class PresenterFactoryCallback
{
public function __construct(
private Nette\DI\Container $container,
private int $invalidLinkMode,
private ?string $touchToRefresh,
private readonly Nette\DI\Container $container,
private readonly int $invalidLinkMode,
private readonly ?string $touchToRefresh,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/ApplicationDI/RoutingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
final class RoutingExtension extends Nette\DI\CompilerExtension
{
public function __construct(
private bool $debugMode = false,
private readonly bool $debugMode = false,
) {
}

Expand Down
8 changes: 4 additions & 4 deletions src/Bridges/ApplicationLatte/TemplateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class TemplateFactory implements UI\TemplateFactory


public function __construct(
private LatteFactory $latteFactory,
private ?Nette\Http\IRequest $httpRequest = null,
private ?Nette\Security\User $user = null,
private ?Nette\Caching\Storage $cacheStorage = null,
private readonly LatteFactory $latteFactory,
private readonly ?Nette\Http\IRequest $httpRequest = null,
private readonly ?Nette\Security\User $user = null,
private readonly ?Nette\Caching\Storage $cacheStorage = null,
$templateClass = null,
) {
if ($templateClass && (!class_exists($templateClass) || !is_a($templateClass, Template::class, true))) {
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/ApplicationLatte/UIExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
final class UIExtension extends Latte\Extension
{
public function __construct(
private ?UI\Control $control,
private readonly ?UI\Control $control,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Bridges/ApplicationTracy/RoutingPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ final class RoutingPanel implements Tracy\IBarPanel


public function __construct(
private Routing\Router $router,
private Nette\Http\IRequest $httpRequest,
private Nette\Application\IPresenterFactory $presenterFactory,
private readonly Routing\Router $router,
private readonly Nette\Http\IRequest $httpRequest,
private readonly Nette\Application\IPresenterFactory $presenterFactory,
) {
}

Expand Down

0 comments on commit 1401b5d

Please sign in to comment.