Skip to content

Commit 3200b17

Browse files
author
Konrad Michalik
authored
Merge pull request #49 from move-elevator/update/php81-modernization-features
refactor: modernize codebase with PHP 8.1+ features
2 parents 6c30b0e + ce35141 commit 3200b17

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Parser/AbstractParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
abstract class AbstractParser
3030
{
31-
protected string $fileName = '';
31+
protected readonly string $fileName;
3232

33-
public function __construct(protected string $filePath)
33+
public function __construct(protected readonly string $filePath)
3434
{
3535
if (!file_exists($filePath)) {
3636
throw new InvalidArgumentException(sprintf('File "%s" does not exist.', $filePath));

src/Parser/JsonParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class JsonParser extends AbstractParser implements ParserInterface
3131
/** @var array<string, mixed> */
3232
private array $json = [];
3333

34-
public function __construct(protected string $filePath)
34+
public function __construct(string $filePath)
3535
{
3636
parent::__construct($filePath);
3737

src/Parser/PhpParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class PhpParser extends AbstractParser implements ParserInterface
3131
/** @var array<string, mixed> */
3232
private array $translations = [];
3333

34-
public function __construct(protected string $filePath)
34+
public function __construct(string $filePath)
3535
{
3636
parent::__construct($filePath);
3737

src/Parser/XliffParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class XliffParser extends AbstractParser implements ParserInterface
3636
* @throws InvalidArgumentException If file cannot be parsed as
3737
* valid XML
3838
*/
39-
public function __construct(protected string $filePath)
39+
public function __construct(string $filePath)
4040
{
4141
parent::__construct($filePath);
4242

src/Parser/YamlParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class YamlParser extends AbstractParser implements ParserInterface
3232
/** @var array<string, mixed> */
3333
private array $yaml = [];
3434

35-
public function __construct(protected string $filePath)
35+
public function __construct(string $filePath)
3636
{
3737
parent::__construct($filePath);
3838

0 commit comments

Comments
 (0)