Skip to content

Commit

Permalink
[Filesystem][Finder][Form] Use CPP
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark authored and xabbuh committed Jan 16, 2024
1 parent af2c8f6 commit beeac2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Comparator/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
12 changes: 5 additions & 7 deletions SplFileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit beeac2b

Please sign in to comment.