@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__ . '/vendor/autoload.php'; // Autoload files using Composer autoload |
|
3 | +require_once __DIR__.'/vendor/autoload.php'; // Autoload files using Composer autoload |
|
4 | 4 | |
5 | 5 | use multilangphp\multilangphp; |
6 | 6 |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function setFrom(string $from): self |
84 | 84 | { |
85 | - if(!in_array($from, $this->definedExtension)) |
|
85 | + if (!in_array($from, $this->definedExtension)) |
|
86 | 86 | { |
87 | 87 | $usable = ""; |
88 | - foreach($this->definedExtension as $tip) $usable .= sprintf(' "%s",', $tip); |
|
88 | + foreach ($this->definedExtension as $tip) $usable .= sprintf(' "%s",', $tip); |
|
89 | 89 | $usable = substr($usable, 0, -1); |
90 | - exit("MultilangPHP: You can only use the". $usable . ' parameters.'); |
|
90 | + exit("MultilangPHP: You can only use the".$usable.' parameters.'); |
|
91 | 91 | } |
92 | 92 | $this->from = $from; |
93 | 93 | return $this; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | { |
117 | 117 | if (!$extension) $extension = $this->getFrom(); |
118 | 118 | $fKontrol = explode(".", $file); |
119 | - if($fKontrol[count($fKontrol)-1] == $extension) return true; |
|
119 | + if ($fKontrol[count($fKontrol) - 1] == $extension) return true; |
|
120 | 120 | return false; |
121 | 121 | } |
122 | 122 | |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | $langPHP_array = array(); |
134 | 134 | $langPHP_html = '<div class="multilang">'; |
135 | 135 | $openDir = opendir($this->getDir()); |
136 | - while (($file = readdir($openDir)) != FALSE ) { |
|
137 | - if ($file =='.' || $file == '..' || is_file($file) || !$this->controlFileExtention($file)) continue; |
|
138 | - if ($returnType == "array") $langPHP_array[basename($file, sprintf(".%s",$this->getFrom()))] = $file; |
|
136 | + while (($file = readdir($openDir)) != FALSE) { |
|
137 | + if ($file == '.' || $file == '..' || is_file($file) || !$this->controlFileExtention($file)) continue; |
|
138 | + if ($returnType == "array") $langPHP_array[basename($file, sprintf(".%s", $this->getFrom()))] = $file; |
|
139 | 139 | if ($returnType == "html") $langPHP_html .= sprintf(' <a href="?lang=%s" title="language %s">%s</a> ', basename($file, sprintf('.%s', $this->getFrom())), basename($file, sprintf('.%s', $this->getFrom())), basename($file, sprintf('.%s', $this->getFrom()))); |
140 | 140 | } |
141 | 141 | $langPHP_html .= '</div>'; |