Passed
Push — master ( b361fa...68dd11 )
by Jakub
02:23
created
src/Resolvers/ChainLocaleResolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Nexendrie\Translation\Resolvers;
5 5
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     $this[] = $resolver;
22 22
   }
23 23
   
24
-  public function resolve(): ?string {
24
+  public function resolve(): ? string {
25 25
     foreach($this as $resolver) {
26 26
       $lang = $resolver->resolve();
27 27
       if(!is_null($lang)) {
Please login to merge, or discard this patch.
src/Resolvers/ManualLocaleResolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Nexendrie\Translation\Resolvers;
5 5
 
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
   /** @var string|NULL */
17 17
   protected $lang = NULL;
18 18
   
19
-  public function getLang(): ?string {
19
+  public function getLang(): ? string {
20 20
     return $this->lang;
21 21
   }
22 22
   
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     $this->lang = $lang;
25 25
   }
26 26
   
27
-  public function resolve(): ?string {
27
+  public function resolve(): ? string {
28 28
     return $this->getLang();
29 29
   }
30 30
 }
Please login to merge, or discard this patch.
src/Resolvers/HeaderLocaleResolver.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Nexendrie\Translation\Resolvers;
5 5
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
    * Taken from Nette\Http\Request::detectLanguage()
39 39
    * @author David Grudl
40 40
    */
41
-  public function resolve(): ?string {
41
+  public function resolve(): ? string {
42 42
     if(is_null($this->loader)) {
43 43
       throw new LoaderNotSetException("Loader is not available, cannot detect possible languages.");
44 44
     }
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
     if(is_null($header)) {
48 48
       return NULL;
49 49
     }
50
-    $s = strtolower($header);  // case insensitive
51
-    $s = strtr($s, '_', '-');  // cs_CZ means cs-CZ
52
-    rsort($langs);             // first more specific
50
+    $s = strtolower($header); // case insensitive
51
+    $s = strtr($s, '_', '-'); // cs_CZ means cs-CZ
52
+    rsort($langs); // first more specific
53 53
     $pattern = ')(?:-[^\s,;=]+)?\s*(?:;\s*q=([0-9.]+))?#';
54 54
     preg_match_all('#(' . implode('|', $langs) . $pattern, $s, $matches);
55 55
     if(!$matches[0]) {
Please login to merge, or discard this patch.
src/Resolvers/EnvironmentLocaleResolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Nexendrie\Translation\Resolvers;
5 5
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
   /** @var string */
18 18
   protected $varName = "TRANSLATOR_LANGUAGE";
19 19
   
20
-  public function getLang(): ?string {
20
+  public function getLang(): ? string {
21 21
     $lang = getenv($this->varName);
22 22
     if($lang) {
23 23
       return $lang;
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     $this->varName = $varName;
38 38
   }
39 39
   
40
-  public function resolve(): ?string {
40
+  public function resolve(): ? string {
41 41
     return $this->getLang();
42 42
   }
43 43
 }
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 require __DIR__ . "/../vendor/autoload.php";
5
-Testbench\Bootstrap::setup(__DIR__ . '/_temp', function (\Nette\Configurator $configurator) {
5
+Testbench\Bootstrap::setup(__DIR__ . '/_temp', function(\Nette\Configurator $configurator) {
6 6
   $configurator->addParameters([
7 7
     "appDir" => __DIR__,
8 8
     "tempDir" => __DIR__ . "/_temp",
Please login to merge, or discard this patch.
tests/Nexendrie/Translation/Resolvers/LocaleResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Nexendrie\Translation\Resolvers;
5 5
 
Please login to merge, or discard this patch.
tests/Nexendrie/Translation/Loaders/Loader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Nexendrie\Translation\Loaders;
5 5
 
Please login to merge, or discard this patch.
tests/Nexendrie/Translation/Loaders/FileLoaderTestAbstract.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Nexendrie\Translation\Loaders;
5 5
 
Please login to merge, or discard this patch.
tests/Nexendrie/Translation/Bridges/NetteDI/ProviderExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Nexendrie\Translation\Bridges\NetteDI;
5 5
 
Please login to merge, or discard this patch.