From: Vincent Vanwaelscappel Date: Tue, 27 Jul 2021 08:17:42 +0000 (+0200) Subject: wip #4623 @0:15 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=fa884ed5be4612abb386a178ebe35fdb75861dfd;p=cubist_locale.git wip #4623 @0:15 --- 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);