@@ -337,7 +337,7 @@ public function configureDependencies(DependencyBuilder $dependencies, InputInte
337
337
ORMDependencyBuilder::buildDependencies ($ dependencies );
338
338
}
339
339
340
- private function askForNextField (ConsoleStyle $ io , array $ fields , string $ entityClass , bool $ isFirstField )
340
+ private function askForNextField (ConsoleStyle $ io , array $ fields , string $ entityClass , bool $ isFirstField ): EntityRelation | array | null
341
341
{
342
342
$ io ->writeln ('' );
343
343
@@ -475,7 +475,7 @@ private function printAvailableTypes(ConsoleStyle $io): void
475
475
],
476
476
];
477
477
478
- $ printSection = function (array $ sectionTypes ) use ($ io , &$ allTypes ) {
478
+ $ printSection = static function (array $ sectionTypes ) use ($ io , &$ allTypes ) {
479
479
foreach ($ sectionTypes as $ mainType => $ subTypes ) {
480
480
unset($ allTypes [$ mainType ]);
481
481
$ line = sprintf (' * <comment>%s</comment> ' , $ mainType );
@@ -527,7 +527,7 @@ private function createEntityClassQuestion(string $questionText): Question
527
527
return $ question ;
528
528
}
529
529
530
- private function askRelationDetails (ConsoleStyle $ io , string $ generatedEntityClass , string $ type , string $ newFieldName )
530
+ private function askRelationDetails (ConsoleStyle $ io , string $ generatedEntityClass , string $ type , string $ newFieldName ): EntityRelation
531
531
{
532
532
// ask the targetEntity
533
533
$ targetEntityClass = null ;
@@ -573,15 +573,15 @@ function ($name) use ($targetClass) {
573
573
);
574
574
};
575
575
576
- $ askIsNullable = function (string $ propertyName , string $ targetClass ) use ($ io ) {
576
+ $ askIsNullable = static function (string $ propertyName , string $ targetClass ) use ($ io ) {
577
577
return $ io ->confirm (sprintf (
578
578
'Is the <comment>%s</comment>.<comment>%s</comment> property allowed to be null (nullable)? ' ,
579
579
Str::getShortClassName ($ targetClass ),
580
580
$ propertyName
581
581
));
582
582
};
583
583
584
- $ askOrphanRemoval = function (string $ owningClass , string $ inverseClass ) use ($ io ) {
584
+ $ askOrphanRemoval = static function (string $ owningClass , string $ inverseClass ) use ($ io ) {
585
585
$ io ->text ([
586
586
'Do you want to activate <comment>orphanRemoval</comment> on your relationship? ' ,
587
587
sprintf (
@@ -844,27 +844,27 @@ private function getPropertyNames(string $class): array
844
844
845
845
$ reflClass = new \ReflectionClass ($ class );
846
846
847
- return array_map (function (\ReflectionProperty $ prop ) {
847
+ return array_map (static function (\ReflectionProperty $ prop ) {
848
848
return $ prop ->getName ();
849
849
}, $ reflClass ->getProperties ());
850
850
}
851
851
852
- /** @legacy Drop when Annotations are no longer supported */
853
- private function doesEntityUseAnnotationMapping (string $ className ): bool
854
- {
855
- if (!class_exists ($ className )) {
856
- $ otherClassMetadatas = $ this ->doctrineHelper ->getMetadata (Str::getNamespace ($ className ).'\\' , true );
857
-
858
- // if we have no metadata, we should assume this is the first class being mapped
859
- if (empty ($ otherClassMetadatas )) {
860
- return false ;
861
- }
862
-
863
- $ className = reset ($ otherClassMetadatas )->getName ();
864
- }
865
-
866
- return $ this ->doctrineHelper ->isClassAnnotated ($ className );
867
- }
852
+ // /** @legacy Drop when Annotations are no longer supported */
853
+ // private function doesEntityUseAnnotationMapping(string $className): bool
854
+ // {
855
+ // if (!class_exists($className)) {
856
+ // $otherClassMetadatas = $this->doctrineHelper->getMetadata(Str::getNamespace($className).'\\', true);
857
+ //
858
+ // // if we have no metadata, we should assume this is the first class being mapped
859
+ // if (empty($otherClassMetadatas)) {
860
+ // return false;
861
+ // }
862
+ //
863
+ // $className = reset($otherClassMetadatas)->getName();
864
+ // }
865
+ //
866
+ // return $this->doctrineHelper->isClassAnnotated($className);
867
+ // }
868
868
869
869
/** @legacy Drop when Annotations are no longer supported */
870
870
private function doesEntityUseAttributeMapping (string $ className ): bool
0 commit comments