@@ -271,11 +271,11 @@ private function addServiceLocalTempVariables($cId, Definition $definition, arra
271
271
272
272
array_unshift ($ inlinedDefinitions , $ definition );
273
273
274
- $ collectLineage = $ this ->inlineRequires && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) );
274
+ $ collectLineage = $ this ->inlineRequires && !$ this ->isHotPath ( $ definition );
275
275
$ isNonLazyShared = !$ this ->getProxyDumper ()->isProxyCandidate ($ definition ) && $ definition ->isShared ();
276
276
$ lineage = $ calls = $ behavior = array ();
277
277
foreach ($ inlinedDefinitions as $ iDefinition ) {
278
- if ($ collectLineage && $ class = is_array ($ factory = $ iDefinition ->getFactory ()) && is_string ($ factory [0 ]) ? $ factory [0 ] : $ iDefinition ->getClass ()) {
278
+ if ($ collectLineage && ! $ iDefinition -> isDeprecated () && $ class = is_array ($ factory = $ iDefinition ->getFactory ()) && is_string ($ factory [0 ]) ? $ factory [0 ] : $ iDefinition ->getClass ()) {
279
279
$ this ->collectLineage ($ class , $ lineage );
280
280
}
281
281
$ this ->getServiceCallsFromArguments ($ iDefinition ->getArguments (), $ calls , $ behavior , $ isNonLazyShared );
@@ -763,7 +763,7 @@ private function addService($id, Definition $definition, &$file = null)
763
763
$ lazyInitialization = '' ;
764
764
}
765
765
766
- $ asFile = $ this ->asFiles && $ definition ->isShared () && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) );
766
+ $ asFile = $ this ->asFiles && $ definition ->isShared () && !$ this ->isHotPath ( $ definition );
767
767
$ methodName = $ this ->generateMethodName ($ id );
768
768
if ($ asFile ) {
769
769
$ file = $ methodName .'.php ' ;
@@ -829,7 +829,7 @@ private function addServices()
829
829
$ definitions = $ this ->container ->getDefinitions ();
830
830
ksort ($ definitions );
831
831
foreach ($ definitions as $ id => $ definition ) {
832
- if ($ definition ->isSynthetic () || ($ this ->asFiles && $ definition ->isShared () && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) ))) {
832
+ if ($ definition ->isSynthetic () || ($ this ->asFiles && $ definition ->isShared () && !$ this ->isHotPath ( $ definition ))) {
833
833
continue ;
834
834
}
835
835
if ($ definition ->isPublic ()) {
@@ -847,7 +847,7 @@ private function generateServiceFiles()
847
847
$ definitions = $ this ->container ->getDefinitions ();
848
848
ksort ($ definitions );
849
849
foreach ($ definitions as $ id => $ definition ) {
850
- if (!$ definition ->isSynthetic () && $ definition ->isShared () && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) )) {
850
+ if (!$ definition ->isSynthetic () && $ definition ->isShared () && !$ this ->isHotPath ( $ definition )) {
851
851
$ code = $ this ->addService ($ id , $ definition , $ file );
852
852
yield $ file => $ code ;
853
853
}
@@ -1120,7 +1120,7 @@ private function addMethodMap()
1120
1120
$ definitions = $ this ->container ->getDefinitions ();
1121
1121
ksort ($ definitions );
1122
1122
foreach ($ definitions as $ id => $ definition ) {
1123
- if (!$ definition ->isSynthetic () && (!$ this ->asFiles || !$ definition ->isShared () || ( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) ))) {
1123
+ if (!$ definition ->isSynthetic () && (!$ this ->asFiles || !$ definition ->isShared () || $ this ->isHotPath ( $ definition ))) {
1124
1124
$ code .= ' ' .$ this ->export ($ id ).' => ' .$ this ->export ($ this ->generateMethodName ($ id )).", \n" ;
1125
1125
}
1126
1126
}
@@ -1139,7 +1139,7 @@ private function addFileMap()
1139
1139
$ definitions = $ this ->container ->getDefinitions ();
1140
1140
ksort ($ definitions );
1141
1141
foreach ($ definitions as $ id => $ definition ) {
1142
- if (!$ definition ->isSynthetic () && $ definition ->isShared () && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) )) {
1142
+ if (!$ definition ->isSynthetic () && $ definition ->isShared () && !$ this ->isHotPath ( $ definition )) {
1143
1143
$ code .= sprintf (" %s => __DIR__.'/%s.php', \n" , $ this ->export ($ id ), $ this ->generateMethodName ($ id ));
1144
1144
}
1145
1145
}
@@ -1856,7 +1856,7 @@ private function getServiceCall($id, Reference $reference = null)
1856
1856
if ($ definition ->isShared ()) {
1857
1857
$ code = sprintf ('$this->services[ \'%s \'] = %s ' , $ id , $ code );
1858
1858
}
1859
- } elseif ($ this ->asFiles && $ definition ->isShared () && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) )) {
1859
+ } elseif ($ this ->asFiles && $ definition ->isShared () && !$ this ->isHotPath ( $ definition )) {
1860
1860
$ code = sprintf ("\$this->load(__DIR__.'/%s.php') " , $ this ->generateMethodName ($ id ));
1861
1861
} else {
1862
1862
$ code = sprintf ('$this->%s() ' , $ this ->generateMethodName ($ id ));
@@ -1988,6 +1988,11 @@ private function getExpressionLanguage()
1988
1988
return $ this ->expressionLanguage ;
1989
1989
}
1990
1990
1991
+ private function isHotPath (Definition $ definition )
1992
+ {
1993
+ return $ this ->hotPathTag && $ definition ->hasTag ($ this ->hotPathTag ) && !$ definition ->isDeprecated ();
1994
+ }
1995
+
1991
1996
private function export ($ value )
1992
1997
{
1993
1998
if (null !== $ this ->targetDirRegex && is_string ($ value ) && preg_match ($ this ->targetDirRegex , $ value , $ matches , PREG_OFFSET_CAPTURE )) {
0 commit comments