@@ -28,11 +28,6 @@ class GeneratorListener
2828 */
2929 private $ registry ;
3030
31- /**
32- * @var ContainerInterface
33- */
34- private $ container ;
35-
3631 /**
3732 * Registry has been made nullable as injecting it causes circular references. Instead, the container is injected
3833 * via a setter, and the registry is fetched from there instead.
@@ -46,14 +41,6 @@ public function __construct(Reader $reader, Registry $registry = null)
4641 $ this ->registry = $ registry ;
4742 }
4843
49- /**
50- * @param ContainerInterface $container
51- */
52- public function setContainer (ContainerInterface $ container )
53- {
54- $ this ->container = $ container ;
55- }
56-
5744 /**
5845 * @param LifecycleEventArgs $args
5946 */
@@ -92,7 +79,7 @@ public function prePersist(LifecycleEventArgs $args)
9279 private function generateString ($ property , GeneratorAnnotation $ annotation , $ entity )
9380 {
9481 /** @var GeneratorInterface|ConfigurableGeneratorInterface $generator */
95- $ generator = $ this ->getRegistry () ->get ($ annotation ->generator );
82+ $ generator = $ this ->registry ->get ($ annotation ->generator );
9683
9784 $ generator ->setLength ($ annotation ->length );
9885
@@ -168,15 +155,4 @@ private function isMethod($class, $callback)
168155 {
169156 return method_exists ($ class , $ callback ) && is_callable ([$ class , $ callback ]);
170157 }
171-
172- /**
173- * @return Registry
174- */
175- private function getRegistry ()
176- {
177- if ($ this ->registry ){
178- return $ this ->registry ;
179- }
180- return $ this ->container ->get ('vivait_generator.registry ' );
181- }
182158}
0 commit comments