Skip to content

Commit 8e192d2

Browse files
committed
Move constructor before static methods.
1 parent 74cb1ba commit 8e192d2

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/ClassFilesIA/ClassFilesIA_NamespaceDirectoryPsr4.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77

88
class ClassFilesIA_NamespaceDirectoryPsr4 implements ClassFilesIAInterface {
99

10+
/**
11+
* @param string $directory
12+
* @param string $terminatedNamespace
13+
*/
14+
public function __construct(
15+
private readonly string $directory,
16+
private readonly string $terminatedNamespace,
17+
) {}
18+
1019
/**
1120
* @param string $dir
1221
* @param string $namespace
@@ -48,15 +57,6 @@ public static function createFromNsdirObject(NamespaceDirectory $nsdir): ClassFi
4857
);
4958
}
5059

51-
/**
52-
* @param string $directory
53-
* @param string $terminatedNamespace
54-
*/
55-
public function __construct(
56-
private readonly string $directory,
57-
private readonly string $terminatedNamespace,
58-
) {}
59-
6060
/**
6161
* {@inheritdoc}
6262
*/

src/NamespaceDirectory.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@
99
*/
1010
final class NamespaceDirectory implements ClassFilesIAInterface {
1111

12+
/**
13+
* Constructor.
14+
*
15+
* @param string $directory
16+
* Directory without trailing slash.
17+
* @param string $terminatedNamespace
18+
* Namespace ending with separator, or '' for the root namespace.
19+
*/
20+
private function __construct(
21+
private readonly string $directory,
22+
private readonly string $terminatedNamespace,
23+
) {}
24+
1225
/**
1326
* Creates a new instance.
1427
*
@@ -84,19 +97,6 @@ public static function fromReflectionClass(\ReflectionClass $reflection_class):
8497
);
8598
}
8699

87-
/**
88-
* Constructor.
89-
*
90-
* @param string $directory
91-
* Directory without trailing slash.
92-
* @param string $terminatedNamespace
93-
* Namespace ending with separator, or '' for the root namespace.
94-
*/
95-
private function __construct(
96-
private readonly string $directory,
97-
private readonly string $terminatedNamespace,
98-
) {}
99-
100100
/**
101101
* @param string $namespace
102102
*

0 commit comments

Comments
 (0)