diff --git a/site/app/Api/Presenters/ErrorGenericPresenter.php b/site/app/Api/Presenters/ErrorGenericPresenter.php index d33e3b86a..a11cb53e9 100644 --- a/site/app/Api/Presenters/ErrorGenericPresenter.php +++ b/site/app/Api/Presenters/ErrorGenericPresenter.php @@ -9,11 +9,11 @@ use Nette\Application\Response; use Override; -class ErrorGenericPresenter implements IPresenter +readonly class ErrorGenericPresenter implements IPresenter { public function __construct( - private readonly Error $error, + private Error $error, ) { } diff --git a/site/app/Application/Cli/CliArgs.php b/site/app/Application/Cli/CliArgs.php index c3c8f6352..1246e8bb2 100644 --- a/site/app/Application/Cli/CliArgs.php +++ b/site/app/Application/Cli/CliArgs.php @@ -3,15 +3,15 @@ namespace MichalSpacekCz\Application\Cli; -class CliArgs +readonly class CliArgs { /** * @param array $args */ public function __construct( - private readonly array $args, - private readonly ?string $error, + private array $args, + private ?string $error, ) { } diff --git a/site/app/Application/Error.php b/site/app/Application/Error.php index 81f37e401..cf5816fd6 100644 --- a/site/app/Application/Error.php +++ b/site/app/Application/Error.php @@ -11,12 +11,12 @@ use Nette\Application\Responses\ForwardResponse; use Tracy\ILogger; -class Error +readonly class Error { public function __construct( - private readonly ILogger $logger, - private readonly AppRequest $appRequest, + private ILogger $logger, + private AppRequest $appRequest, ) { } diff --git a/site/app/Application/Locale/LocaleLink.php b/site/app/Application/Locale/LocaleLink.php index 41b8850b9..c302095ee 100644 --- a/site/app/Application/Locale/LocaleLink.php +++ b/site/app/Application/Locale/LocaleLink.php @@ -3,14 +3,14 @@ namespace MichalSpacekCz\Application\Locale; -class LocaleLink +readonly class LocaleLink { public function __construct( - private readonly string $locale, - private readonly string $languageCode, - private readonly string $languageName, - private readonly string $url, + private string $locale, + private string $languageCode, + private string $languageName, + private string $url, ) { } diff --git a/site/app/Application/Routing/RouterFactoryRoute.php b/site/app/Application/Routing/RouterFactoryRoute.php index c36e19ac3..e0b1cb2b5 100644 --- a/site/app/Application/Routing/RouterFactoryRoute.php +++ b/site/app/Application/Routing/RouterFactoryRoute.php @@ -3,18 +3,18 @@ namespace MichalSpacekCz\Application\Routing; -class RouterFactoryRoute +readonly class RouterFactoryRoute { /** * @param array>|null $initialMetadata */ public function __construct( - public readonly string $mask, - public readonly string $defaultPresenter, - public readonly string $defaultAction, - public readonly ?array $initialMetadata = null, - public readonly RouterRoutes $class = RouterRoutes::Route, + public string $mask, + public string $defaultPresenter, + public string $defaultAction, + public ?array $initialMetadata = null, + public RouterRoutes $class = RouterRoutes::Route, ) { } diff --git a/site/app/Application/Theme.php b/site/app/Application/Theme.php index 736a2fac2..4b63967d5 100644 --- a/site/app/Application/Theme.php +++ b/site/app/Application/Theme.php @@ -6,7 +6,7 @@ use MichalSpacekCz\Http\Cookies\CookieName; use MichalSpacekCz\Http\Cookies\Cookies; -class Theme +readonly class Theme { private const DARK = 'dark'; @@ -15,7 +15,7 @@ class Theme public function __construct( - private readonly Cookies $cookies, + private Cookies $cookies, ) { } diff --git a/site/app/Application/WebApplication.php b/site/app/Application/WebApplication.php index 546ceccb1..06614e2e3 100644 --- a/site/app/Application/WebApplication.php +++ b/site/app/Application/WebApplication.php @@ -9,15 +9,15 @@ use Nette\Http\IRequest; use Nette\Http\IResponse; -class WebApplication +readonly class WebApplication { public function __construct( - private readonly IRequest $httpRequest, - private readonly IResponse $httpResponse, - private readonly SecurityHeaders $securityHeaders, - private readonly Application $application, - private readonly string $fqdn, + private IRequest $httpRequest, + private IResponse $httpResponse, + private SecurityHeaders $securityHeaders, + private Application $application, + private string $fqdn, ) { } diff --git a/site/app/Articles/ArticleEdit.php b/site/app/Articles/ArticleEdit.php index 237ab43e9..a0d68a814 100644 --- a/site/app/Articles/ArticleEdit.php +++ b/site/app/Articles/ArticleEdit.php @@ -6,13 +6,13 @@ use DateTime; use Nette\Utils\Html; -class ArticleEdit +readonly class ArticleEdit { public function __construct( - private readonly DateTime $editedAt, - private readonly Html $summary, - private readonly string $summaryTexy, + private DateTime $editedAt, + private Html $summary, + private string $summaryTexy, ) { } diff --git a/site/app/Articles/ArticlePublishedElsewhere.php b/site/app/Articles/ArticlePublishedElsewhere.php index 0046e5cd5..382c84f73 100644 --- a/site/app/Articles/ArticlePublishedElsewhere.php +++ b/site/app/Articles/ArticlePublishedElsewhere.php @@ -10,19 +10,19 @@ use Nette\Utils\Html; use Override; -class ArticlePublishedElsewhere implements ArticleWithId, ArticleWithSummary, ArticleWithPublishTime +readonly class ArticlePublishedElsewhere implements ArticleWithId, ArticleWithSummary, ArticleWithPublishTime { public function __construct( - private readonly int $articleId, - private readonly Html $title, - private readonly string $titleTexy, - private readonly string $href, - private readonly DateTime $published, - private readonly Html $excerpt, - private readonly string $excerptTexy, - private readonly string $sourceName, - private readonly string $sourceHref, + private int $articleId, + private Html $title, + private string $titleTexy, + private string $href, + private DateTime $published, + private Html $excerpt, + private string $excerptTexy, + private string $sourceName, + private string $sourceHref, ) { } diff --git a/site/app/Articles/Blog/BlogPost.php b/site/app/Articles/Blog/BlogPost.php index 5bd660a6a..e3be09b54 100644 --- a/site/app/Articles/Blog/BlogPost.php +++ b/site/app/Articles/Blog/BlogPost.php @@ -18,7 +18,7 @@ use Nette\Utils\Html; use Override; -class BlogPost implements ExportsOmittable, ArticleWithId, ArticleWithSlug, ArticleWithSummary, ArticleWithText, ArticleWithTags, ArticleWithUpdateTime, ArticleWithPublishTime, ArticleWithEdits +readonly class BlogPost implements ExportsOmittable, ArticleWithId, ArticleWithSlug, ArticleWithSummary, ArticleWithText, ArticleWithTags, ArticleWithUpdateTime, ArticleWithPublishTime, ArticleWithEdits { /** @@ -30,32 +30,32 @@ class BlogPost implements ExportsOmittable, ArticleWithId, ArticleWithSlug, Arti * @param list $allowedTagsGroups */ public function __construct( - private readonly ?int $id, - private readonly string $slug, - private readonly int $localeId, - private readonly ?string $locale, - private readonly ?int $translationGroupId, - private readonly Html $title, - private readonly string $titleTexy, - private readonly ?Html $lead, - private readonly ?string $leadTexy, - private readonly Html $text, - private readonly string $textTexy, - private readonly ?DateTime $published, - private readonly bool $needsPreviewKey, - private readonly ?string $previewKey, - private readonly ?Html $originally, - private readonly ?string $originallyTexy, - private readonly ?string $ogImage, - private readonly array $tags, - private readonly array $slugTags, - private readonly array $recommended, - private readonly ?TwitterCard $twitterCard, - private readonly string $href, - private readonly array $edits, - private readonly array $cspSnippets, - private readonly array $allowedTagsGroups, - private readonly bool $omitExports, + private ?int $id, + private string $slug, + private int $localeId, + private ?string $locale, + private ?int $translationGroupId, + private Html $title, + private string $titleTexy, + private ?Html $lead, + private ?string $leadTexy, + private Html $text, + private string $textTexy, + private ?DateTime $published, + private bool $needsPreviewKey, + private ?string $previewKey, + private ?Html $originally, + private ?string $originallyTexy, + private ?string $ogImage, + private array $tags, + private array $slugTags, + private array $recommended, + private ?TwitterCard $twitterCard, + private string $href, + private array $edits, + private array $cspSnippets, + private array $allowedTagsGroups, + private bool $omitExports, ) { } diff --git a/site/app/Articles/Blog/BlogPostEdits.php b/site/app/Articles/Blog/BlogPostEdits.php index e5e6d31c6..c7e9d0c2e 100644 --- a/site/app/Articles/Blog/BlogPostEdits.php +++ b/site/app/Articles/Blog/BlogPostEdits.php @@ -9,13 +9,13 @@ use MichalSpacekCz\Formatter\TexyFormatter; use Nette\Database\Explorer; -class BlogPostEdits +readonly class BlogPostEdits { public function __construct( - private readonly Explorer $database, - private readonly DateTimeZoneFactory $dateTimeZoneFactory, - private readonly TexyFormatter $texyFormatter, + private Explorer $database, + private DateTimeZoneFactory $dateTimeZoneFactory, + private TexyFormatter $texyFormatter, ) { } diff --git a/site/app/Articles/Blog/BlogPostFactory.php b/site/app/Articles/Blog/BlogPostFactory.php index ba7218a19..eaf1ac194 100644 --- a/site/app/Articles/Blog/BlogPostFactory.php +++ b/site/app/Articles/Blog/BlogPostFactory.php @@ -19,23 +19,23 @@ use Nette\Database\Row; use Nette\Utils\JsonException; -class BlogPostFactory +readonly class BlogPostFactory { /** * @param array>> $allowedTags */ public function __construct( - private readonly TexyFormatter $texyFormatter, - private readonly Tags $tags, - private readonly TwitterCards $twitterCards, - private readonly BlogPostRecommendedLinks $recommendedLinks, - private readonly BlogPostEdits $edits, - private readonly JsonUtils $jsonUtils, - private readonly LinkGenerator $linkGenerator, - private readonly LocaleLinkGenerator $localeLinkGenerator, - private readonly Translator $translator, - private readonly array $allowedTags, + private TexyFormatter $texyFormatter, + private Tags $tags, + private TwitterCards $twitterCards, + private BlogPostRecommendedLinks $recommendedLinks, + private BlogPostEdits $edits, + private JsonUtils $jsonUtils, + private LinkGenerator $linkGenerator, + private LocaleLinkGenerator $localeLinkGenerator, + private Translator $translator, + private array $allowedTags, ) { } diff --git a/site/app/Articles/Blog/BlogPostLocaleUrl.php b/site/app/Articles/Blog/BlogPostLocaleUrl.php index f66808627..a617f1a84 100644 --- a/site/app/Articles/Blog/BlogPostLocaleUrl.php +++ b/site/app/Articles/Blog/BlogPostLocaleUrl.php @@ -5,18 +5,18 @@ use DateTime; -class BlogPostLocaleUrl +readonly class BlogPostLocaleUrl { /** * @param list $slugTags */ public function __construct( - private readonly string $locale, - private readonly string $slug, - private readonly ?DateTime $published, - private readonly ?string $previewKey, - private readonly array $slugTags, + private string $locale, + private string $slug, + private ?DateTime $published, + private ?string $previewKey, + private array $slugTags, ) { } diff --git a/site/app/Articles/Blog/BlogPostLocaleUrls.php b/site/app/Articles/Blog/BlogPostLocaleUrls.php index bd30cff2c..8c6ac91a7 100644 --- a/site/app/Articles/Blog/BlogPostLocaleUrls.php +++ b/site/app/Articles/Blog/BlogPostLocaleUrls.php @@ -7,12 +7,12 @@ use Nette\Database\Explorer; use Nette\Utils\JsonException; -class BlogPostLocaleUrls +readonly class BlogPostLocaleUrls { public function __construct( - private readonly Explorer $database, - private readonly Tags $tags, + private Explorer $database, + private Tags $tags, ) { } diff --git a/site/app/Articles/Blog/BlogPostPreview.php b/site/app/Articles/Blog/BlogPostPreview.php index 6d153ae7e..ba9385d52 100644 --- a/site/app/Articles/Blog/BlogPostPreview.php +++ b/site/app/Articles/Blog/BlogPostPreview.php @@ -8,14 +8,14 @@ use Nette\Bridges\ApplicationLatte\DefaultTemplate; use Spaze\ContentSecurityPolicy\CspConfig; -class BlogPostPreview +readonly class BlogPostPreview { public function __construct( - private readonly TexyFormatter $texyFormatter, - private readonly BlogPosts $blogPosts, - private readonly UpcomingTrainingDates $upcomingTrainingDates, - private readonly CspConfig $contentSecurityPolicy, + private TexyFormatter $texyFormatter, + private BlogPosts $blogPosts, + private UpcomingTrainingDates $upcomingTrainingDates, + private CspConfig $contentSecurityPolicy, ) { } diff --git a/site/app/Articles/Blog/BlogPostRecommendedLink.php b/site/app/Articles/Blog/BlogPostRecommendedLink.php index 0012ee1c9..6ffa0ef9c 100644 --- a/site/app/Articles/Blog/BlogPostRecommendedLink.php +++ b/site/app/Articles/Blog/BlogPostRecommendedLink.php @@ -6,12 +6,12 @@ use JsonSerializable; use Override; -class BlogPostRecommendedLink implements JsonSerializable +readonly class BlogPostRecommendedLink implements JsonSerializable { public function __construct( - private readonly string $url, - private readonly string $text, + private string $url, + private string $text, ) { } diff --git a/site/app/Articles/Blog/BlogPosts.php b/site/app/Articles/Blog/BlogPosts.php index b6716bec0..1abfec955 100644 --- a/site/app/Articles/Blog/BlogPosts.php +++ b/site/app/Articles/Blog/BlogPosts.php @@ -17,16 +17,16 @@ use Nette\Utils\Json; use Nette\Utils\JsonException; -class BlogPosts +readonly class BlogPosts { public function __construct( - private readonly Explorer $database, - private readonly BlogPostLoader $loader, - private readonly BlogPostFactory $factory, - private readonly Cache $exportsCache, - private readonly Tags $tags, - private readonly int $updatedInfoThreshold, + private Explorer $database, + private BlogPostLoader $loader, + private BlogPostFactory $factory, + private Cache $exportsCache, + private Tags $tags, + private int $updatedInfoThreshold, ) { } diff --git a/site/app/CompanyInfo/CompanyInfo.php b/site/app/CompanyInfo/CompanyInfo.php index a73272f6f..82645c28c 100644 --- a/site/app/CompanyInfo/CompanyInfo.php +++ b/site/app/CompanyInfo/CompanyInfo.php @@ -12,7 +12,7 @@ use Throwable; use Tracy\Debugger; -class CompanyInfo +readonly class CompanyInfo { private Cache $cache; @@ -22,9 +22,9 @@ class CompanyInfo * @param list $registers */ public function __construct( - private readonly array $registers, + private array $registers, Storage $cacheStorage, - private readonly bool $loadCompanyDataVisible = true, + private bool $loadCompanyDataVisible = true, ) { $this->cache = new Cache($cacheStorage, self::class); } diff --git a/site/app/CompanyInfo/CompanyInfoDetails.php b/site/app/CompanyInfo/CompanyInfoDetails.php index 6fd1b3f66..570563fdb 100644 --- a/site/app/CompanyInfo/CompanyInfoDetails.php +++ b/site/app/CompanyInfo/CompanyInfoDetails.php @@ -6,19 +6,19 @@ use JsonSerializable; use Override; -class CompanyInfoDetails implements JsonSerializable +readonly class CompanyInfoDetails implements JsonSerializable { public function __construct( - private readonly int $status, - private readonly string $statusMessage, - private readonly string $companyId = '', - private readonly string $companyTaxId = '', - private readonly string $company = '', - private readonly ?string $streetAndNumber = null, - private readonly ?string $city = null, - private readonly ?string $zip = null, - private readonly ?string $country = null, + private int $status, + private string $statusMessage, + private string $companyId = '', + private string $companyTaxId = '', + private string $company = '', + private ?string $streetAndNumber = null, + private ?string $city = null, + private ?string $zip = null, + private ?string $country = null, ) { } diff --git a/site/app/CompanyInfo/CompanyRegisterAres.php b/site/app/CompanyInfo/CompanyRegisterAres.php index 4e453656d..e08f700b8 100644 --- a/site/app/CompanyInfo/CompanyRegisterAres.php +++ b/site/app/CompanyInfo/CompanyRegisterAres.php @@ -22,12 +22,12 @@ * See https://ares.gov.cz/stranky/vyvojar-info & https://ares.gov.cz/swagger-ui/ for the docs. * This is using the /ekonomicke-subjekty endpoint because it returns DIČ/tax id as well. */ -class CompanyRegisterAres implements CompanyRegister +readonly class CompanyRegisterAres implements CompanyRegister { public function __construct( - private readonly Processor $schemaProcessor, - private readonly HttpClient $httpClient, + private Processor $schemaProcessor, + private HttpClient $httpClient, ) { } diff --git a/site/app/CompanyInfo/CompanyRegisterRegisterUz.php b/site/app/CompanyInfo/CompanyRegisterRegisterUz.php index d779aaf4a..4fe0f1b36 100644 --- a/site/app/CompanyInfo/CompanyRegisterRegisterUz.php +++ b/site/app/CompanyInfo/CompanyRegisterRegisterUz.php @@ -19,7 +19,7 @@ * * See https://www.registeruz.sk/cruz-public/home/api for the docs. */ -class CompanyRegisterRegisterUz implements CompanyRegister +readonly class CompanyRegisterRegisterUz implements CompanyRegister { private const DAY_ONE = '1993-01-01'; @@ -28,7 +28,7 @@ class CompanyRegisterRegisterUz implements CompanyRegister public function __construct( - private readonly HttpClient $httpClient, + private HttpClient $httpClient, ) { } diff --git a/site/app/DateTime/DateTimeFactory.php b/site/app/DateTime/DateTimeFactory.php index cb4282446..cff6464db 100644 --- a/site/app/DateTime/DateTimeFactory.php +++ b/site/app/DateTime/DateTimeFactory.php @@ -11,11 +11,11 @@ use MichalSpacekCz\DateTime\Exceptions\CannotParseDateTimeException; use MichalSpacekCz\DateTime\Exceptions\InvalidTimezoneException; -class DateTimeFactory +readonly class DateTimeFactory { public function __construct( - private readonly DateTimeZoneFactory $dateTimeZoneFactory, + private DateTimeZoneFactory $dateTimeZoneFactory, ) { } diff --git a/site/app/DateTime/DateTimeFormatter.php b/site/app/DateTime/DateTimeFormatter.php index 23fc80df1..585c60fe2 100644 --- a/site/app/DateTime/DateTimeFormatter.php +++ b/site/app/DateTime/DateTimeFormatter.php @@ -7,7 +7,7 @@ use IntlDateFormatter; use RuntimeException; -class DateTimeFormatter +readonly class DateTimeFormatter { private const DATE_DAY = 'day'; @@ -107,7 +107,7 @@ class DateTimeFormatter public function __construct( - private readonly string $defaultLocale, + private string $defaultLocale, ) { } diff --git a/site/app/EasterEgg/FourOhFourButFound.php b/site/app/EasterEgg/FourOhFourButFound.php index adfe1944b..8a39692f1 100644 --- a/site/app/EasterEgg/FourOhFourButFound.php +++ b/site/app/EasterEgg/FourOhFourButFound.php @@ -7,7 +7,7 @@ use Nette\Application\UI\Presenter; use Nette\Http\IRequest; -class FourOhFourButFound +readonly class FourOhFourButFound { private const TEMPLATES = [ @@ -16,7 +16,7 @@ class FourOhFourButFound public function __construct( - private readonly IRequest $httpRequest, + private IRequest $httpRequest, ) { } diff --git a/site/app/EasterEgg/NetteCve202015227Rce.php b/site/app/EasterEgg/NetteCve202015227Rce.php index 38ed3fa95..25759fa9c 100644 --- a/site/app/EasterEgg/NetteCve202015227Rce.php +++ b/site/app/EasterEgg/NetteCve202015227Rce.php @@ -3,7 +3,7 @@ namespace MichalSpacekCz\EasterEgg; -class NetteCve202015227Rce +readonly class NetteCve202015227Rce { public function __construct( diff --git a/site/app/Feed/Exports.php b/site/app/Feed/Exports.php index a9860ba13..aaf4fe6fa 100644 --- a/site/app/Feed/Exports.php +++ b/site/app/Feed/Exports.php @@ -22,7 +22,7 @@ use Spaze\Exports\Atom\Elements\Link; use Spaze\Exports\Atom\Feed; -class Exports +readonly class Exports { private const ITEMS = 5; @@ -31,9 +31,9 @@ class Exports public function __construct( - private readonly Articles $articles, - private readonly TexyFormatter $texyFormatter, - private readonly Translator $translator, + private Articles $articles, + private TexyFormatter $texyFormatter, + private Translator $translator, Storage $cacheStorage, ) { $this->cache = new Cache($cacheStorage, self::class); diff --git a/site/app/Form/ChangePasswordFormFactory.php b/site/app/Form/ChangePasswordFormFactory.php index 73faf5b4c..0a3ffd1fd 100644 --- a/site/app/Form/ChangePasswordFormFactory.php +++ b/site/app/Form/ChangePasswordFormFactory.php @@ -7,13 +7,13 @@ use MichalSpacekCz\User\Manager; use Nette\Security\User; -class ChangePasswordFormFactory +readonly class ChangePasswordFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly Manager $authenticator, - private readonly User $user, + private FormFactory $factory, + private Manager $authenticator, + private User $user, ) { } diff --git a/site/app/Form/Controls/TrainingControlsAttendee.php b/site/app/Form/Controls/TrainingControlsAttendee.php index 9d578323c..4fc509154 100644 --- a/site/app/Form/Controls/TrainingControlsAttendee.php +++ b/site/app/Form/Controls/TrainingControlsAttendee.php @@ -5,12 +5,12 @@ use Nette\Forms\Controls\TextInput; -class TrainingControlsAttendee +readonly class TrainingControlsAttendee { public function __construct( - private readonly TextInput $name, - private readonly TextInput $email, + private TextInput $name, + private TextInput $email, ) { } diff --git a/site/app/Form/Controls/TrainingControlsCompany.php b/site/app/Form/Controls/TrainingControlsCompany.php index c0a925a82..3566085e3 100644 --- a/site/app/Form/Controls/TrainingControlsCompany.php +++ b/site/app/Form/Controls/TrainingControlsCompany.php @@ -5,16 +5,16 @@ use Nette\Forms\Controls\TextInput; -class TrainingControlsCompany +readonly class TrainingControlsCompany { public function __construct( - private readonly TextInput $companyId, - private readonly TextInput $companyTaxId, - private readonly TextInput $company, - private readonly TextInput $street, - private readonly TextInput $city, - private readonly TextInput $zip, + private TextInput $companyId, + private TextInput $companyTaxId, + private TextInput $company, + private TextInput $street, + private TextInput $city, + private TextInput $zip, ) { } diff --git a/site/app/Form/Controls/TrainingControlsFactory.php b/site/app/Form/Controls/TrainingControlsFactory.php index c58969416..89e2a5f22 100644 --- a/site/app/Form/Controls/TrainingControlsFactory.php +++ b/site/app/Form/Controls/TrainingControlsFactory.php @@ -11,13 +11,13 @@ use Nette\Forms\Controls\TextInput; use Nette\Forms\Form; -class TrainingControlsFactory +readonly class TrainingControlsFactory { public function __construct( - private readonly TrainingApplicationSources $trainingApplicationSources, - private readonly WinterIsComing $winterIsComing, - private readonly Translator $translator, + private TrainingApplicationSources $trainingApplicationSources, + private WinterIsComing $winterIsComing, + private Translator $translator, ) { } diff --git a/site/app/Form/DeletePersonalDataFormFactory.php b/site/app/Form/DeletePersonalDataFormFactory.php index 9ea676051..ae704734f 100644 --- a/site/app/Form/DeletePersonalDataFormFactory.php +++ b/site/app/Form/DeletePersonalDataFormFactory.php @@ -10,15 +10,15 @@ use Nette\Database\Explorer; use Tracy\Debugger; -class DeletePersonalDataFormFactory +readonly class DeletePersonalDataFormFactory { public function __construct( - private readonly Explorer $database, - private readonly FormFactory $factory, - private readonly Trainings $trainings, - private readonly TrainingDates $trainingDates, - private readonly TrainingFiles $files, + private Explorer $database, + private FormFactory $factory, + private Trainings $trainings, + private TrainingDates $trainingDates, + private TrainingFiles $files, ) { } diff --git a/site/app/Form/InterviewFormFactory.php b/site/app/Form/InterviewFormFactory.php index 597bc0cff..646d17abf 100644 --- a/site/app/Form/InterviewFormFactory.php +++ b/site/app/Form/InterviewFormFactory.php @@ -9,14 +9,14 @@ use MichalSpacekCz\Media\VideoThumbnails; use Nette\Forms\Controls\SubmitButton; -class InterviewFormFactory +readonly class InterviewFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingControlsFactory $trainingControlsFactory, - private readonly Interviews $interviews, - private readonly VideoThumbnails $videoThumbnails, + private FormFactory $factory, + private TrainingControlsFactory $trainingControlsFactory, + private Interviews $interviews, + private VideoThumbnails $videoThumbnails, ) { } diff --git a/site/app/Form/PostFormFactory.php b/site/app/Form/PostFormFactory.php index 0b6a9e492..57c63f171 100644 --- a/site/app/Form/PostFormFactory.php +++ b/site/app/Form/PostFormFactory.php @@ -30,22 +30,22 @@ use Spaze\ContentSecurityPolicy\CspConfig; use stdClass; -class PostFormFactory +readonly class PostFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly Translator $translator, - private readonly BlogPosts $blogPosts, - private readonly BlogPostFactory $blogPostFactory, - private readonly Tags $tags, - private readonly TexyFormatter $texyFormatter, - private readonly CspConfig $contentSecurityPolicy, - private readonly TrainingControlsFactory $trainingControlsFactory, - private readonly BlogPostPreview $blogPostPreview, - private readonly TwitterCards $twitterCards, - private readonly BlogPostRecommendedLinks $recommendedLinks, - private readonly Locales $locales, + private FormFactory $factory, + private Translator $translator, + private BlogPosts $blogPosts, + private BlogPostFactory $blogPostFactory, + private Tags $tags, + private TexyFormatter $texyFormatter, + private CspConfig $contentSecurityPolicy, + private TrainingControlsFactory $trainingControlsFactory, + private BlogPostPreview $blogPostPreview, + private TwitterCards $twitterCards, + private BlogPostRecommendedLinks $recommendedLinks, + private Locales $locales, ) { } diff --git a/site/app/Form/Pulse/PasswordsStorageAlgorithmFormFactory.php b/site/app/Form/Pulse/PasswordsStorageAlgorithmFormFactory.php index 3f5be2dee..e8baba309 100644 --- a/site/app/Form/Pulse/PasswordsStorageAlgorithmFormFactory.php +++ b/site/app/Form/Pulse/PasswordsStorageAlgorithmFormFactory.php @@ -12,15 +12,15 @@ use MichalSpacekCz\Pulse\SpecificSite; use Nette\Utils\ArrayHash; -class PasswordsStorageAlgorithmFormFactory +readonly class PasswordsStorageAlgorithmFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingControlsFactory $trainingControlsFactory, - private readonly Companies $companies, - private readonly Sites $sites, - private readonly Passwords $passwords, + private FormFactory $factory, + private TrainingControlsFactory $trainingControlsFactory, + private Companies $companies, + private Sites $sites, + private Passwords $passwords, ) { } diff --git a/site/app/Form/Pulse/PasswordsStoragesSearchSortFormFactory.php b/site/app/Form/Pulse/PasswordsStoragesSearchSortFormFactory.php index 2b9e522b7..cad5ec46a 100644 --- a/site/app/Form/Pulse/PasswordsStoragesSearchSortFormFactory.php +++ b/site/app/Form/Pulse/PasswordsStoragesSearchSortFormFactory.php @@ -8,13 +8,13 @@ use MichalSpacekCz\Pulse\Passwords\PasswordsSorting; use MichalSpacekCz\Pulse\Passwords\Rating; -class PasswordsStoragesSearchSortFormFactory +readonly class PasswordsStoragesSearchSortFormFactory { public function __construct( - private readonly UnprotectedFormFactory $factory, - private readonly Rating $rating, - private readonly PasswordsSorting $sorting, + private UnprotectedFormFactory $factory, + private Rating $rating, + private PasswordsSorting $sorting, ) { } diff --git a/site/app/Form/RegenerateTokensFormFactory.php b/site/app/Form/RegenerateTokensFormFactory.php index 5bbfb29fb..8c7aad47c 100644 --- a/site/app/Form/RegenerateTokensFormFactory.php +++ b/site/app/Form/RegenerateTokensFormFactory.php @@ -9,15 +9,15 @@ use Nette\Security\User; use Nette\Utils\Html; -class RegenerateTokensFormFactory +readonly class RegenerateTokensFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly Session $sessionHandler, - private readonly LinkGenerator $linkGenerator, - private readonly Manager $authenticator, - private readonly User $user, + private FormFactory $factory, + private Session $sessionHandler, + private LinkGenerator $linkGenerator, + private Manager $authenticator, + private User $user, ) { } diff --git a/site/app/Form/SignInFormFactory.php b/site/app/Form/SignInFormFactory.php index a116d3420..27a1da1b9 100644 --- a/site/app/Form/SignInFormFactory.php +++ b/site/app/Form/SignInFormFactory.php @@ -10,15 +10,15 @@ use Nette\Security\User; use Tracy\Debugger; -class SignInFormFactory +readonly class SignInFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly FormControlsFactory $controlsFactory, - private readonly User $user, - private readonly Manager $authenticator, - private readonly IRequest $httpRequest, + private FormFactory $factory, + private FormControlsFactory $controlsFactory, + private User $user, + private Manager $authenticator, + private IRequest $httpRequest, ) { } diff --git a/site/app/Form/SignInHoneypotFormFactory.php b/site/app/Form/SignInHoneypotFormFactory.php index 3da2d4518..9d0fd313a 100644 --- a/site/app/Form/SignInHoneypotFormFactory.php +++ b/site/app/Form/SignInHoneypotFormFactory.php @@ -8,13 +8,13 @@ use Nette\Utils\Html; use Tracy\Debugger; -class SignInHoneypotFormFactory +readonly class SignInHoneypotFormFactory { public function __construct( - private readonly UnprotectedFormFactory $factory, - private readonly FormControlsFactory $controlsFactory, - private readonly IRequest $httpRequest, + private UnprotectedFormFactory $factory, + private FormControlsFactory $controlsFactory, + private IRequest $httpRequest, ) { } diff --git a/site/app/Form/TalkFormFactory.php b/site/app/Form/TalkFormFactory.php index 236bda994..89d451957 100644 --- a/site/app/Form/TalkFormFactory.php +++ b/site/app/Form/TalkFormFactory.php @@ -13,16 +13,16 @@ use Nette\Utils\Html; use Nette\Utils\Strings; -class TalkFormFactory +readonly class TalkFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingControlsFactory $trainingControlsFactory, - private readonly Talks $talks, - private readonly LinkGenerator $linkGenerator, - private readonly VideoThumbnails $videoThumbnails, - private readonly Locales $locales, + private FormFactory $factory, + private TrainingControlsFactory $trainingControlsFactory, + private Talks $talks, + private LinkGenerator $linkGenerator, + private VideoThumbnails $videoThumbnails, + private Locales $locales, ) { } diff --git a/site/app/Form/TalkSlidesFormFactory.php b/site/app/Form/TalkSlidesFormFactory.php index 321c2dee3..785839fbb 100644 --- a/site/app/Form/TalkSlidesFormFactory.php +++ b/site/app/Form/TalkSlidesFormFactory.php @@ -12,14 +12,14 @@ use Nette\Forms\Container; use Nette\Utils\Html; -class TalkSlidesFormFactory +readonly class TalkSlidesFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TalkSlides $talkSlides, - private readonly TexyFormatter $texyFormatter, - private readonly SupportedImageFileFormats $supportedImageFileFormats, + private FormFactory $factory, + private TalkSlides $talkSlides, + private TexyFormatter $texyFormatter, + private SupportedImageFileFormats $supportedImageFileFormats, ) { } diff --git a/site/app/Form/TrainingApplicationAdminFormFactory.php b/site/app/Form/TrainingApplicationAdminFormFactory.php index e2f366697..8bb105521 100644 --- a/site/app/Form/TrainingApplicationAdminFormFactory.php +++ b/site/app/Form/TrainingApplicationAdminFormFactory.php @@ -16,16 +16,16 @@ use Nette\Forms\Controls\Checkbox; use Nette\Forms\Controls\SubmitButton; -class TrainingApplicationAdminFormFactory +readonly class TrainingApplicationAdminFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingApplicationStorage $trainingApplicationStorage, - private readonly TrainingDates $trainingDates, - private readonly UpcomingTrainingDates $upcomingTrainingDates, - private readonly TrainingControlsFactory $trainingControlsFactory, - private readonly Statuses $trainingStatuses, + private FormFactory $factory, + private TrainingApplicationStorage $trainingApplicationStorage, + private TrainingDates $trainingDates, + private UpcomingTrainingDates $upcomingTrainingDates, + private TrainingControlsFactory $trainingControlsFactory, + private Statuses $trainingStatuses, ) { } diff --git a/site/app/Form/TrainingApplicationFormFactory.php b/site/app/Form/TrainingApplicationFormFactory.php index 57b994fe5..450cc60dd 100644 --- a/site/app/Form/TrainingApplicationFormFactory.php +++ b/site/app/Form/TrainingApplicationFormFactory.php @@ -15,15 +15,15 @@ use Nette\Forms\Controls\TextInput; use Nette\Utils\Html; -class TrainingApplicationFormFactory +readonly class TrainingApplicationFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly Translator $translator, - private readonly TrainingControlsFactory $trainingControlsFactory, - private readonly TrainingDates $trainingDates, - private readonly TrainingApplicationFormSuccess $formSuccess, + private FormFactory $factory, + private Translator $translator, + private TrainingControlsFactory $trainingControlsFactory, + private TrainingDates $trainingDates, + private TrainingApplicationFormSuccess $formSuccess, ) { } diff --git a/site/app/Form/TrainingApplicationMultipleFormFactory.php b/site/app/Form/TrainingApplicationMultipleFormFactory.php index 962c671ae..a280ebdd1 100644 --- a/site/app/Form/TrainingApplicationMultipleFormFactory.php +++ b/site/app/Form/TrainingApplicationMultipleFormFactory.php @@ -9,15 +9,15 @@ use MichalSpacekCz\Training\Dates\TrainingDate; use MichalSpacekCz\Training\Statuses; -class TrainingApplicationMultipleFormFactory +readonly class TrainingApplicationMultipleFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingControlsFactory $trainingControlsFactory, - private readonly TrainingApplicationStorage $trainingApplicationStorage, - private readonly Statuses $trainingStatuses, - private readonly HttpInput $httpInput, + private FormFactory $factory, + private TrainingControlsFactory $trainingControlsFactory, + private TrainingApplicationStorage $trainingApplicationStorage, + private Statuses $trainingStatuses, + private HttpInput $httpInput, ) { } diff --git a/site/app/Form/TrainingApplicationPreliminaryFormFactory.php b/site/app/Form/TrainingApplicationPreliminaryFormFactory.php index 570f7582e..2c2d8342b 100644 --- a/site/app/Form/TrainingApplicationPreliminaryFormFactory.php +++ b/site/app/Form/TrainingApplicationPreliminaryFormFactory.php @@ -8,14 +8,14 @@ use MichalSpacekCz\Training\Applications\TrainingApplicationStorage; use MichalSpacekCz\Training\Exceptions\SpammyApplicationException; -class TrainingApplicationPreliminaryFormFactory +readonly class TrainingApplicationPreliminaryFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingControlsFactory $trainingControlsFactory, - private readonly TrainingApplicationStorage $trainingApplicationStorage, - private readonly TrainingApplicationFormSpam $formSpam, + private FormFactory $factory, + private TrainingControlsFactory $trainingControlsFactory, + private TrainingApplicationStorage $trainingApplicationStorage, + private TrainingApplicationFormSpam $formSpam, ) { } diff --git a/site/app/Form/TrainingDateFormFactory.php b/site/app/Form/TrainingDateFormFactory.php index 5263f5811..401a2e5be 100644 --- a/site/app/Form/TrainingDateFormFactory.php +++ b/site/app/Form/TrainingDateFormFactory.php @@ -12,7 +12,7 @@ use MichalSpacekCz\Training\Venues\TrainingVenues; use Nette\Forms\Controls\SubmitButton; -class TrainingDateFormFactory +readonly class TrainingDateFormFactory { private const STANDARD = 'Standardní'; @@ -22,13 +22,13 @@ class TrainingDateFormFactory public function __construct( - private readonly FormFactory $factory, - private readonly Trainings $trainings, - private readonly TrainingDates $trainingDates, - private readonly TrainingDateStatuses $trainingDateStatuses, - private readonly TrainingDatesFormValidator $trainingDatesFormValidator, - private readonly TrainingVenues $trainingVenues, - private readonly TrainingControlsFactory $trainingControlsFactory, + private FormFactory $factory, + private Trainings $trainings, + private TrainingDates $trainingDates, + private TrainingDateStatuses $trainingDateStatuses, + private TrainingDatesFormValidator $trainingDatesFormValidator, + private TrainingVenues $trainingVenues, + private TrainingControlsFactory $trainingControlsFactory, ) { } diff --git a/site/app/Form/TrainingFileFormFactory.php b/site/app/Form/TrainingFileFormFactory.php index 1a0b9d1ff..f4ef3170a 100644 --- a/site/app/Form/TrainingFileFormFactory.php +++ b/site/app/Form/TrainingFileFormFactory.php @@ -7,12 +7,12 @@ use MichalSpacekCz\Training\Files\TrainingFiles; use Nette\Utils\Html; -class TrainingFileFormFactory +readonly class TrainingFileFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingFiles $trainingFiles, + private FormFactory $factory, + private TrainingFiles $trainingFiles, ) { } diff --git a/site/app/Form/TrainingInvoiceFormFactory.php b/site/app/Form/TrainingInvoiceFormFactory.php index 46abf34da..8915deab8 100644 --- a/site/app/Form/TrainingInvoiceFormFactory.php +++ b/site/app/Form/TrainingInvoiceFormFactory.php @@ -6,13 +6,13 @@ use MichalSpacekCz\Form\Controls\TrainingControlsFactory; use MichalSpacekCz\Training\Applications\TrainingApplications; -class TrainingInvoiceFormFactory +readonly class TrainingInvoiceFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingApplications $trainingApplications, - private readonly TrainingControlsFactory $trainingControlsFactory, + private FormFactory $factory, + private TrainingApplications $trainingApplications, + private TrainingControlsFactory $trainingControlsFactory, ) { } diff --git a/site/app/Form/TrainingMailsOutboxFormFactory.php b/site/app/Form/TrainingMailsOutboxFormFactory.php index 38a251580..fb446ec0b 100644 --- a/site/app/Form/TrainingMailsOutboxFormFactory.php +++ b/site/app/Form/TrainingMailsOutboxFormFactory.php @@ -13,16 +13,16 @@ use Nette\Application\UI\Presenter; use stdClass; -class TrainingMailsOutboxFormFactory +readonly class TrainingMailsOutboxFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingApplicationStorage $trainingApplicationStorage, - private readonly Statuses $trainingStatuses, - private readonly TrainingMails $trainingMails, - private readonly TemplateFactory $templateFactory, - private readonly NetteApplication $netteApplication, + private FormFactory $factory, + private TrainingApplicationStorage $trainingApplicationStorage, + private Statuses $trainingStatuses, + private TrainingMails $trainingMails, + private TemplateFactory $templateFactory, + private NetteApplication $netteApplication, ) { } diff --git a/site/app/Form/TrainingReviewFormFactory.php b/site/app/Form/TrainingReviewFormFactory.php index 831b89fa1..71dac1b2f 100644 --- a/site/app/Form/TrainingReviewFormFactory.php +++ b/site/app/Form/TrainingReviewFormFactory.php @@ -9,13 +9,13 @@ use Nette\Forms\Controls\SubmitButton; use Nette\Utils\Html; -class TrainingReviewFormFactory +readonly class TrainingReviewFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingApplications $trainingApplications, - private readonly TrainingReviews $trainingReviews, + private FormFactory $factory, + private TrainingApplications $trainingApplications, + private TrainingReviews $trainingReviews, ) { } diff --git a/site/app/Form/TrainingStatusesFormFactory.php b/site/app/Form/TrainingStatusesFormFactory.php index 7c019cb22..5e31bb40c 100644 --- a/site/app/Form/TrainingStatusesFormFactory.php +++ b/site/app/Form/TrainingStatusesFormFactory.php @@ -9,14 +9,14 @@ use MichalSpacekCz\Training\Statuses; use Nette\Utils\Html; -class TrainingStatusesFormFactory +readonly class TrainingStatusesFormFactory { public function __construct( - private readonly FormFactory $factory, - private readonly TrainingControlsFactory $trainingControlsFactory, - private readonly TrainingApplications $trainingApplications, - private readonly Statuses $trainingStatuses, + private FormFactory $factory, + private TrainingControlsFactory $trainingControlsFactory, + private TrainingApplications $trainingApplications, + private Statuses $trainingStatuses, ) { } diff --git a/site/app/Form/UpcKeysSsidFormFactory.php b/site/app/Form/UpcKeysSsidFormFactory.php index 1febbc21b..b0cb96247 100644 --- a/site/app/Form/UpcKeysSsidFormFactory.php +++ b/site/app/Form/UpcKeysSsidFormFactory.php @@ -5,12 +5,12 @@ use MichalSpacekCz\UpcKeys\UpcKeys; -class UpcKeysSsidFormFactory +readonly class UpcKeysSsidFormFactory { public function __construct( - private readonly UnprotectedFormFactory $factory, - private readonly UpcKeys $upcKeys, + private UnprotectedFormFactory $factory, + private UpcKeys $upcKeys, ) { } diff --git a/site/app/Formatter/TexyPhraseHandler.php b/site/app/Formatter/TexyPhraseHandler.php index 6149a9920..26ba591ca 100644 --- a/site/app/Formatter/TexyPhraseHandler.php +++ b/site/app/Formatter/TexyPhraseHandler.php @@ -20,7 +20,7 @@ use Texy\Link; use Texy\Modifier; -class TexyPhraseHandler +readonly class TexyPhraseHandler { private const TRAINING_ACTION = 'Www:Trainings:training'; @@ -28,11 +28,11 @@ class TexyPhraseHandler public function __construct( - private readonly Application $application, - private readonly TrainingLocales $trainingLocales, - private readonly LocaleLinkGenerator $localeLinkGenerator, - private readonly BlogPostLocaleUrls $blogPostLocaleUrls, - private readonly Translator $translator, + private Application $application, + private TrainingLocales $trainingLocales, + private LocaleLinkGenerator $localeLinkGenerator, + private BlogPostLocaleUrls $blogPostLocaleUrls, + private Translator $translator, ) { } diff --git a/site/app/Formatter/TrainingDateTexyFormatterPlaceholder.php b/site/app/Formatter/TrainingDateTexyFormatterPlaceholder.php index 8c245dd9f..6afdd27d9 100644 --- a/site/app/Formatter/TrainingDateTexyFormatterPlaceholder.php +++ b/site/app/Formatter/TrainingDateTexyFormatterPlaceholder.php @@ -9,13 +9,13 @@ use Nette\Utils\Html; use Override; -class TrainingDateTexyFormatterPlaceholder implements TexyFormatterPlaceholder +readonly class TrainingDateTexyFormatterPlaceholder implements TexyFormatterPlaceholder { public function __construct( - private readonly Translator $translator, - private readonly UpcomingTrainingDates $upcomingTrainingDates, - private readonly DateTimeFormatter $dateTimeFormatter, + private Translator $translator, + private UpcomingTrainingDates $upcomingTrainingDates, + private DateTimeFormatter $dateTimeFormatter, ) { } diff --git a/site/app/Http/Client/HttpClientResponse.php b/site/app/Http/Client/HttpClientResponse.php index 89955696a..8d4792d2d 100644 --- a/site/app/Http/Client/HttpClientResponse.php +++ b/site/app/Http/Client/HttpClientResponse.php @@ -7,13 +7,13 @@ use MichalSpacekCz\Http\Exceptions\HttpClientTlsCertificateNotCapturedException; use OpenSSLCertificate; -class HttpClientResponse +readonly class HttpClientResponse { public function __construct( - private readonly HttpClientRequest $request, - private readonly string $body, - private readonly ?OpenSSLCertificate $tlsCertificate, + private HttpClientRequest $request, + private string $body, + private ?OpenSSLCertificate $tlsCertificate, ) { } diff --git a/site/app/Http/Cookies/CookieDescription.php b/site/app/Http/Cookies/CookieDescription.php index 0be557340..bdff7d83f 100644 --- a/site/app/Http/Cookies/CookieDescription.php +++ b/site/app/Http/Cookies/CookieDescription.php @@ -5,14 +5,14 @@ use Nette\Utils\Html; -class CookieDescription +readonly class CookieDescription { public function __construct( - private readonly string $name, - private readonly bool $internal, - private readonly Html $description, - private readonly ?int $validDays, + private string $name, + private bool $internal, + private Html $description, + private ?int $validDays, ) { } diff --git a/site/app/Http/Cookies/CookieDescriptions.php b/site/app/Http/Cookies/CookieDescriptions.php index a805a9aee..031d146e4 100644 --- a/site/app/Http/Cookies/CookieDescriptions.php +++ b/site/app/Http/Cookies/CookieDescriptions.php @@ -11,15 +11,15 @@ use Nette\Http\Helpers; use Nette\Http\Session; -class CookieDescriptions +readonly class CookieDescriptions { public function __construct( - private readonly Manager $authenticator, - private readonly Theme $theme, - private readonly Session $sessionHandler, - private readonly TexyFormatter $texyFormatter, - private readonly DateTime $dateTime, + private Manager $authenticator, + private Theme $theme, + private Session $sessionHandler, + private TexyFormatter $texyFormatter, + private DateTime $dateTime, ) { } diff --git a/site/app/Http/Cookies/Cookies.php b/site/app/Http/Cookies/Cookies.php index 0e10b07a5..983cf449f 100644 --- a/site/app/Http/Cookies/Cookies.php +++ b/site/app/Http/Cookies/Cookies.php @@ -8,12 +8,12 @@ use Nette\Http\IResponse; use Nette\Http\Response; -class Cookies +readonly class Cookies { public function __construct( - private readonly IRequest $request, - private readonly IResponse $response, + private IRequest $request, + private IResponse $response, ) { } diff --git a/site/app/Http/HttpInput.php b/site/app/Http/HttpInput.php index db8bd13fe..3eb48879d 100644 --- a/site/app/Http/HttpInput.php +++ b/site/app/Http/HttpInput.php @@ -5,11 +5,11 @@ use Nette\Http\IRequest; -class HttpInput +readonly class HttpInput { public function __construct( - private readonly IRequest $request, + private IRequest $request, ) { } diff --git a/site/app/Http/Redirections.php b/site/app/Http/Redirections.php index 6e4f6b927..06b46f7e2 100644 --- a/site/app/Http/Redirections.php +++ b/site/app/Http/Redirections.php @@ -7,11 +7,11 @@ use Nette\Database\Explorer; use Nette\Http\UrlScript; -class Redirections +readonly class Redirections { public function __construct( - private readonly Explorer $database, + private Explorer $database, ) { } diff --git a/site/app/Http/SecurityHeaders.php b/site/app/Http/SecurityHeaders.php index f65391d38..858a8fd3c 100644 --- a/site/app/Http/SecurityHeaders.php +++ b/site/app/Http/SecurityHeaders.php @@ -12,22 +12,22 @@ use Nette\Http\UrlImmutable; use Spaze\ContentSecurityPolicy\CspConfig; -class SecurityHeaders +readonly class SecurityHeaders { /** @var array */ - private readonly array $permissionsPolicy; + private array $permissionsPolicy; /** * @param array $permissionsPolicy */ public function __construct( - private readonly IRequest $httpRequest, - private readonly IResponse $httpResponse, - private readonly Application $application, - private readonly CspConfig $contentSecurityPolicy, - private readonly LocaleLinkGenerator $localeLinkGenerator, + private IRequest $httpRequest, + private IResponse $httpResponse, + private Application $application, + private CspConfig $contentSecurityPolicy, + private LocaleLinkGenerator $localeLinkGenerator, array $permissionsPolicy, ) { $this->permissionsPolicy = $this->normalizePermissionsPolicyValues($permissionsPolicy); diff --git a/site/app/Interviews/Interview.php b/site/app/Interviews/Interview.php index c664f1a18..7c8de8b23 100644 --- a/site/app/Interviews/Interview.php +++ b/site/app/Interviews/Interview.php @@ -7,23 +7,23 @@ use MichalSpacekCz\Media\Video; use Nette\Utils\Html; -class Interview +readonly class Interview { public function __construct( - private readonly int $id, - private readonly string $action, - private readonly string $title, - private readonly ?string $descriptionTexy, - private readonly ?Html $description, - private readonly DateTime $date, - private readonly string $href, - private readonly ?string $audioHref, - private readonly ?string $audioEmbed, - private readonly Video $video, - private readonly ?string $videoEmbed, - private readonly string $sourceName, - private readonly string $sourceHref, + private int $id, + private string $action, + private string $title, + private ?string $descriptionTexy, + private ?Html $description, + private DateTime $date, + private string $href, + private ?string $audioHref, + private ?string $audioEmbed, + private Video $video, + private ?string $videoEmbed, + private string $sourceName, + private string $sourceHref, ) { } diff --git a/site/app/Interviews/InterviewInputsFactory.php b/site/app/Interviews/InterviewInputsFactory.php index 48fde91a0..fe400ed61 100644 --- a/site/app/Interviews/InterviewInputsFactory.php +++ b/site/app/Interviews/InterviewInputsFactory.php @@ -6,12 +6,12 @@ use MichalSpacekCz\Form\InterviewFormFactory; use MichalSpacekCz\Media\VideoThumbnails; -class InterviewInputsFactory +readonly class InterviewInputsFactory { public function __construct( - private readonly VideoThumbnails $videoThumbnails, - private readonly InterviewFormFactory $interviewFormFactory, + private VideoThumbnails $videoThumbnails, + private InterviewFormFactory $interviewFormFactory, ) { } diff --git a/site/app/Interviews/Interviews.php b/site/app/Interviews/Interviews.php index 21ff30add..4169300c7 100644 --- a/site/app/Interviews/Interviews.php +++ b/site/app/Interviews/Interviews.php @@ -11,13 +11,13 @@ use Nette\Database\Explorer; use Nette\Database\Row; -class Interviews +readonly class Interviews { public function __construct( - private readonly Explorer $database, - private readonly VideoFactory $videoFactory, - private readonly TexyFormatter $texyFormatter, + private Explorer $database, + private VideoFactory $videoFactory, + private TexyFormatter $texyFormatter, ) { } diff --git a/site/app/Media/Photo.php b/site/app/Media/Photo.php index 0753f1e8c..6c382d6e9 100644 --- a/site/app/Media/Photo.php +++ b/site/app/Media/Photo.php @@ -5,17 +5,17 @@ use Nette\Utils\Html; -class Photo +readonly class Photo { /** * @param array $sizes */ public function __construct( - private readonly string $title, - private readonly string $file, - private readonly string|Html $description, - private readonly array $sizes, + private string $title, + private string $file, + private string|Html $description, + private array $sizes, ) { } diff --git a/site/app/Media/VideoFactory.php b/site/app/Media/VideoFactory.php index 081e23300..901654170 100644 --- a/site/app/Media/VideoFactory.php +++ b/site/app/Media/VideoFactory.php @@ -7,13 +7,13 @@ use MichalSpacekCz\Media\Resources\MediaResources; use Nette\Database\Row; -class VideoFactory +readonly class VideoFactory { public function __construct( - private readonly MediaResources $mediaResources, - private readonly SupportedImageFileFormats $supportedImageFileFormats, - private readonly VideoThumbnails $videoThumbnails, + private MediaResources $mediaResources, + private SupportedImageFileFormats $supportedImageFileFormats, + private VideoThumbnails $videoThumbnails, ) { } diff --git a/site/app/Media/VideoThumbnailFileUploads.php b/site/app/Media/VideoThumbnailFileUploads.php index ee0029e6b..723a80f72 100644 --- a/site/app/Media/VideoThumbnailFileUploads.php +++ b/site/app/Media/VideoThumbnailFileUploads.php @@ -5,12 +5,12 @@ use Nette\Forms\Controls\UploadControl; -class VideoThumbnailFileUploads +readonly class VideoThumbnailFileUploads { public function __construct( - private readonly UploadControl $videoThumbnail, - private readonly UploadControl $videoThumbnailAlternative, + private UploadControl $videoThumbnail, + private UploadControl $videoThumbnailAlternative, ) { } diff --git a/site/app/Media/VideoThumbnails.php b/site/app/Media/VideoThumbnails.php index 56ef44878..33c7ca200 100644 --- a/site/app/Media/VideoThumbnails.php +++ b/site/app/Media/VideoThumbnails.php @@ -14,7 +14,7 @@ use Nette\Utils\ImageException; use stdClass; -class VideoThumbnails +readonly class VideoThumbnails { private const VIDEO_THUMBNAIL_WIDTH = 320; @@ -22,8 +22,8 @@ class VideoThumbnails public function __construct( - private readonly MediaResources $mediaResources, - private readonly SupportedImageFileFormats $supportedImageFileFormats, + private MediaResources $mediaResources, + private SupportedImageFileFormats $supportedImageFileFormats, ) { } diff --git a/site/app/Net/DnsRecord.php b/site/app/Net/DnsRecord.php index b2a9071f2..d874874f7 100644 --- a/site/app/Net/DnsRecord.php +++ b/site/app/Net/DnsRecord.php @@ -3,16 +3,16 @@ namespace MichalSpacekCz\Net; -class DnsRecord +readonly class DnsRecord { public function __construct( - private readonly string $host, - private readonly string $class, - private readonly int $ttl, - private readonly string $type, - private readonly ?string $ip = null, - private readonly ?string $ipv6 = null, + private string $host, + private string $class, + private int $ttl, + private string $type, + private ?string $ip = null, + private ?string $ipv6 = null, ) { } diff --git a/site/app/Pulse/Companies.php b/site/app/Pulse/Companies.php index 2aa047d28..31bdceef8 100644 --- a/site/app/Pulse/Companies.php +++ b/site/app/Pulse/Companies.php @@ -7,11 +7,11 @@ use Nette\Database\Explorer; use Nette\Database\Row; -class Companies +readonly class Companies { public function __construct( - private readonly Explorer $database, + private Explorer $database, ) { } diff --git a/site/app/Pulse/Company.php b/site/app/Pulse/Company.php index d09ad99b8..fa928a516 100644 --- a/site/app/Pulse/Company.php +++ b/site/app/Pulse/Company.php @@ -3,15 +3,15 @@ namespace MichalSpacekCz\Pulse; -class Company +readonly class Company { public function __construct( - private readonly int $id, - private readonly string $companyName, - private readonly ?string $tradeName, - private readonly string $companyAlias, - private readonly string $sortName, + private int $id, + private string $companyName, + private ?string $tradeName, + private string $companyAlias, + private string $sortName, ) { } diff --git a/site/app/Pulse/Passwords/AlgorithmAttributes.php b/site/app/Pulse/Passwords/AlgorithmAttributes.php index 4f06db5ad..c391b3fdd 100644 --- a/site/app/Pulse/Passwords/AlgorithmAttributes.php +++ b/site/app/Pulse/Passwords/AlgorithmAttributes.php @@ -3,7 +3,7 @@ namespace MichalSpacekCz\Pulse\Passwords; -class AlgorithmAttributes +readonly class AlgorithmAttributes { /** @@ -12,9 +12,9 @@ class AlgorithmAttributes * @param array|null $params */ public function __construct( - private readonly ?array $inner, - private readonly ?array $outer, - private readonly ?array $params, + private ?array $inner, + private ?array $outer, + private ?array $params, ) { } diff --git a/site/app/Pulse/Passwords/AlgorithmAttributesFactory.php b/site/app/Pulse/Passwords/AlgorithmAttributesFactory.php index e42e5c5a6..6ed63bf04 100644 --- a/site/app/Pulse/Passwords/AlgorithmAttributesFactory.php +++ b/site/app/Pulse/Passwords/AlgorithmAttributesFactory.php @@ -9,11 +9,11 @@ use Nette\Utils\Json; use Nette\Utils\JsonException; -class AlgorithmAttributesFactory +readonly class AlgorithmAttributesFactory { public function __construct( - private readonly Processor $schemaProcessor, + private Processor $schemaProcessor, ) { } diff --git a/site/app/Pulse/Passwords/Passwords.php b/site/app/Pulse/Passwords/Passwords.php index 0e7836b27..710f05092 100644 --- a/site/app/Pulse/Passwords/Passwords.php +++ b/site/app/Pulse/Passwords/Passwords.php @@ -11,16 +11,16 @@ use Nette\Database\Row; use Nette\Utils\ArrayHash; -class Passwords +readonly class Passwords { public function __construct( - private readonly Explorer $database, - private readonly Rating $rating, - private readonly Companies $companies, - private readonly Sites $sites, - private readonly PasswordsSorting $sorting, - private readonly StorageRegistryFactory $storageRegistryFactory, + private Explorer $database, + private Rating $rating, + private Companies $companies, + private Sites $sites, + private PasswordsSorting $sorting, + private StorageRegistryFactory $storageRegistryFactory, ) { } diff --git a/site/app/Pulse/Passwords/SearchMatcher.php b/site/app/Pulse/Passwords/SearchMatcher.php index 9b9e49116..b4cf6a4dd 100644 --- a/site/app/Pulse/Passwords/SearchMatcher.php +++ b/site/app/Pulse/Passwords/SearchMatcher.php @@ -7,7 +7,7 @@ use MichalSpacekCz\Pulse\SpecificSite; use Nette\Utils\Strings; -class SearchMatcher +readonly class SearchMatcher { private ?string $search; @@ -15,7 +15,7 @@ class SearchMatcher public function __construct( ?string $search, - private readonly StorageRegistry $storageRegistry, + private StorageRegistry $storageRegistry, ) { $this->search = $search ? Strings::webalize($search) : null; } diff --git a/site/app/Pulse/Passwords/StorageDisclosure.php b/site/app/Pulse/Passwords/StorageDisclosure.php index 815319a53..e27be973c 100644 --- a/site/app/Pulse/Passwords/StorageDisclosure.php +++ b/site/app/Pulse/Passwords/StorageDisclosure.php @@ -5,18 +5,18 @@ use DateTimeInterface; -class StorageDisclosure +readonly class StorageDisclosure { public function __construct( - private readonly int $id, - private readonly string $url, - private readonly string $archive, - private readonly ?string $note, - private readonly ?DateTimeInterface $published, - private readonly ?DateTimeInterface $added, - private readonly string $type, - private readonly string $typeAlias, + private int $id, + private string $url, + private string $archive, + private ?string $note, + private ?DateTimeInterface $published, + private ?DateTimeInterface $added, + private string $type, + private string $typeAlias, ) { } diff --git a/site/app/Pulse/Passwords/StorageRegistryFactory.php b/site/app/Pulse/Passwords/StorageRegistryFactory.php index 2136a8c3a..d882949ac 100644 --- a/site/app/Pulse/Passwords/StorageRegistryFactory.php +++ b/site/app/Pulse/Passwords/StorageRegistryFactory.php @@ -13,14 +13,14 @@ use Nette\Utils\Json; use Nette\Utils\JsonException; -class StorageRegistryFactory +readonly class StorageRegistryFactory { public function __construct( - private readonly Rating $rating, - private readonly Sites $sites, - private readonly PasswordsSorting $sorting, - private readonly AlgorithmAttributesFactory $algorithmAttributesFactory, + private Rating $rating, + private Sites $sites, + private PasswordsSorting $sorting, + private AlgorithmAttributesFactory $algorithmAttributesFactory, ) { } diff --git a/site/app/Pulse/Passwords/StorageSharedWith.php b/site/app/Pulse/Passwords/StorageSharedWith.php index 42e7ab1b4..b0eced53d 100644 --- a/site/app/Pulse/Passwords/StorageSharedWith.php +++ b/site/app/Pulse/Passwords/StorageSharedWith.php @@ -3,12 +3,12 @@ namespace MichalSpacekCz\Pulse\Passwords; -class StorageSharedWith +readonly class StorageSharedWith { public function __construct( - private readonly string $url, - private readonly string $alias, + private string $url, + private string $alias, ) { } diff --git a/site/app/Pulse/Presenters/ErrorGenericPresenter.php b/site/app/Pulse/Presenters/ErrorGenericPresenter.php index eec84621a..542ddbd4c 100644 --- a/site/app/Pulse/Presenters/ErrorGenericPresenter.php +++ b/site/app/Pulse/Presenters/ErrorGenericPresenter.php @@ -9,11 +9,11 @@ use Nette\Application\Response; use Override; -class ErrorGenericPresenter implements IPresenter +readonly class ErrorGenericPresenter implements IPresenter { public function __construct( - private readonly Error $error, + private Error $error, ) { } diff --git a/site/app/Pulse/Sites.php b/site/app/Pulse/Sites.php index 4e17e4da4..f10253e85 100644 --- a/site/app/Pulse/Sites.php +++ b/site/app/Pulse/Sites.php @@ -7,14 +7,14 @@ use Nette\Database\Explorer; use Nette\Database\Row; -class Sites +readonly class Sites { public const ALL = 'all'; public function __construct( - private readonly Explorer $database, + private Explorer $database, ) { } diff --git a/site/app/Tags/Tags.php b/site/app/Tags/Tags.php index 6b85c780e..fc5264624 100644 --- a/site/app/Tags/Tags.php +++ b/site/app/Tags/Tags.php @@ -10,11 +10,11 @@ use Nette\Utils\JsonException; use Nette\Utils\Strings; -class Tags +readonly class Tags { public function __construct( - private readonly JsonUtils $jsonUtils, + private JsonUtils $jsonUtils, ) { } diff --git a/site/app/Talks/Slides/TalkSlide.php b/site/app/Talks/Slides/TalkSlide.php index b17c03b06..061b710db 100644 --- a/site/app/Talks/Slides/TalkSlide.php +++ b/site/app/Talks/Slides/TalkSlide.php @@ -5,22 +5,22 @@ use Nette\Utils\Html; -class TalkSlide +readonly class TalkSlide { public function __construct( - private readonly int $id, - private readonly string $alias, - private readonly int $number, - private readonly ?string $filename, - private readonly ?string $filenameAlternative, - private readonly ?int $filenamesTalkId, - private readonly string $title, - private readonly Html $speakerNotes, - private readonly string $speakerNotesTexy, - private readonly ?string $image, - private readonly ?string $imageAlternative, - private readonly ?string $imageAlternativeType, + private int $id, + private string $alias, + private int $number, + private ?string $filename, + private ?string $filenameAlternative, + private ?int $filenamesTalkId, + private string $title, + private Html $speakerNotes, + private string $speakerNotesTexy, + private ?string $image, + private ?string $imageAlternative, + private ?string $imageAlternativeType, ) { } diff --git a/site/app/Talks/Talk.php b/site/app/Talks/Talk.php index ddb5adb77..e84827a85 100644 --- a/site/app/Talks/Talk.php +++ b/site/app/Talks/Talk.php @@ -7,43 +7,43 @@ use MichalSpacekCz\Media\Video; use Nette\Utils\Html; -class Talk +readonly class Talk { public function __construct( - private readonly int $id, - private readonly int $localeId, - private readonly string $locale, - private readonly ?int $translationGroupId, - private readonly ?string $action, - private readonly ?string $url, - private readonly Html $title, - private readonly string $titleTexy, - private readonly ?Html $description, - private readonly ?string $descriptionTexy, - private readonly DateTime $date, - private readonly ?int $duration, - private readonly ?string $href, - private readonly bool $hasSlides, - private readonly ?string $slidesHref, - private readonly ?string $slidesEmbed, - private readonly ?Html $slidesNote, - private readonly ?string $slidesNoteTexy, - private readonly Video $video, - private readonly ?string $videoEmbed, - private readonly Html $event, - private readonly string $eventTexy, - private readonly ?string $eventHref, - private readonly ?string $ogImage, - private readonly ?Html $transcript, - private readonly ?string $transcriptTexy, - private readonly ?string $favorite, - private readonly ?int $slidesTalkId, - private readonly ?int $filenamesTalkId, - private readonly ?int $supersededById, - private readonly ?string $supersededByAction, - private readonly ?string $supersededByTitle, - private readonly bool $publishSlides, + private int $id, + private int $localeId, + private string $locale, + private ?int $translationGroupId, + private ?string $action, + private ?string $url, + private Html $title, + private string $titleTexy, + private ?Html $description, + private ?string $descriptionTexy, + private DateTime $date, + private ?int $duration, + private ?string $href, + private bool $hasSlides, + private ?string $slidesHref, + private ?string $slidesEmbed, + private ?Html $slidesNote, + private ?string $slidesNoteTexy, + private Video $video, + private ?string $videoEmbed, + private Html $event, + private string $eventTexy, + private ?string $eventHref, + private ?string $ogImage, + private ?Html $transcript, + private ?string $transcriptTexy, + private ?string $favorite, + private ?int $slidesTalkId, + private ?int $filenamesTalkId, + private ?int $supersededById, + private ?string $supersededByAction, + private ?string $supersededByTitle, + private bool $publishSlides, ) { } diff --git a/site/app/Talks/TalkFactory.php b/site/app/Talks/TalkFactory.php index 305695d62..59a442077 100644 --- a/site/app/Talks/TalkFactory.php +++ b/site/app/Talks/TalkFactory.php @@ -11,14 +11,14 @@ use Nette\Application\UI\InvalidLinkException; use Nette\Database\Row; -class TalkFactory +readonly class TalkFactory { public function __construct( - private readonly TexyFormatter $texyFormatter, - private readonly VideoFactory $videoFactory, - private readonly Translator $translator, - private readonly LocaleLinkGenerator $localeLinkGenerator, + private TexyFormatter $texyFormatter, + private VideoFactory $videoFactory, + private Translator $translator, + private LocaleLinkGenerator $localeLinkGenerator, ) { } diff --git a/site/app/Talks/TalkInputsFactory.php b/site/app/Talks/TalkInputsFactory.php index 1a93d66a0..112c412ed 100644 --- a/site/app/Talks/TalkInputsFactory.php +++ b/site/app/Talks/TalkInputsFactory.php @@ -6,12 +6,12 @@ use MichalSpacekCz\Form\TalkFormFactory; use MichalSpacekCz\Media\VideoThumbnails; -class TalkInputsFactory +readonly class TalkInputsFactory { public function __construct( - private readonly VideoThumbnails $videoThumbnails, - private readonly TalkFormFactory $talkFormFactory, + private VideoThumbnails $videoThumbnails, + private TalkFormFactory $talkFormFactory, ) { } diff --git a/site/app/Talks/TalkLocaleUrls.php b/site/app/Talks/TalkLocaleUrls.php index 57889d54f..dc2bddd5b 100644 --- a/site/app/Talks/TalkLocaleUrls.php +++ b/site/app/Talks/TalkLocaleUrls.php @@ -5,11 +5,11 @@ use Nette\Database\Explorer; -class TalkLocaleUrls +readonly class TalkLocaleUrls { public function __construct( - private readonly Explorer $database, + private Explorer $database, ) { } diff --git a/site/app/Talks/Talks.php b/site/app/Talks/Talks.php index cbebb6c7d..a6f0c18df 100644 --- a/site/app/Talks/Talks.php +++ b/site/app/Talks/Talks.php @@ -12,13 +12,13 @@ use Nette\Database\Explorer; use Nette\Utils\Html; -class Talks +readonly class Talks { public function __construct( - private readonly Explorer $database, - private readonly TexyFormatter $texyFormatter, - private readonly TalkFactory $talkFactory, + private Explorer $database, + private TexyFormatter $texyFormatter, + private TalkFactory $talkFactory, ) { } diff --git a/site/app/Templating/Filters.php b/site/app/Templating/Filters.php index 2bac6b8bf..cc76a2f99 100644 --- a/site/app/Templating/Filters.php +++ b/site/app/Templating/Filters.php @@ -8,12 +8,12 @@ use Nette\Utils\Html; use Stringable; -class Filters +readonly class Filters { public function __construct( - private readonly TexyFormatter $texyFormatter, - private readonly DateTimeFormatter $dateTimeFormatter, + private TexyFormatter $texyFormatter, + private DateTimeFormatter $dateTimeFormatter, ) { } diff --git a/site/app/Templating/TemplateFactory.php b/site/app/Templating/TemplateFactory.php index b2f609b69..039d23b29 100644 --- a/site/app/Templating/TemplateFactory.php +++ b/site/app/Templating/TemplateFactory.php @@ -12,14 +12,14 @@ use Nette\Bridges\ApplicationLatte\TemplateFactory as ApplicationTemplateFactory; use Override; -class TemplateFactory implements UiTemplateFactory +readonly class TemplateFactory implements UiTemplateFactory { public function __construct( - private readonly Theme $theme, - private readonly Filters $filters, - private readonly Translator $translator, - private readonly ApplicationTemplateFactory $templateFactory, + private Theme $theme, + private Filters $filters, + private Translator $translator, + private ApplicationTemplateFactory $templateFactory, ) { } diff --git a/site/app/Test/Application/ApplicationPresenter.php b/site/app/Test/Application/ApplicationPresenter.php index 19ec6a286..b3432cc40 100644 --- a/site/app/Test/Application/ApplicationPresenter.php +++ b/site/app/Test/Application/ApplicationPresenter.php @@ -13,11 +13,11 @@ use Override; use ReflectionException; -class ApplicationPresenter +readonly class ApplicationPresenter { public function __construct( - private readonly IPresenterFactory $presenterFactory, + private IPresenterFactory $presenterFactory, ) { } diff --git a/site/app/Test/Http/Cookie.php b/site/app/Test/Http/Cookie.php index c5dcf4679..aa0c783c9 100644 --- a/site/app/Test/Http/Cookie.php +++ b/site/app/Test/Http/Cookie.php @@ -5,16 +5,16 @@ use DateTimeInterface; -class Cookie +readonly class Cookie { public function __construct( - private readonly string $name, - private readonly string $value, - private readonly string|int|DateTimeInterface|null $expire, - private readonly string $path, - private readonly string $domain, - private readonly bool $secure, + private string $name, + private string $value, + private string|int|DateTimeInterface|null $expire, + private string $path, + private string $domain, + private bool $secure, ) { } diff --git a/site/app/Tls/Certificate.php b/site/app/Tls/Certificate.php index 197a97c91..2e9e614c6 100644 --- a/site/app/Tls/Certificate.php +++ b/site/app/Tls/Certificate.php @@ -9,7 +9,7 @@ use MichalSpacekCz\Tls\Exceptions\CertificateException; use Override; -class Certificate implements JsonSerializable +readonly class Certificate implements JsonSerializable { private int $validDays; @@ -22,13 +22,13 @@ class Certificate implements JsonSerializable * @throws CertificateException */ public function __construct( - private readonly string $commonName, - private readonly ?string $commonNameExt, - private readonly DateTimeImmutable $notBefore, - private readonly DateTimeImmutable $notAfter, - private readonly int $expiringThreshold, - private readonly ?string $serialNumber, - private readonly DateTimeImmutable $now = new DateTimeImmutable(), + private string $commonName, + private ?string $commonNameExt, + private DateTimeImmutable $notBefore, + private DateTimeImmutable $notAfter, + private int $expiringThreshold, + private ?string $serialNumber, + private DateTimeImmutable $now = new DateTimeImmutable(), ) { $validDays = $this->notBefore->diff($this->now)->days; if ($validDays === false) { diff --git a/site/app/Tls/CertificateAttempt.php b/site/app/Tls/CertificateAttempt.php index c18dfa9f0..c379e06cc 100644 --- a/site/app/Tls/CertificateAttempt.php +++ b/site/app/Tls/CertificateAttempt.php @@ -3,12 +3,12 @@ namespace MichalSpacekCz\Tls; -class CertificateAttempt +readonly class CertificateAttempt { public function __construct( - private readonly string $commonName, - private readonly ?string $commonNameExt, + private string $commonName, + private ?string $commonNameExt, ) { } diff --git a/site/app/Tls/CertificateFactory.php b/site/app/Tls/CertificateFactory.php index 319ce4287..6c34b3eca 100644 --- a/site/app/Tls/CertificateFactory.php +++ b/site/app/Tls/CertificateFactory.php @@ -16,13 +16,13 @@ use Nette\Database\Row; use OpenSSLCertificate; -class CertificateFactory +readonly class CertificateFactory { public function __construct( - private readonly DateTimeZoneFactory $dateTimeZoneFactory, - private readonly DateTimeFactory $dateTimeFactory, - private readonly int $expiringThreshold, + private DateTimeZoneFactory $dateTimeZoneFactory, + private DateTimeFactory $dateTimeFactory, + private int $expiringThreshold, ) { } diff --git a/site/app/Tls/CertificateGatherer.php b/site/app/Tls/CertificateGatherer.php index 0eac8e2b4..f71ec6158 100644 --- a/site/app/Tls/CertificateGatherer.php +++ b/site/app/Tls/CertificateGatherer.php @@ -15,13 +15,13 @@ use MichalSpacekCz\Tls\Exceptions\OpenSslException; use MichalSpacekCz\Tls\Exceptions\OpenSslX509ParseException; -class CertificateGatherer +readonly class CertificateGatherer { public function __construct( - private readonly CertificateFactory $certificateFactory, - private readonly HttpClient $httpClient, - private readonly DnsResolver $dnsResolver, + private CertificateFactory $certificateFactory, + private HttpClient $httpClient, + private DnsResolver $dnsResolver, ) { } diff --git a/site/app/Tls/Certificates.php b/site/app/Tls/Certificates.php index 3146a8d9a..4ce804f7e 100644 --- a/site/app/Tls/Certificates.php +++ b/site/app/Tls/Certificates.php @@ -14,17 +14,17 @@ use Nette\Security\Authenticator; use Tracy\Debugger; -class Certificates +readonly class Certificates { /** * @param array $users */ public function __construct( - private readonly Explorer $database, - private readonly CertificateFactory $certificateFactory, - private readonly array $users, - private readonly int $hideExpiredAfter, + private Explorer $database, + private CertificateFactory $certificateFactory, + private array $users, + private int $hideExpiredAfter, ) { } diff --git a/site/app/Tls/CertificatesApiClient.php b/site/app/Tls/CertificatesApiClient.php index 98d52d49c..71baa2781 100644 --- a/site/app/Tls/CertificatesApiClient.php +++ b/site/app/Tls/CertificatesApiClient.php @@ -18,14 +18,14 @@ use Nette\Utils\Json; use Nette\Utils\JsonException; -class CertificatesApiClient +readonly class CertificatesApiClient { public function __construct( - private readonly LinkGenerator $linkGenerator, - private readonly CertificateFactory $certificateFactory, - private readonly HttpClient $httpClient, - private readonly Processor $schemaProcessor, + private LinkGenerator $linkGenerator, + private CertificateFactory $certificateFactory, + private HttpClient $httpClient, + private Processor $schemaProcessor, ) { } diff --git a/site/app/Tls/OpenSslX509ParseResult.php b/site/app/Tls/OpenSslX509ParseResult.php index 38a12707b..3a6bc2e6e 100644 --- a/site/app/Tls/OpenSslX509ParseResult.php +++ b/site/app/Tls/OpenSslX509ParseResult.php @@ -3,14 +3,14 @@ namespace MichalSpacekCz\Tls; -class OpenSslX509ParseResult +readonly class OpenSslX509ParseResult { public function __construct( - private readonly string $commonName, - private readonly int $validFromTimeT, - private readonly int $validToTimeT, - private readonly string $serialNumberHex, + private string $commonName, + private int $validFromTimeT, + private int $validToTimeT, + private string $serialNumberHex, ) { } diff --git a/site/app/Training/ApplicationForm/TrainingApplicationFormSuccess.php b/site/app/Training/ApplicationForm/TrainingApplicationFormSuccess.php index db60b180a..6fa106739 100644 --- a/site/app/Training/ApplicationForm/TrainingApplicationFormSuccess.php +++ b/site/app/Training/ApplicationForm/TrainingApplicationFormSuccess.php @@ -25,16 +25,16 @@ use stdClass; use Tracy\Debugger; -class TrainingApplicationFormSuccess +readonly class TrainingApplicationFormSuccess { public function __construct( - private readonly TrainingApplicationFormSpam $formSpam, - private readonly TrainingApplicationStorage $trainingApplicationStorage, - private readonly TrainingMails $trainingMails, - private readonly TemplateFactory $templateFactory, - private readonly TrainingApplicationFormDataLogger $formDataLogger, - private readonly NetteApplication $netteApplication, + private TrainingApplicationFormSpam $formSpam, + private TrainingApplicationStorage $trainingApplicationStorage, + private TrainingMails $trainingMails, + private TemplateFactory $templateFactory, + private TrainingApplicationFormDataLogger $formDataLogger, + private NetteApplication $netteApplication, ) { } diff --git a/site/app/Training/Applications/TrainingApplicationFactory.php b/site/app/Training/Applications/TrainingApplicationFactory.php index 2e81aa6c5..fdc6fb91a 100644 --- a/site/app/Training/Applications/TrainingApplicationFactory.php +++ b/site/app/Training/Applications/TrainingApplicationFactory.php @@ -13,16 +13,16 @@ use SodiumException; use Spaze\Encryption\Symmetric\StaticKey; -class TrainingApplicationFactory +readonly class TrainingApplicationFactory { public function __construct( - private readonly Statuses $trainingStatuses, - private readonly TrainingMailMessageFactory $trainingMailMessageFactory, - private readonly StaticKey $emailEncryption, - private readonly TexyFormatter $texyFormatter, - private readonly TrainingApplicationSources $trainingApplicationSources, - private readonly TrainingFiles $trainingFiles, + private Statuses $trainingStatuses, + private TrainingMailMessageFactory $trainingMailMessageFactory, + private StaticKey $emailEncryption, + private TexyFormatter $texyFormatter, + private TrainingApplicationSources $trainingApplicationSources, + private TrainingFiles $trainingFiles, ) { } diff --git a/site/app/Training/Applications/TrainingApplicationSources.php b/site/app/Training/Applications/TrainingApplicationSources.php index d172b800e..587aa4090 100644 --- a/site/app/Training/Applications/TrainingApplicationSources.php +++ b/site/app/Training/Applications/TrainingApplicationSources.php @@ -8,12 +8,12 @@ use Nette\Database\Explorer; use Nette\Utils\Strings; -class TrainingApplicationSources +readonly class TrainingApplicationSources { public function __construct( - private readonly Explorer $database, - private readonly Vrana $vranaResolver, + private Explorer $database, + private Vrana $vranaResolver, ) { } diff --git a/site/app/Training/Applications/TrainingApplicationStorage.php b/site/app/Training/Applications/TrainingApplicationStorage.php index 9d90a29ef..c75824572 100644 --- a/site/app/Training/Applications/TrainingApplicationStorage.php +++ b/site/app/Training/Applications/TrainingApplicationStorage.php @@ -19,15 +19,15 @@ use Spaze\Encryption\Symmetric\StaticKey; use Tracy\Debugger; -class TrainingApplicationStorage +readonly class TrainingApplicationStorage { public function __construct( - private readonly Explorer $database, - private readonly Statuses $trainingStatuses, - private readonly TrainingApplicationSources $trainingApplicationSources, - private readonly StaticKey $emailEncryption, - private readonly Prices $prices, + private Explorer $database, + private Statuses $trainingStatuses, + private TrainingApplicationSources $trainingApplicationSources, + private StaticKey $emailEncryption, + private Prices $prices, ) { } diff --git a/site/app/Training/Company/CompanyTraining.php b/site/app/Training/Company/CompanyTraining.php index f0270309f..50515bbfb 100644 --- a/site/app/Training/Company/CompanyTraining.php +++ b/site/app/Training/Company/CompanyTraining.php @@ -5,29 +5,29 @@ use Nette\Utils\Html; -class CompanyTraining +readonly class CompanyTraining { public function __construct( - private readonly int $id, - private readonly string $action, - private readonly Html $name, - private readonly ?Html $description, - private readonly Html $content, - private readonly ?Html $upsell, - private readonly ?Html $prerequisites, - private readonly ?Html $audience, - private readonly ?int $capacity, - private readonly ?int $price, - private readonly ?int $alternativeDurationPrice, - private readonly ?int $studentDiscount, - private readonly ?Html $materials, - private readonly bool $custom, - private readonly Html $duration, - private readonly Html $alternativeDuration, - private readonly ?Html $alternativeDurationPriceText, - private readonly ?int $successorId, - private readonly ?int $discontinuedId, + private int $id, + private string $action, + private Html $name, + private ?Html $description, + private Html $content, + private ?Html $upsell, + private ?Html $prerequisites, + private ?Html $audience, + private ?int $capacity, + private ?int $price, + private ?int $alternativeDurationPrice, + private ?int $studentDiscount, + private ?Html $materials, + private bool $custom, + private Html $duration, + private Html $alternativeDuration, + private ?Html $alternativeDurationPriceText, + private ?int $successorId, + private ?int $discontinuedId, ) { } diff --git a/site/app/Training/Company/CompanyTrainings.php b/site/app/Training/Company/CompanyTrainings.php index 5d5458f54..3fa8293b9 100644 --- a/site/app/Training/Company/CompanyTrainings.php +++ b/site/app/Training/Company/CompanyTrainings.php @@ -13,15 +13,15 @@ use Nette\Database\Row; use Nette\Utils\Html; -class CompanyTrainings +readonly class CompanyTrainings { public function __construct( - private readonly Explorer $database, - private readonly TexyFormatter $texyFormatter, - private readonly UpcomingTrainingDates $upcomingTrainingDates, - private readonly Translator $translator, - private readonly Prices $prices, + private Explorer $database, + private TexyFormatter $texyFormatter, + private UpcomingTrainingDates $upcomingTrainingDates, + private Translator $translator, + private Prices $prices, ) { } diff --git a/site/app/Training/DateList/UpcomingTrainingDatesListFactory.php b/site/app/Training/DateList/UpcomingTrainingDatesListFactory.php index bb77185ec..28014c06e 100644 --- a/site/app/Training/DateList/UpcomingTrainingDatesListFactory.php +++ b/site/app/Training/DateList/UpcomingTrainingDatesListFactory.php @@ -6,12 +6,12 @@ use MichalSpacekCz\Training\Dates\UpcomingTrainingDates; use MichalSpacekCz\Training\FreeSeats; -class UpcomingTrainingDatesListFactory +readonly class UpcomingTrainingDatesListFactory { public function __construct( - private readonly UpcomingTrainingDates $upcomingTrainingDates, - private readonly FreeSeats $freeSeats, + private UpcomingTrainingDates $upcomingTrainingDates, + private FreeSeats $freeSeats, ) { } diff --git a/site/app/Training/Dates/TrainingDateFactory.php b/site/app/Training/Dates/TrainingDateFactory.php index e8b8759e5..bc316a93f 100644 --- a/site/app/Training/Dates/TrainingDateFactory.php +++ b/site/app/Training/Dates/TrainingDateFactory.php @@ -10,16 +10,16 @@ use Nette\Database\Row; use Nette\Utils\Json; -class TrainingDateFactory +readonly class TrainingDateFactory { private const LAST_FREE_SEATS_THRESHOLD_DAYS = 7; public function __construct( - private readonly Translator $translator, - private readonly TexyFormatter $texyFormatter, - private readonly Prices $prices, + private Translator $translator, + private TexyFormatter $texyFormatter, + private Prices $prices, ) { } diff --git a/site/app/Training/Dates/TrainingDateInputsFactory.php b/site/app/Training/Dates/TrainingDateInputsFactory.php index 41603a621..869c67c2c 100644 --- a/site/app/Training/Dates/TrainingDateInputsFactory.php +++ b/site/app/Training/Dates/TrainingDateInputsFactory.php @@ -5,11 +5,11 @@ use MichalSpacekCz\Form\TrainingDateFormFactory; -class TrainingDateInputsFactory +readonly class TrainingDateInputsFactory { public function __construct( - private readonly TrainingDateFormFactory $trainingDateFormFactory, + private TrainingDateFormFactory $trainingDateFormFactory, ) { } diff --git a/site/app/Training/Dates/TrainingDateStatuses.php b/site/app/Training/Dates/TrainingDateStatuses.php index ac7199702..bdeeaee92 100644 --- a/site/app/Training/Dates/TrainingDateStatuses.php +++ b/site/app/Training/Dates/TrainingDateStatuses.php @@ -6,11 +6,11 @@ use MichalSpacekCz\ShouldNotHappenException; use Nette\Database\Explorer; -class TrainingDateStatuses +readonly class TrainingDateStatuses { public function __construct( - private readonly Explorer $database, + private Explorer $database, ) { } diff --git a/site/app/Training/Discontinued/DiscontinuedTraining.php b/site/app/Training/Discontinued/DiscontinuedTraining.php index 5e165646a..3ec528af8 100644 --- a/site/app/Training/Discontinued/DiscontinuedTraining.php +++ b/site/app/Training/Discontinued/DiscontinuedTraining.php @@ -3,16 +3,16 @@ namespace MichalSpacekCz\Training\Discontinued; -class DiscontinuedTraining +readonly class DiscontinuedTraining { /** * @param list $trainings */ public function __construct( - private readonly string $description, - private readonly array $trainings, - private readonly string $newHref, + private string $description, + private array $trainings, + private string $newHref, ) { } diff --git a/site/app/Training/Discontinued/DiscontinuedTrainings.php b/site/app/Training/Discontinued/DiscontinuedTrainings.php index fafe87da3..28504912f 100644 --- a/site/app/Training/Discontinued/DiscontinuedTrainings.php +++ b/site/app/Training/Discontinued/DiscontinuedTrainings.php @@ -8,12 +8,12 @@ use Nette\Database\Explorer; use Nette\Http\IResponse; -class DiscontinuedTrainings +readonly class DiscontinuedTrainings { public function __construct( - private readonly Explorer $database, - private readonly IResponse $httpResponse, + private Explorer $database, + private IResponse $httpResponse, ) { } diff --git a/site/app/Training/Files/TrainingFile.php b/site/app/Training/Files/TrainingFile.php index 4ebc5fc82..a30f5e15f 100644 --- a/site/app/Training/Files/TrainingFile.php +++ b/site/app/Training/Files/TrainingFile.php @@ -7,16 +7,16 @@ use DateTimeInterface; use SplFileInfo; -class TrainingFile +readonly class TrainingFile { private DateTimeImmutable $added; public function __construct( - private readonly int $id, - private readonly string $filename, - private readonly SplFileInfo $fileInfo, + private int $id, + private string $filename, + private SplFileInfo $fileInfo, DateTimeInterface $added, ) { $this->added = DateTimeImmutable::createFromInterface($added); diff --git a/site/app/Training/Files/TrainingFileFactory.php b/site/app/Training/Files/TrainingFileFactory.php index fe0850ae3..deecd3881 100644 --- a/site/app/Training/Files/TrainingFileFactory.php +++ b/site/app/Training/Files/TrainingFileFactory.php @@ -6,11 +6,11 @@ use Nette\Database\Row; use SplFileInfo; -class TrainingFileFactory +readonly class TrainingFileFactory { public function __construct( - private readonly TrainingFilesStorage $storage, + private TrainingFilesStorage $storage, ) { } diff --git a/site/app/Training/Files/TrainingFiles.php b/site/app/Training/Files/TrainingFiles.php index 0847632d2..e107cb57f 100644 --- a/site/app/Training/Files/TrainingFiles.php +++ b/site/app/Training/Files/TrainingFiles.php @@ -11,14 +11,14 @@ use Nette\Http\FileUpload; use Nette\Utils\FileSystem; -class TrainingFiles +readonly class TrainingFiles { public function __construct( - private readonly Explorer $database, - private readonly Statuses $trainingStatuses, - private readonly TrainingFileFactory $trainingFileFactory, - private readonly TrainingFilesStorage $trainingFilesStorage, + private Explorer $database, + private Statuses $trainingStatuses, + private TrainingFileFactory $trainingFileFactory, + private TrainingFilesStorage $trainingFilesStorage, ) { } diff --git a/site/app/Training/Files/TrainingFilesDownload.php b/site/app/Training/Files/TrainingFilesDownload.php index 10d164677..25489056d 100644 --- a/site/app/Training/Files/TrainingFilesDownload.php +++ b/site/app/Training/Files/TrainingFilesDownload.php @@ -17,14 +17,14 @@ use ParagonIE\Halite\Alerts\HaliteAlert; use SodiumException; -class TrainingFilesDownload +readonly class TrainingFilesDownload { public function __construct( - private readonly Application $application, - private readonly TrainingApplications $trainingApplications, - private readonly Session $sessionHandler, - private readonly TrainingFiles $trainingFiles, + private Application $application, + private TrainingApplications $trainingApplications, + private Session $sessionHandler, + private TrainingFiles $trainingFiles, ) { } diff --git a/site/app/Training/Mails/MailMessageAdmin.php b/site/app/Training/Mails/MailMessageAdmin.php index cdd9ca4ee..3874d0d4c 100644 --- a/site/app/Training/Mails/MailMessageAdmin.php +++ b/site/app/Training/Mails/MailMessageAdmin.php @@ -3,12 +3,12 @@ namespace MichalSpacekCz\Training\Mails; -class MailMessageAdmin +readonly class MailMessageAdmin { public function __construct( - private readonly string $basename, - private readonly string $subject, + private string $basename, + private string $subject, ) { } diff --git a/site/app/Training/Mails/TrainingMailMessageFactory.php b/site/app/Training/Mails/TrainingMailMessageFactory.php index a66e163ba..1dfe18d14 100644 --- a/site/app/Training/Mails/TrainingMailMessageFactory.php +++ b/site/app/Training/Mails/TrainingMailMessageFactory.php @@ -8,12 +8,12 @@ use MichalSpacekCz\Training\Applications\TrainingApplication; use MichalSpacekCz\Training\Statuses; -class TrainingMailMessageFactory +readonly class TrainingMailMessageFactory { public function __construct( - private readonly Statuses $trainingStatuses, - private readonly DateTimeFormatter $dateTimeFormatter, + private Statuses $trainingStatuses, + private DateTimeFormatter $dateTimeFormatter, ) { } diff --git a/site/app/Training/Mails/TrainingMails.php b/site/app/Training/Mails/TrainingMails.php index fc50a12f6..69e109640 100644 --- a/site/app/Training/Mails/TrainingMails.php +++ b/site/app/Training/Mails/TrainingMails.php @@ -23,22 +23,22 @@ use SodiumException; use Tracy\Debugger; -class TrainingMails +readonly class TrainingMails { private const REMINDER_DAYS = 5; public function __construct( - private readonly Mailer $mailer, - private readonly TrainingApplications $trainingApplications, - private readonly PreliminaryTrainings $trainingPreliminaryApplications, - private readonly TrainingDates $trainingDates, - private readonly Statuses $trainingStatuses, - private readonly TrainingVenues $trainingVenues, - private readonly TrainingMailMessageFactory $trainingMailMessageFactory, - private readonly string $emailFrom, - private readonly string $phoneNumber, + private Mailer $mailer, + private TrainingApplications $trainingApplications, + private PreliminaryTrainings $trainingPreliminaryApplications, + private TrainingDates $trainingDates, + private Statuses $trainingStatuses, + private TrainingVenues $trainingVenues, + private TrainingMailMessageFactory $trainingMailMessageFactory, + private string $emailFrom, + private string $phoneNumber, ) { } diff --git a/site/app/Training/Preliminary/PreliminaryTrainings.php b/site/app/Training/Preliminary/PreliminaryTrainings.php index e5d4e44bd..db991b7b2 100644 --- a/site/app/Training/Preliminary/PreliminaryTrainings.php +++ b/site/app/Training/Preliminary/PreliminaryTrainings.php @@ -13,14 +13,14 @@ use ParagonIE\Halite\Alerts\HaliteAlert; use SodiumException; -class PreliminaryTrainings +readonly class PreliminaryTrainings { public function __construct( - private readonly Explorer $database, - private readonly UpcomingTrainingDates $upcomingTrainingDates, - private readonly TrainingApplicationFactory $trainingApplicationFactory, - private readonly Translator $translator, + private Explorer $database, + private UpcomingTrainingDates $upcomingTrainingDates, + private TrainingApplicationFactory $trainingApplicationFactory, + private Translator $translator, ) { } diff --git a/site/app/Training/Price.php b/site/app/Training/Price.php index 6138f793d..eadd4444e 100644 --- a/site/app/Training/Price.php +++ b/site/app/Training/Price.php @@ -6,14 +6,14 @@ use MichalSpacekCz\ShouldNotHappenException; use NumberFormatter; -class Price +readonly class Price { public function __construct( - private readonly ?float $price, - private readonly ?int $discount, - private readonly ?float $vatRate, - private readonly ?float $priceVat = null, + private ?float $price, + private ?int $discount, + private ?float $vatRate, + private ?float $priceVat = null, ) { } diff --git a/site/app/Training/Prices.php b/site/app/Training/Prices.php index 2406acacd..c8876fa39 100644 --- a/site/app/Training/Prices.php +++ b/site/app/Training/Prices.php @@ -3,11 +3,11 @@ namespace MichalSpacekCz\Training; -class Prices +readonly class Prices { public function __construct( - private readonly float $vatRate, + private float $vatRate, ) { } diff --git a/site/app/Training/Reviews/TrainingReview.php b/site/app/Training/Reviews/TrainingReview.php index 5e0459592..7957e02c5 100644 --- a/site/app/Training/Reviews/TrainingReview.php +++ b/site/app/Training/Reviews/TrainingReview.php @@ -5,24 +5,24 @@ use Nette\Utils\Html; -class TrainingReview +readonly class TrainingReview { /** * @param positive-int|null $ranking */ public function __construct( - private readonly int $id, - private readonly string $name, - private readonly string $company, - private readonly ?string $jobTitle, - private readonly Html $review, - private readonly string $reviewTexy, - private readonly ?string $href, - private readonly bool $hidden, - private readonly ?int $ranking, - private readonly ?string $note, - private readonly int $dateId, + private int $id, + private string $name, + private string $company, + private ?string $jobTitle, + private Html $review, + private string $reviewTexy, + private ?string $href, + private bool $hidden, + private ?int $ranking, + private ?string $note, + private int $dateId, ) { } diff --git a/site/app/Training/Reviews/TrainingReviews.php b/site/app/Training/Reviews/TrainingReviews.php index 86787da7d..a1cecf5d8 100644 --- a/site/app/Training/Reviews/TrainingReviews.php +++ b/site/app/Training/Reviews/TrainingReviews.php @@ -9,12 +9,12 @@ use Nette\Database\Explorer; use Nette\Database\Row; -class TrainingReviews +readonly class TrainingReviews { public function __construct( - private readonly Explorer $database, - private readonly TexyFormatter $texyFormatter, + private Explorer $database, + private TexyFormatter $texyFormatter, ) { } diff --git a/site/app/Training/TrainingLocales.php b/site/app/Training/TrainingLocales.php index 007bedaf9..34eac27e4 100644 --- a/site/app/Training/TrainingLocales.php +++ b/site/app/Training/TrainingLocales.php @@ -6,12 +6,12 @@ use MichalSpacekCz\Application\Locale\LocaleLinkGenerator; use Nette\Database\Explorer; -class TrainingLocales +readonly class TrainingLocales { public function __construct( - private readonly Explorer $database, - private readonly LocaleLinkGenerator $localeLinkGenerator, + private Explorer $database, + private LocaleLinkGenerator $localeLinkGenerator, ) { } diff --git a/site/app/Training/Trainings/Training.php b/site/app/Training/Trainings/Training.php index cef1c7599..bf24b19fa 100644 --- a/site/app/Training/Trainings/Training.php +++ b/site/app/Training/Trainings/Training.php @@ -5,25 +5,25 @@ use Nette\Utils\Html; -class Training +readonly class Training { public function __construct( - private readonly int $id, - private readonly string $action, - private readonly Html $name, - private readonly Html $description, - private readonly Html $content, - private readonly ?Html $upsell, - private readonly ?Html $prerequisites, - private readonly ?Html $audience, - private readonly ?int $capacity, - private readonly ?int $price, - private readonly ?int $studentDiscount, - private readonly ?Html $materials, - private readonly bool $custom, - private readonly ?int $successorId, - private readonly ?int $discontinuedId, + private int $id, + private string $action, + private Html $name, + private Html $description, + private Html $content, + private ?Html $upsell, + private ?Html $prerequisites, + private ?Html $audience, + private ?int $capacity, + private ?int $price, + private ?int $studentDiscount, + private ?Html $materials, + private bool $custom, + private ?int $successorId, + private ?int $discontinuedId, ) { } diff --git a/site/app/Training/Trainings/TrainingFactory.php b/site/app/Training/Trainings/TrainingFactory.php index 01c75518f..1bc5c82e2 100644 --- a/site/app/Training/Trainings/TrainingFactory.php +++ b/site/app/Training/Trainings/TrainingFactory.php @@ -6,11 +6,11 @@ use MichalSpacekCz\Formatter\TexyFormatter; use Nette\Database\Row; -class TrainingFactory +readonly class TrainingFactory { public function __construct( - private readonly TexyFormatter $texyFormatter, + private TexyFormatter $texyFormatter, ) { } diff --git a/site/app/Training/Venues/TrainingVenue.php b/site/app/Training/Venues/TrainingVenue.php index 92bd3a68b..3caec35f5 100644 --- a/site/app/Training/Venues/TrainingVenue.php +++ b/site/app/Training/Venues/TrainingVenue.php @@ -5,26 +5,26 @@ use Nette\Utils\Html; -class TrainingVenue +readonly class TrainingVenue { public function __construct( - private readonly int $id, - private readonly string $name, - private readonly ?string $nameExtended, - private readonly string $href, - private readonly string $address, - private readonly string $city, - private readonly ?Html $description, - private readonly ?string $descriptionTexy, - private readonly ?string $action, - private readonly ?string $entrance, - private readonly ?string $entranceNavigation, - private readonly ?string $streetview, - private readonly ?Html $parking, - private readonly ?string $parkingTexy, - private readonly ?Html $publicTransport, - private readonly ?string $publicTransportTexy, + private int $id, + private string $name, + private ?string $nameExtended, + private string $href, + private string $address, + private string $city, + private ?Html $description, + private ?string $descriptionTexy, + private ?string $action, + private ?string $entrance, + private ?string $entranceNavigation, + private ?string $streetview, + private ?Html $parking, + private ?string $parkingTexy, + private ?Html $publicTransport, + private ?string $publicTransportTexy, ) { } diff --git a/site/app/Training/Venues/TrainingVenues.php b/site/app/Training/Venues/TrainingVenues.php index 9285b97b4..b30fe3bf4 100644 --- a/site/app/Training/Venues/TrainingVenues.php +++ b/site/app/Training/Venues/TrainingVenues.php @@ -8,12 +8,12 @@ use Nette\Database\Explorer; use Nette\Database\Row; -class TrainingVenues +readonly class TrainingVenues { public function __construct( - private readonly Explorer $database, - private readonly TexyFormatter $texyFormatter, + private Explorer $database, + private TexyFormatter $texyFormatter, ) { } diff --git a/site/app/Twitter/TwitterCard.php b/site/app/Twitter/TwitterCard.php index 27f99ce48..5fd590d4c 100644 --- a/site/app/Twitter/TwitterCard.php +++ b/site/app/Twitter/TwitterCard.php @@ -3,13 +3,13 @@ namespace MichalSpacekCz\Twitter; -class TwitterCard +readonly class TwitterCard { public function __construct( - private readonly int $id, - private readonly string $card, - private readonly string $title, + private int $id, + private string $card, + private string $title, ) { } diff --git a/site/app/Twitter/TwitterCards.php b/site/app/Twitter/TwitterCards.php index 7feef4519..188d2008d 100644 --- a/site/app/Twitter/TwitterCards.php +++ b/site/app/Twitter/TwitterCards.php @@ -6,11 +6,11 @@ use MichalSpacekCz\Twitter\Exceptions\TwitterCardNotFoundException; use Nette\Database\Explorer; -class TwitterCards +readonly class TwitterCards { public function __construct( - private readonly Explorer $database, + private Explorer $database, ) { } diff --git a/site/app/UpcKeys/Technicolor.php b/site/app/UpcKeys/Technicolor.php index 988887a68..30ce43e90 100644 --- a/site/app/UpcKeys/Technicolor.php +++ b/site/app/UpcKeys/Technicolor.php @@ -19,17 +19,17 @@ use PDOException; use Tracy\Debugger; -class Technicolor implements UpcWiFiRouter +readonly class Technicolor implements UpcWiFiRouter { private const PREFIXES = ['SAAP', 'SAPP', 'SBAP']; public function __construct( - private readonly Explorer $database, - private readonly HttpClient $httpClient, - private readonly string $apiUrl, - private readonly string $apiKey, + private Explorer $database, + private HttpClient $httpClient, + private string $apiUrl, + private string $apiKey, ) { } diff --git a/site/app/UpcKeys/Ubee.php b/site/app/UpcKeys/Ubee.php index 78fb60808..cd203e4e5 100644 --- a/site/app/UpcKeys/Ubee.php +++ b/site/app/UpcKeys/Ubee.php @@ -6,7 +6,7 @@ use Nette\Database\Explorer; use Override; -class Ubee implements UpcWiFiRouter +readonly class Ubee implements UpcWiFiRouter { private const OUI_UBEE = '647c34'; @@ -14,7 +14,7 @@ class Ubee implements UpcWiFiRouter public function __construct( - private readonly Explorer $database, + private Explorer $database, ) { } diff --git a/site/app/UpcKeys/WiFiKey.php b/site/app/UpcKeys/WiFiKey.php index 9968a5af2..28b9014b1 100644 --- a/site/app/UpcKeys/WiFiKey.php +++ b/site/app/UpcKeys/WiFiKey.php @@ -6,16 +6,16 @@ use JsonSerializable; use Override; -class WiFiKey implements JsonSerializable +readonly class WiFiKey implements JsonSerializable { public function __construct( - private readonly string $serial, - private readonly string $serialPrefix, - private readonly ?string $oui, - private readonly ?string $mac, - private readonly string $key, - private readonly WiFiBand $type, + private string $serial, + private string $serialPrefix, + private ?string $oui, + private ?string $mac, + private string $key, + private WiFiBand $type, ) { } diff --git a/site/app/User/Manager.php b/site/app/User/Manager.php index bf06133b1..ee743ee5a 100644 --- a/site/app/User/Manager.php +++ b/site/app/User/Manager.php @@ -31,7 +31,7 @@ use Spaze\Encryption\Symmetric\StaticKey; use Tracy\Debugger; -class Manager implements Authenticator +readonly class Manager implements Authenticator { private const AUTH_SELECTOR_TOKEN_SEPARATOR = ':'; @@ -40,17 +40,17 @@ class Manager implements Authenticator private const TOKEN_RETURNING_USER = 2; - private ?string $authCookiesPath = null; + private string $authCookiesPath; public function __construct( - private readonly Explorer $database, - private readonly IRequest $httpRequest, - private readonly Cookies $cookies, - private readonly Passwords $passwords, - private readonly StaticKey $passwordEncryption, + private Explorer $database, + private IRequest $httpRequest, + private Cookies $cookies, + private Passwords $passwords, + private StaticKey $passwordEncryption, LinkGenerator $linkGenerator, - private readonly string $permanentLoginInterval, + private string $permanentLoginInterval, ) { $this->authCookiesPath = (new Url($linkGenerator->link('Admin:Sign:in')))->getPath(); } diff --git a/site/app/Utils/Strings.php b/site/app/Utils/Strings.php index 9ac9216e0..a7a297ec4 100644 --- a/site/app/Utils/Strings.php +++ b/site/app/Utils/Strings.php @@ -5,11 +5,11 @@ use Contributte\Translation\Translator; -class Strings +readonly class Strings { public function __construct( - private readonly Translator $translator, + private Translator $translator, ) { } diff --git a/site/app/Www/Presenters/ErrorGenericPresenter.php b/site/app/Www/Presenters/ErrorGenericPresenter.php index 23227c09d..80772df3e 100644 --- a/site/app/Www/Presenters/ErrorGenericPresenter.php +++ b/site/app/Www/Presenters/ErrorGenericPresenter.php @@ -9,11 +9,11 @@ use Nette\Application\Response; use Override; -class ErrorGenericPresenter implements IPresenter +readonly class ErrorGenericPresenter implements IPresenter { public function __construct( - private readonly Error $error, + private Error $error, ) { }