From beeac2ba50a5dd729d8a23507ad09cdd0f82110c Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 10 Jan 2024 17:41:00 +0100 Subject: [PATCH] [Filesystem][Finder][Form] Use CPP --- Comparator/Comparator.php | 8 ++++---- SplFileInfo.php | 12 +++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Comparator/Comparator.php b/Comparator/Comparator.php index bd685834..c3d40e70 100644 --- a/Comparator/Comparator.php +++ b/Comparator/Comparator.php @@ -16,16 +16,16 @@ */ class Comparator { - private string $target; private string $operator; - public function __construct(string $target, string $operator = '==') - { + public function __construct( + private string $target, + string $operator = '==', + ) { if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); } - $this->target = $target; $this->operator = $operator; } diff --git a/SplFileInfo.php b/SplFileInfo.php index 867e8e81..2afc3782 100644 --- a/SplFileInfo.php +++ b/SplFileInfo.php @@ -18,19 +18,17 @@ */ class SplFileInfo extends \SplFileInfo { - private string $relativePath; - private string $relativePathname; - /** * @param string $file The file name * @param string $relativePath The relative path * @param string $relativePathname The relative path name */ - public function __construct(string $file, string $relativePath, string $relativePathname) - { + public function __construct( + string $file, + private string $relativePath, + private string $relativePathname, + ) { parent::__construct($file); - $this->relativePath = $relativePath; - $this->relativePathname = $relativePathname; } /**