@@ -271,11 +271,11 @@ private function addServiceLocalTempVariables($cId, Definition $definition, arra
271271
272272array_unshift ($ inlinedDefinitions ,$ definition );
273273
274- $ collectLineage =$ this ->inlineRequires && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) );
274+ $ collectLineage =$ this ->inlineRequires && !$ this ->isHotPath ( $ definition );
275275$ isNonLazyShared = !$ this ->getProxyDumper ()->isProxyCandidate ($ definition ) &&$ definition ->isShared ();
276276$ lineage =$ calls =$ behavior =array ();
277277foreach ($ inlinedDefinitionsas $ 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 ()) {
279279$ this ->collectLineage ($ class ,$ lineage );
280280 }
281281$ this ->getServiceCallsFromArguments ($ iDefinition ->getArguments (),$ calls ,$ behavior ,$ isNonLazyShared );
@@ -763,7 +763,7 @@ private function addService($id, Definition $definition, &$file = null)
763763$ lazyInitialization ='' ;
764764 }
765765
766- $ asFile =$ this ->asFiles &&$ definition ->isShared () && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) );
766+ $ asFile =$ this ->asFiles &&$ definition ->isShared () && !$ this ->isHotPath ( $ definition );
767767$ methodName =$ this ->generateMethodName ($ id );
768768if ($ asFile ) {
769769$ file =$ methodName .'.php ' ;
@@ -829,7 +829,7 @@ private function addServices()
829829$ definitions =$ this ->container ->getDefinitions ();
830830ksort ($ definitions );
831831foreach ($ definitionsas $ 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 ))) {
833833continue ;
834834 }
835835if ($ definition ->isPublic ()) {
@@ -847,7 +847,7 @@ private function generateServiceFiles()
847847$ definitions =$ this ->container ->getDefinitions ();
848848ksort ($ definitions );
849849foreach ($ definitionsas $ id =>$ definition ) {
850- if (!$ definition ->isSynthetic () &&$ definition ->isShared () && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) )) {
850+ if (!$ definition ->isSynthetic () &&$ definition ->isShared () && !$ this ->isHotPath ( $ definition )) {
851851$ code =$ this ->addService ($ id ,$ definition ,$ file );
852852yield $ file =>$ code ;
853853 }
@@ -1120,7 +1120,7 @@ private function addMethodMap()
11201120$ definitions =$ this ->container ->getDefinitions ();
11211121ksort ($ definitions );
11221122foreach ($ definitionsas $ 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 ))) {
11241124$ code .=' ' .$ this ->export ($ id ).' => ' .$ this ->export ($ this ->generateMethodName ($ id )).", \n" ;
11251125 }
11261126 }
@@ -1139,7 +1139,7 @@ private function addFileMap()
11391139$ definitions =$ this ->container ->getDefinitions ();
11401140ksort ($ definitions );
11411141foreach ($ definitionsas $ id =>$ definition ) {
1142- if (!$ definition ->isSynthetic () &&$ definition ->isShared () && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) )) {
1142+ if (!$ definition ->isSynthetic () &&$ definition ->isShared () && !$ this ->isHotPath ( $ definition )) {
11431143$ code .=sprintf (" %s => __DIR__.'/%s.php', \n" ,$ this ->export ($ id ),$ this ->generateMethodName ($ id ));
11441144 }
11451145 }
@@ -1856,7 +1856,7 @@ private function getServiceCall($id, Reference $reference = null)
18561856if ($ definition ->isShared ()) {
18571857$ code =sprintf ('$this->services[ \'%s \'] = %s ' ,$ id ,$ code );
18581858 }
1859- }elseif ($ this ->asFiles &&$ definition ->isShared () && !( $ this ->hotPathTag && $ definition -> hasTag ( $ this -> hotPathTag ) )) {
1859+ }elseif ($ this ->asFiles &&$ definition ->isShared () && !$ this ->isHotPath ( $ definition )) {
18601860$ code =sprintf ("\$this->load(__DIR__.'/%s.php') " ,$ this ->generateMethodName ($ id ));
18611861 }else {
18621862$ code =sprintf ('$this->%s() ' ,$ this ->generateMethodName ($ id ));
@@ -1988,6 +1988,11 @@ private function getExpressionLanguage()
19881988return $ this ->expressionLanguage ;
19891989 }
19901990
1991+ private function isHotPath (Definition $ definition )
1992+ {
1993+ return $ this ->hotPathTag &&$ definition ->hasTag ($ this ->hotPathTag ) && !$ definition ->isDeprecated ();
1994+ }
1995+
19911996private function export ($ value )
19921997 {
19931998if (null !==$ this ->targetDirRegex &&is_string ($ value ) &&preg_match ($ this ->targetDirRegex ,$ value ,$ matches ,PREG_OFFSET_CAPTURE )) {