@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * @class NullConvertor |
| 53 | 53 | * @package Platine\DocxTemplate\Convertor |
| 54 | 54 | */ |
| 55 | -class NullConvertor implements DocxConvertorInterface |
|
| 56 | -{ |
|
| 55 | +class NullConvertor implements DocxConvertorInterface { |
|
| 57 | 56 | /** |
| 58 | 57 | * {@inheritodc} |
| 59 | 58 | */ |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * @class LibreOfficePDFConvertor |
| 53 | 53 | * @package Platine\DocxTemplate\Convertor |
| 54 | 54 | */ |
| 55 | -class LibreOfficePDFConvertor implements DocxConvertorInterface |
|
| 56 | -{ |
|
| 55 | +class LibreOfficePDFConvertor implements DocxConvertorInterface { |
|
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | 58 | * {@inheritodc} |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class DocxTemplateRendererInterface |
| 52 | 52 | * @package Platine\DocxTemplate |
| 53 | 53 | */ |
| 54 | -interface DocxTemplateRendererInterface |
|
| 55 | -{ |
|
| 54 | +interface DocxTemplateRendererInterface { |
|
| 56 | 55 | |
| 57 | 56 | /** |
| 58 | 57 | * Render the template content |
@@ -282,7 +282,7 @@ |
||
| 282 | 282 | ZipArchive::CREATE | ZipArchive::OVERWRITE |
| 283 | 283 | ); |
| 284 | 284 | if ($create === true) { |
| 285 | - // Create recursive directory iterator |
|
| 285 | + // Create recursive directory iterator |
|
| 286 | 286 | $files = new RecursiveIteratorIterator( |
| 287 | 287 | new RecursiveDirectoryIterator($this->templateExtractDir, FilesystemIterator::SKIP_DOTS), |
| 288 | 288 | RecursiveIteratorIterator::LEAVES_ONLY |
@@ -344,7 +344,7 @@ |
||
| 344 | 344 | $total = $zip->numFiles; |
| 345 | 345 | for ($i = 0; $i < $total; $i++) { |
| 346 | 346 | $stat = $zip->statIndex($i); |
| 347 | - if($stat !== false ){ |
|
| 347 | + if ($stat !== false) { |
|
| 348 | 348 | foreach ($this->fileListToProcess as $fileToProcess) { |
| 349 | 349 | if (fnmatch($fileToProcess, $stat['name'])) { |
| 350 | 350 | $fileList[] = $stat['name']; |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * @class DocxTemplate |
| 61 | 61 | * @package Platine\DocxTemplate |
| 62 | 62 | */ |
| 63 | -class DocxTemplate |
|
| 64 | -{ |
|
| 63 | +class DocxTemplate { |
|
| 65 | 64 | |
| 66 | 65 | /** |
| 67 | 66 | * The convertor instance to use |
@@ -344,7 +343,7 @@ discard block |
||
| 344 | 343 | $total = $zip->numFiles; |
| 345 | 344 | for ($i = 0; $i < $total; $i++) { |
| 346 | 345 | $stat = $zip->statIndex($i); |
| 347 | - if($stat !== false ){ |
|
| 346 | + if($stat !== false ) { |
|
| 348 | 347 | foreach ($this->fileListToProcess as $fileToProcess) { |
| 349 | 348 | if (fnmatch($fileToProcess, $stat['name'])) { |
| 350 | 349 | $fileList[] = $stat['name']; |
@@ -39,6 +39,5 @@ |
||
| 39 | 39 | * @class DocxTemplateException |
| 40 | 40 | * @package Platine\DocxTemplate\Exception |
| 41 | 41 | */ |
| 42 | -class DocxTemplateException extends Exception |
|
| 43 | -{ |
|
| 42 | +class DocxTemplateException extends Exception { |
|
| 44 | 43 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * @class DocxConvertorInterface |
| 52 | 52 | * @package Platine\DocxTemplate |
| 53 | 53 | */ |
| 54 | -interface DocxConvertorInterface |
|
| 55 | -{ |
|
| 54 | +interface DocxConvertorInterface { |
|
| 56 | 55 | |
| 57 | 56 | /** |
| 58 | 57 | * Convert the template file |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | // coem with the expected content |
| 98 | 98 | $variables = (string) preg_replace_callback( |
| 99 | 99 | '/{{(.*?)}}/', |
| 100 | - function ($match) { |
|
| 100 | + function($match) { |
|
| 101 | 101 | return strip_tags($match[0]); |
| 102 | 102 | }, |
| 103 | 103 | (string) preg_replace('/(?<!{){(?!{)<\/w:t>[\s\S]*?<w:t>{/', '{{', $content) |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | return (string) preg_replace_callback( |
| 107 | 107 | '/{%(.*?)%}/', |
| 108 | - function ($match) { |
|
| 108 | + function($match) { |
|
| 109 | 109 | return strip_tags($match[0]); |
| 110 | 110 | }, |
| 111 | 111 | (string) preg_replace('/(?<!{){(?!{)<\/w:t>[\s\S]*?<w:t>{/', '{%', $variables) |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * @class PlatineTemplateRenderer |
| 54 | 54 | * @package Platine\DocxTemplate\Renderer |
| 55 | 55 | */ |
| 56 | -class PlatineTemplateRenderer implements DocxTemplateRendererInterface |
|
| 57 | -{ |
|
| 56 | +class PlatineTemplateRenderer implements DocxTemplateRendererInterface { |
|
| 58 | 57 | /** |
| 59 | 58 | * The template instance to use |
| 60 | 59 | * @var Template |
@@ -65,8 +64,7 @@ discard block |
||
| 65 | 64 | * Create new instance |
| 66 | 65 | * @param Template $template |
| 67 | 66 | */ |
| 68 | - public function __construct(Template $template) |
|
| 69 | - { |
|
| 67 | + public function __construct(Template $template) { |
|
| 70 | 68 | $this->template = $template; |
| 71 | 69 | } |
| 72 | 70 | |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * @class NullRenderer |
| 53 | 53 | * @package Platine\DocxTemplate\Renderer |
| 54 | 54 | */ |
| 55 | -class NullRenderer implements DocxTemplateRendererInterface |
|
| 56 | -{ |
|
| 55 | +class NullRenderer implements DocxTemplateRendererInterface { |
|
| 57 | 56 | /** |
| 58 | 57 | * {@inheritodc} |
| 59 | 58 | */ |