File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,12 @@ public function format(
1919 ) {
2020 return preg_replace_callback ('/%(\d+)/ ' , function (array $ matches ) use ($ matchState )
2121 {
22- return $ matchState ->getMatchReference (
22+ $ reference = $ matchState ->getMatchReference (
2323 (int )$ matches [1 ],
2424 MatchState::MATCH_REFERENCE_TYPE_CONDITION
2525 );
26+
27+ return (is_null ($ reference )) ? $ matches [0 ] : $ reference ;
2628 }, $ value );
2729 }
2830}
Original file line number Diff line number Diff line change @@ -19,10 +19,12 @@ public function format(
1919 ) {
2020 return preg_replace_callback ('/\$(\d+)/ ' , function (array $ matches ) use ($ matchState )
2121 {
22- return $ matchState ->getMatchReference (
22+ $ reference = $ matchState ->getMatchReference (
2323 $ matches [1 ],
2424 MatchState::MATCH_REFERENCE_TYPE_REWRITE
2525 );
26+
27+ return (is_null ($ reference )) ? $ matches [0 ] : $ reference ;
2628 }, $ value );
2729 }
2830}
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ public function clearMatchReferences($type)
7272
7373 public function getMatchReference ($ key , $ type )
7474 {
75- return isset ($ this ->matchReferences [$ type ][$ key ]) ? $ this ->matchReferences [$ type ][$ key ] : '' ;
75+ return isset ($ this ->matchReferences [$ type ][$ key ]) ? $ this ->matchReferences [$ type ][$ key ] : null ;
7676 }
7777
7878 public function getMatchReferences ($ type )
You can’t perform that action at this time.
0 commit comments