Skip to content

Commit 59dd34d

Browse files
Use CPP where possible
1 parent e0856fe commit 59dd34d

File tree

4 files changed

+21
-22
lines changed

4 files changed

+21
-22
lines changed

Definition/NumericNode.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
*/
2121
class NumericNode extends ScalarNode
2222
{
23-
protected int|float|null $min;
24-
protected int|float|null $max;
25-
26-
public function __construct(?string $name, ?NodeInterface $parent = null, int|float|null $min = null, int|float|null $max = null, string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR)
27-
{
23+
public function __construct(
24+
?string $name,
25+
?NodeInterface $parent = null,
26+
protected int|float|null $min = null,
27+
protected int|float|null $max = null,
28+
string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR,
29+
) {
2830
parent::__construct($name, $parent, $pathSeparator);
29-
$this->min = $min;
30-
$this->max = $max;
3131
}
3232

3333
protected function finalizeValue(mixed $value): mixed

Exception/FileLocatorFileNotFoundException.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
*/
1919
class FileLocatorFileNotFoundException extends \InvalidArgumentException
2020
{
21-
private array $paths;
22-
23-
public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null, array $paths = [])
24-
{
21+
public function __construct(
22+
string $message = '',
23+
int $code = 0,
24+
?\Throwable $previous = null,
25+
private array $paths = [],
26+
) {
2527
parent::__construct($message, $code, $previous);
26-
27-
$this->paths = $paths;
2828
}
2929

3030
public function getPaths(): array

Loader/FileLoader.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ abstract class FileLoader extends Loader
2727
{
2828
protected static array $loading = [];
2929

30-
protected FileLocatorInterface $locator;
31-
3230
private ?string $currentDir = null;
3331

34-
public function __construct(FileLocatorInterface $locator, ?string $env = null)
35-
{
36-
$this->locator = $locator;
32+
public function __construct(
33+
protected FileLocatorInterface $locator,
34+
?string $env = null,
35+
) {
3736
parent::__construct($env);
3837
}
3938

Resource/ReflectionClassResource.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ class ReflectionClassResource implements SelfCheckingResourceInterface
2323
{
2424
private array $files = [];
2525
private string $className;
26-
private \ReflectionClass $classReflector;
2726
private array $excludedVendors = [];
2827
private string $hash;
2928

30-
public function __construct(\ReflectionClass $classReflector, array $excludedVendors = [])
31-
{
29+
public function __construct(
30+
private \ReflectionClass $classReflector,
31+
array $excludedVendors = [],
32+
) {
3233
$this->className = $classReflector->name;
33-
$this->classReflector = $classReflector;
3434
$this->excludedVendors = $excludedVendors;
3535
}
3636

0 commit comments

Comments
 (0)