Completed
Pull Request — master (#448)
by
unknown
08:31
created
phpmetrics/src/Hal/Component/Issue/Issuer.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@
 block discarded – undo
141 141
     }
142 142
 
143 143
     /**
144
-     * @param int|string $status
144
+     * @param integer $status
145 145
      *
146 146
      * @return void
147 147
      */
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Metric/System/Packages/Composer/Composer.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
 
97 97
     /**
98 98
      * Returns the installed packages from the composer.lock file.
99
-     * @param mixed[] $rootPackageRequirements List of requirements to match installed packages only with requirements.
99
+     * @param integer[] $rootPackageRequirements List of requirements to match installed packages only with requirements.
100 100
      * @return mixed[]
101 101
      */
102 102
     protected function getComposerLockInstalled($rootPackageRequirements)
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         }
52 52
 
53 53
         // exclude extensions
54
-        $packages = array_filter($packages, function ($package) {
54
+        $packages = array_filter($packages, function($package) {
55 55
             return !preg_match('!(^php$|^ext\-)!', $package->name);
56 56
         });
57 57
 
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
             if ($fileContent === false) {
83 83
                 throw new ShouldNotHappenException('Get composer content return false');
84 84
             }
85
-            $composerJson = (object)\json_decode($fileContent);
85
+            $composerJson = (object) \json_decode($fileContent);
86 86
 
87 87
             if (!isset($composerJson->require)) {
88 88
                 continue;
89 89
             }
90 90
 
91
-            $rawRequirements[] = (array)$composerJson->require;
91
+            $rawRequirements[] = (array) $composerJson->require;
92 92
         }
93 93
 
94 94
         return \call_user_func_array('array_merge', $rawRequirements);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             if ($fileContent === false) {
117 117
                 throw new ShouldNotHappenException('Get composer lock content return false');
118 118
             }
119
-            $composerLockJson = (object)\json_decode($fileContent);
119
+            $composerLockJson = (object) \json_decode($fileContent);
120 120
 
121 121
             if (!isset($composerLockJson->packages)) {
122 122
                 continue;
Please login to merge, or discard this patch.
src/Console/CliInput.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
             if (trim($item) === '') {
40 40
                 continue;
41 41
             }
42
-            $this->exts[] = '*.' . ltrim(trim($item), '*.');
42
+            $this->exts[] = '*.'.ltrim(trim($item), '*.');
43 43
         }
44 44
 
45 45
         if (empty($this->exts)) {
Please login to merge, or discard this patch.
src/Parser/PhpParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,11 +36,11 @@
 block discarded – undo
36 36
         try {
37 37
             $stmt = $this->parser->parse($file->getContents());
38 38
         } catch (Error $exc) {
39
-            throw new ParserException($file->getRelativePathname() . ': ' . $exc->getMessage());
39
+            throw new ParserException($file->getRelativePathname().': '.$exc->getMessage());
40 40
         }
41 41
 
42 42
         if ($stmt === null) {
43
-            throw new ParserException('Parse function return null when parsing ' . $file->getRelativePathname());
43
+            throw new ParserException('Parse function return null when parsing '.$file->getRelativePathname());
44 44
         }
45 45
 
46 46
         $this->traverser->traverse($stmt);
Please login to merge, or discard this patch.
src/DiFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      */
22 22
     public static function container(array $rules = []) : ContainerInterface
23 23
     {
24
-        $dirules = Json::decode(FileSystem::read(__DIR__ . '/dirules.json'), Json::FORCE_ARRAY);
24
+        $dirules = Json::decode(FileSystem::read(__DIR__.'/dirules.json'), Json::FORCE_ARRAY);
25 25
         $rlist = new DiRuleList();
26 26
         $rlist = $rlist->addRules($dirules);
27 27
         $rlist = $rlist->addRules($rules);
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Violation/Package/StableDependenciesPrinciple.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
 
23 23
     public function apply(Metric $metric)
24 24
     {
25
-        if (! $metric instanceof PackageMetric) {
25
+        if (!$metric instanceof PackageMetric) {
26 26
             return;
27 27
         }
28 28
         $instability = $metric->getInstability();
29 29
         $violatingInstabilities = array_filter(
30 30
             $metric->getDependentInstabilities(),
31
-            function ($otherInstability) use ($instability) {
31
+            function($otherInstability) use ($instability) {
32 32
                 return $otherInstability >= $instability;
33 33
             }
34 34
         );
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 
58 58
         $count = count($this->violatingInstabilities);
59 59
         $thisInstability = round($value, 3);
60
-        $packages = implode("\n* ", array_map(function ($name, $instability) {
61
-            $name = $name === '\\' ? 'global' : substr((string)$name, 0, -1);
60
+        $packages = implode("\n* ", array_map(function($name, $instability) {
61
+            $name = $name === '\\' ? 'global' : substr((string) $name, 0, -1);
62 62
             $instability = round($instability, 3);
63 63
             return "$name ($instability)";
64 64
         }, array_keys($this->violatingInstabilities), $this->violatingInstabilities));
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Violation/Package/StableAbstractionsPrinciple.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
 
20 20
     public function apply(Metric $metric)
21 21
     {
22
-        if (! $metric instanceof PackageMetric) {
22
+        if (!$metric instanceof PackageMetric) {
23 23
             return;
24 24
         }
25 25
         $distance = $metric->getDistance();
26 26
         if ($distance === null) {
27 27
             throw new ShouldNotHappenException('Distance is null');
28 28
         }
29
-        if (abs($distance) > sqrt(2)/4) {
29
+        if (abs($distance) > sqrt(2) / 4) {
30 30
             $this->metric = $metric;
31 31
             $metric->get('violations')->add($this);
32 32
         }
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Metric/System/Changes/GitChanges.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         $file = current($this->files);
67 67
         $realpath = realpath(dirname($file));
68 68
         if ($realpath === false) {
69
-            throw new ShouldNotHappenException('Cannot get realpath of ' . dirname($file));
69
+            throw new ShouldNotHappenException('Cannot get realpath of '.dirname($file));
70 70
         }
71 71
         $command = sprintf(
72 72
             "cd %s && %s log --format='* %%at\t%%cn' --numstat -n 500",
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Metric/System/UnitTesting/UnitTesting.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         $domList = $xpath->query('//testsuite[@file]');
77 77
         if ($domList !== false) {
78 78
             foreach ($domList as $suite) {
79
-                array_push($testsuites, (object)[
79
+                array_push($testsuites, (object) [
80 80
                     'file' => $suite->getAttribute('file'),
81 81
                     'name' => $suite->getAttribute('name'),
82 82
                     'assertions' => $suite->getAttribute('assertions'),
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                     $assertions = $case === $suite->firstChild->nextSibling ? $suite->getAttribute('assertions') : 0;
109 109
                 }
110 110
 
111
-                $testsuites[$case->getAttribute('class')] = (object)[
111
+                $testsuites[$case->getAttribute('class')] = (object) [
112 112
                     'file' => $case->getAttribute('file'),
113 113
                     'name' => $case->getAttribute('class'),
114 114
                     'assertions' => $assertions,
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             $traverser->addVisitor(new ExternalsVisitor($metricsOfUnitTest));
129 129
 
130 130
             if (!file_exists($suite->file) || !is_readable($suite->file)) {
131
-                throw new \LogicException('Cannot find source file referenced in testsuite: ' . $suite->file);
131
+                throw new \LogicException('Cannot find source file referenced in testsuite: '.$suite->file);
132 132
             }
133 133
 
134 134
             $code = file_get_contents($suite->file);
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
             if ($metric === null) {
151 151
                 throw new MetricNullException($suite->name, self::class);
152 152
             }
153
-            $externals = (array)$metric->get('externals');
153
+            $externals = (array) $metric->get('externals');
154 154
 
155 155
             // global stats for each test
156
-            $infoAboutTests[$suite->name] = (object)[
156
+            $infoAboutTests[$suite->name] = (object) [
157 157
                 'nbExternals' => count(array_unique($externals)),
158 158
                 'externals' => array_unique($externals),
159 159
                 'filename' => $suite->file,
Please login to merge, or discard this patch.