Passed
Pull Request — master (#686)
by Vitor
04:32
created
lib/Provider/AFactory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@  discard block
 block discarded – undo
13 13
  */
14 14
 abstract class AFactory {
15 15
 	/** @var array<string, T> */
16
-	protected array $instances = [];
16
+	protected array $instances = [ ];
17 17
 	/** @var array<string> */
18
-	protected array $fqcn = [];
18
+	protected array $fqcn = [ ];
19 19
 
20 20
 	abstract protected function getPrefix(): string;
21 21
 
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 			true => $this->typeFrom($name),
34 34
 			false => strtolower($name),
35 35
 		};
36
-		if (isset($this->instances[$needle])) {
37
-			return $this->instances[$needle];
36
+		if (isset($this->instances[ $needle ])) {
37
+			return $this->instances[ $needle ];
38 38
 		}
39 39
 
40 40
 		foreach ($this->getFqcnList() as $fqcn) {
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 				continue;
44 44
 			}
45 45
 			$instance = \OCP\Server::get($fqcn);
46
-			$this->instances[$type] = $instance;
46
+			$this->instances[ $type ] = $instance;
47 47
 			return $instance;
48 48
 		}
49 49
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 			return $this->fqcn;
57 57
 		}
58 58
 
59
-		$loader = require __DIR__ . '/../../vendor/autoload.php';
59
+		$loader = require __DIR__.'/../../vendor/autoload.php';
60 60
 		foreach ($loader->getClassMap() as $fqcn => $_) {
61 61
 			$type = $this->typeFrom($fqcn);
62 62
 			if ($type === null) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			if (!is_subclass_of($fqcn, $this->getBaseClass(), true)) {
66 66
 				continue;
67 67
 			}
68
-			$this->fqcn[] = $fqcn;
68
+			$this->fqcn[ ] = $fqcn;
69 69
 		}
70 70
 		return $this->fqcn;
71 71
 	}
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 			return null;
81 81
 		}
82 82
 		$type = substr($fqcn, strlen($prefix));
83
-		$type = substr($type, 0, -strlen('\\' . $suffix));
83
+		$type = substr($type, 0, -strlen('\\'.$suffix));
84 84
 		if (strpos($type, '\\') !== false || $type === '') {
85 85
 			return null;
86 86
 		}
Please login to merge, or discard this patch.