回答編集履歴
2
誤変換を修正
answer
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Composerなどでセットアップしてオートロードを行う場合、[PSR-4](https://www.php-fig.org/psr/psr-4/)にあるように、モジュール名やクラス
|
1
|
+
Composerなどでセットアップしてオートロードを行う場合、[PSR-4](https://www.php-fig.org/psr/psr-4/)にあるように、モジュール名やクラス名と大文字小文字が一致するようにファイル名を付ける必要があります。正しく設定しなければ、オートロードに失敗します。
|
2
2
|
|
3
3
|
> 2.3.2 The contiguous sub-namespace names after the “namespace prefix”
|
4
4
|
correspond to a subdirectory within a “base directory”, in which the
|
1
PSR-1を組み合わせると、こういう結論に
answer
CHANGED
@@ -5,4 +5,6 @@
|
|
5
5
|
namespace separators represent directory separators. The subdirectory
|
6
6
|
name MUST **match the case** of the sub-namespace names.
|
7
7
|
2.3.3 The terminating class name corresponds to a file name ending in .php.
|
8
|
-
The file name MUST **match the case** of the terminating class name. (太字は引用者)
|
8
|
+
The file name MUST **match the case** of the terminating class name. (太字は引用者)
|
9
|
+
|
10
|
+
そして、[PSR-1](https://www.php-fig.org/psr/psr-1/)では「Class names MUST be declared in `StudlyCaps`」となっていますので、この2つを組み合わせれば、クラス定義するファイルは**大文字を必然的に含む**ファイル名となります。
|