Skip to content

Commit 08fabae

Browse files
committed
bug #350 make:entity "Self" or "Parent" (Adrien Laconi, weaverryan)
This PR was merged into the 1.0-dev branch. Discussion ---------- make:entity "Self" or "Parent" After using ``make:entity Self`` or ``make:entity Parent``, maker-bundle build 2 files : ``` created: src/Entity/Self.php created: src/Repository/SelfRepository.php ``` But, after that : ``` Fatal error: Cannot use 'Self' as class name as it is reserved in /var/www/html/demo/src/Entity/Self.php on line 10 ``` ... and others "Call Stack" to finish with a "CRITICAL". You must remove ``src/Entity/Self.php`` and ``src/Repository/SelfRepository.php`` to continue. Commits ------- f6a011c lowercasing special chars because we compare to a lowercase string ec6ef77 Correction du problème lié à la création d'une classe "Self" ou "Parent" (make:entity), sinon une exception est levée APRES la création du fichier (Il faut forcément supprimer les fichiers générés).
2 parents 0361047 + f6a011c commit 08fabae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Validator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public static function validateClassName(string $className, string $errorMessage
4242
'static', 'switch', 'throw', 'trait', 'try', 'unset',
4343
'use', 'var', 'while', 'xor',
4444
'int', 'float', 'bool', 'string', 'true', 'false', 'null', 'void',
45-
'iterable', 'object', '__FILE__', '__LINE__', '__DIR__', '__FUNCTION__', '__CLASS__',
46-
'__METHOD__', '__NAMESPACE__', '__TRAIT__',
45+
'iterable', 'object', '__file__', '__line__', '__dir__', '__function__', '__class__',
46+
'__method__', '__namespace__', '__trait__', 'self', 'parent',
4747
];
4848

4949
foreach ($pieces as $piece) {

0 commit comments

Comments
 (0)