Passed
Branch master (603bad)
by Jakub
01:57
created
src/mytester.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
 require_once __DIR__ . "/functions.php";
5 5
 
Please login to merge, or discard this patch.
src/functions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 function findVendorDirectory(): string {
5 5
   $recursionLimit = 10;
6
-  $findVendor = function ($dirName = "vendor/bin", $dir = __DIR__) use (&$findVendor, &$recursionLimit) {
7
-    if (!$recursionLimit--) {
6
+  $findVendor = function($dirName = "vendor/bin", $dir = __DIR__) use (&$findVendor, &$recursionLimit) {
7
+    if(!$recursionLimit--) {
8 8
       throw new \Exception("Cannot find vendor directory.");
9 9
     }
10 10
     $found = $dir . "/$dirName";
11
-    if (is_dir($found) || is_file($found)) {
11
+    if(is_dir($found) || is_file($found)) {
12 12
       return dirname($found);
13 13
     }
14 14
     return $findVendor($dirName, dirname($dir));
Please login to merge, or discard this patch.
src/Bridges/NetteDI/MyTesterExtension.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 MyTester\Bridges\NetteDI;
5 5
 
Please login to merge, or discard this patch.
src/Tester.php 2 patches
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 MyTester;
5 5
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     $classes = $robot->getIndexedClasses();
50 50
     foreach($classes as $class => $file) {
51 51
       $rc = new \Nette\Reflection\ClassType($class);
52
-      if(!$rc->isAbstract() AND $rc->isSubclassOf(TestCase::class)) {
52
+      if(!$rc->isAbstract() and $rc->isSubclassOf(TestCase::class)) {
53 53
         $suits[] = [$rc->getName(), $file];
54 54
       }
55 55
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
       if($skipped["reason"]) {
87 87
         $reason = ": {$skipped["reason"]}";
88 88
       }
89
-      Environment::printLine("Skipped {$skipped["name"]}$reason");
89
+      Environment::printLine("skipped {$skipped["name"]}$reason");
90 90
     }
91 91
     if($failed) {
92 92
       Environment::printLine("Failed");
Please login to merge, or discard this patch.
src/Environment.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 MyTester;
5 5
 
Please login to merge, or discard this patch.
src/Job.php 2 patches
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 MyTester;
5 5
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,10 +85,10 @@
 block discarded – undo
85 85
       }
86 86
       $output = ob_get_clean();
87 87
       $failed = Environment::checkFailed($output);
88
-      if($failed AND !$this->shouldFail) {
88
+      if($failed and !$this->shouldFail) {
89 89
         $this->result = "failed";
90 90
       }
91
-      if(strlen($output) AND $this->result === "failed") {
91
+      if(strlen($output) and $this->result === "failed") {
92 92
         file_put_contents(\getTestsDirectory() . "/$this->name.errors", $output);
93 93
       }
94 94
     }
Please login to merge, or discard this patch.
src/Assert.php 2 patches
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 MyTester;
5 5
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
    * @param string|array $actual
137 137
    */
138 138
   public static function contains($needle, $actual): void {
139
-    if(!is_string($needle) AND !is_array($needle)) {
139
+    if(!is_string($needle) and !is_array($needle)) {
140 140
       Environment::testResult("The variable is not string or array.", false);
141 141
     } elseif(is_string($actual)) {
142
-      if($needle !== "" AND strpos($actual, $needle) !== FALSE) {
142
+      if($needle !== "" and strpos($actual, $needle) !== FALSE) {
143 143
         Environment::testResult("");
144 144
       } else {
145 145
         Environment::testResult("$needle is not in the variable.", false);
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
    * @param string|array $actual
163 163
    */
164 164
   public static function notContains($needle, $actual): void {
165
-    if(!is_string($needle) AND !is_array($needle)) {
165
+    if(!is_string($needle) and !is_array($needle)) {
166 166
       Environment::testResult("The variable is not string or array.", false);
167 167
     } elseif(is_string($actual)) {
168
-      if($needle === "" OR strpos($actual, $needle) === FALSE) {
168
+      if($needle === "" or strpos($actual, $needle) === FALSE) {
169 169
         Environment::testResult("");
170 170
       } else {
171 171
         Environment::testResult("$needle is in the variable.", false);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
    * @param string|array|\Countable $value
188 188
    */
189 189
   public static function count(int $count, $value): void {
190
-    if(!is_array($value) AND !$value instanceof \Countable) {
190
+    if(!is_array($value) and !$value instanceof \Countable) {
191 191
       Environment::testResult("The variable is not array or countable object.", false);
192 192
     } elseif(count($value) == $count) {
193 193
       Environment::testResult("");
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
    * @param string|array|\Countable $value
204 204
    */
205 205
   public static function notCount(int $count, $value): void {
206
-    if(!is_array($value) AND !$value instanceof \Countable) {
206
+    if(!is_array($value) and !$value instanceof \Countable) {
207 207
       Environment::testResult("The variable is not array or countable object.", false);
208 208
     } elseif(count($value) == $count) {
209 209
       $actual = count($value);
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
    * @param mixed $value
221 221
    */
222 222
   public static function type($type, $value): void {
223
-    if(!is_object($type) AND !is_string($type)) {
223
+    if(!is_object($type) and !is_string($type)) {
224 224
       Environment::testResult("Type must be string or object.", false);
225 225
     } elseif(in_array($type, ["array", "bool", "callable", "float",
226 226
       "int", "integer", "null", "object", "resource", "scalar", "string"], true)) {
Please login to merge, or discard this patch.
src/Bridges/NetteDI/TestsRunner.php 2 patches
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 MyTester\Bridges\NetteDI;
5 5
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
       if($skipped["reason"]) {
69 69
         $reason = ": {$skipped["reason"]}";
70 70
       }
71
-      Environment::printLine("Skipped {$skipped["name"]}$reason");
71
+      Environment::printLine("skipped {$skipped["name"]}$reason");
72 72
     }
73 73
     if($failed) {
74 74
       Environment::printLine("Failed");
Please login to merge, or discard this patch.
src/TestCase.php 2 patches
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 MyTester;
5 5
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
       $skip = false;
33 33
       $reason = "";
34 34
       foreach($value as $k => $v) {
35
-        switch ($k) {
35
+        switch($k) {
36 36
           case "php":
37 37
             $skip = version_compare(PHP_VERSION, (string) $v, "<");
38 38
             if($skip) {
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
       $this->tearDown();
172 172
     }
173 173
     Environment::$currentJob = "";
174
-    switch ($job->result) {
174
+    switch($job->result) {
175 175
       case "passed":
176 176
         return ".";
177 177
       case "skipped":
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
       $job = [
78 78
         "name" => $this->getJobName($rm), "callback" => [$this, $method], "params" => [], "skip" => $this->checkSkip($rm), "shouldFail" => $rm->hasAnnotation("fail")
79 79
       ];
80
-      if($rm->getNumberOfParameters() AND $rm->hasAnnotation("data")) {
80
+      if($rm->getNumberOfParameters() and $rm->hasAnnotation("data")) {
81 81
         $data = (array) $rm->getAnnotation("data");
82 82
       }
83 83
       if(is_array($data)) {
Please login to merge, or discard this patch.