From fa884ed5be4612abb386a178ebe35fdb75861dfd Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 27 Jul 2021 10:17:42 +0200 Subject: [PATCH] wip #4623 @0:15 --- src/Translate.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Translate.php b/src/Translate.php index 5da4670..b3ed68b 100644 --- a/src/Translate.php +++ b/src/Translate.php @@ -1,6 +1,7 @@ addExtension('php'); - $this->addExtension('phtml'); + } public function addPath($path) @@ -25,13 +25,18 @@ class Translate public function clearPaths() { - $this->_paths = array(); - $this->_toTranslate = array(); + $this->_paths = []; + $this->_toTranslate = []; + } + + public function setExtensions(array $extensions) + { + $this->_extensions = $extensions; } - public function addExtension($ext) + public function addExtension($extension) { - $this->_extensions[] = $ext; + $this->_extensions[] = $extension; } public function parseFiles() @@ -60,10 +65,10 @@ class Translate public static function extractTextsToTranslate(SplFileInfo $file) { - $toTranslate = array(); + $toTranslate = []; if (!$file->isFile() || !$file->isReadable()) { - $toTranslate = array(); + $toTranslate = []; } else { $c = file_get_contents($file); -- 2.39.5