File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 77 "Pre\\ Plugin\\ " : " source"
88 },
99 "files" : [
10+ " source/expanders.php" ,
1011 " source/functions.php" ,
1112 " source/autoload.php" ,
1213 " source/macros.php"
Original file line number Diff line number Diff line change @@ -178,7 +178,10 @@ public function format($code)
178178 })
179179 ' " ;
180180
181+ $ cwd = getcwd ();
182+ chdir (__DIR__ );
181183 exec ($ command , $ output );
184+ chdir ($ cwd );
182185
183186 if (!$ output ) {
184187 return $ code ;
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Yay \DSL \Expanders {
4+ use Yay \Engine ;
5+ use Yay \TokenStream ;
6+
7+ function trim (TokenStream $ stream , Engine $ engine ): TokenStream {
8+ return \Pre \Plugin \Expanders \trim ($ stream , $ engine );
9+ }
10+ }
11+
12+ namespace Pre \Plugin \Expanders {
13+ use Yay \Engine ;
14+ use Yay \TokenStream ;
15+
16+ function _stream (string $ source , Engine $ engine ): TokenStream {
17+ return TokenStream::fromSource (
18+ $ engine ->expand ($ source , "" , Engine::GC_ENGINE_DISABLED )
19+ );
20+ }
21+
22+ function trim (TokenStream $ stream , Engine $ engine ): TokenStream {
23+ $ stream = \trim ($ stream );
24+ return _stream ($ stream , $ engine );
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments