@@ -565,7 +565,7 @@ private function addService($id, Definition $definition)
565
565
if ($ definition ->isSynthetic ()) {
566
566
$ return [] = '@throws RuntimeException always since this service is expected to be injected dynamically ' ;
567
567
} elseif ($ class = $ definition ->getClass ()) {
568
- $ return [] = sprintf (' @return %s A %s instance ' , 0 === strpos ($ class , '% ' ) ? 'object ' : '\\' . ltrim ( $ class , '\\' ) , ltrim ($ class , '\\' ));
568
+ $ return [] = sprintf (0 === strpos ($ class , '% ' ) ? '@return object A %1$s instance ' : '@return \%s ' , ltrim ($ class , '\\' ));
569
569
} elseif ($ definition ->getFactory ()) {
570
570
$ factory = $ definition ->getFactory ();
571
571
if (is_string ($ factory )) {
@@ -601,40 +601,14 @@ private function addService($id, Definition $definition)
601
601
602
602
$ return = str_replace ("\n * \n" , "\n * \n" , implode ("\n * " , $ return ));
603
603
604
- $ doc = '' ;
605
- if ($ definition ->isShared () && ContainerInterface::SCOPE_PROTOTYPE !== $ scope ) {
606
- $ doc .= <<<'EOF'
607
-
608
- *
609
- * This service is shared.
610
- * This method always returns the same instance of the service.
611
- EOF;
612
- }
613
-
614
- if (!$ definition ->isPublic ()) {
615
- $ doc .= <<<'EOF'
616
-
617
- *
618
- * This service is private.
619
- * If you want to be able to request this service from the container directly,
620
- * make it public, otherwise you might end up with broken code.
621
- EOF;
622
- }
623
-
624
- if ($ definition ->isAutowired ()) {
625
- $ doc .= <<<EOF
626
-
627
- *
628
- * This service is autowired.
629
- EOF ;
630
- }
604
+ $ shared = $ definition ->isShared () && ContainerInterface::SCOPE_PROTOTYPE !== $ scope ? ' shared ' : '' ;
605
+ $ public = $ definition ->isPublic () ? 'public ' : 'private ' ;
606
+ $ autowired = $ definition ->isAutowired () ? ' autowired ' : '' ;
631
607
632
608
if ($ definition ->isLazy ()) {
633
609
$ lazyInitialization = '$lazyLoad = true ' ;
634
- $ lazyInitializationDoc = "\n * @param bool \$lazyLoad whether to try lazy-loading the service with a proxy \n * " ;
635
610
} else {
636
611
$ lazyInitialization = '' ;
637
- $ lazyInitializationDoc = '' ;
638
612
}
639
613
640
614
// with proxies, for 5.3.3 compatibility, the getter must be public to be accessible to the initializer
@@ -643,8 +617,8 @@ private function addService($id, Definition $definition)
643
617
$ code = <<<EOF
644
618
645
619
/* {$ this ->docStar }
646
- * Gets the ' $ id' service. $ doc
647
- * $ lazyInitializationDoc
620
+ * Gets the $ public '$ id' $ shared $ autowired service.
621
+ *
648
622
* $ return
649
623
*/
650
624
{$ visibility } function get {$ this ->camelize ($ id )}Service( $ lazyInitialization)
0 commit comments