| @@ -8,13 +8,10 @@ | ||
| 8 | 8 | declare( strict_types=1 ); |
| 9 | 9 | |
| 10 | 10 | namespace Packetery\Module; |
| 11 | 11 | |
| 12 | -use PacketeryLatte\Engine; | |
| 13 | -use PacketeryLatte\MacroNode; | |
| 14 | -use PacketeryLatte\Macros\MacroSet; | |
| 15 | -use PacketeryLatte\PhpWriter; | |
| 16 | -use PacketeryNette\Bridges\FormsPacketeryLatte\FormMacros; | |
| 12 | +use Packetery\Latte\Engine; | |
| 13 | +use Packetery\Nette\Bridges\FormsLatte\FormMacros; | |
| 17 | 14 | |
| 18 | 15 | /** |
| 19 | 16 | * Class PacketeryLatte_Engine_Factory |
| 20 | 17 | * |
| @@ -20,19 +17,18 @@ | ||
| 20 | 17 | * |
| 21 | 18 | * @package Packetery |
| 22 | 19 | */ |
| 23 | 20 | class LatteEngineFactory { |
| 24 | - | |
| 25 | 21 | /** |
| 26 | 22 | * Creates latte engine factory |
| 27 | 23 | * |
| 28 | - * @param string $temp_dir Temporary folder. | |
| 24 | + * @param string $tempDir Temporary folder. | |
| 29 | 25 | * |
| 30 | 26 | * @return Engine |
| 31 | 27 | */ |
| 32 | - public function create( string $temp_dir ): Engine { | |
| 28 | + public function create( string $tempDir ): Engine { | |
| 33 | 29 | $engine = new Engine(); |
| 34 | - $engine->setTempDirectory( $temp_dir ); | |
| 30 | + $engine->setTempDirectory( $tempDir ); | |
| 35 | 31 | FormMacros::install( $engine->getCompiler() ); |
| 36 | 32 | $engine->addFilter( |
| 37 | 33 | 'wpDateTime', |
| 38 | 34 | function ( \DateTimeInterface $value ) { |
| @@ -39,18 +35,7 @@ | ||
| 39 | 35 | return $value->format( wc_date_format() . ' ' . wc_time_format() ); |
| 40 | 36 | } |
| 41 | 37 | ); |
| 42 | 38 | |
| 43 | - $macroSet = new MacroSet( $engine->getCompiler() ); | |
| 44 | - $macroSet->addMacro( | |
| 45 | - 'phpComment', | |
| 46 | - function ( MacroNode $node, PhpWriter $writer ) { | |
| 47 | - $output = trim( $node->args, "'" ); | |
| 48 | - $output = preg_replace( '~/~', '|', $output ); | |
| 49 | - return $writer->write( '/* ' . $output . ' */' ); | |
| 50 | - } | |
| 51 | - ); | |
| 52 | - | |
| 53 | - $engine->addMacro( 'packetery-macro-set', $macroSet ); | |
| 54 | 39 | return $engine; |
| 55 | 40 | } |
| 56 | 41 | } |