@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $imei = $value; |
| 26 | 26 | |
| 27 | - if (strlen($imei) !== 15 || ! ctype_digit($imei)) { |
|
| 27 | + if (strlen($imei) !== 15 || !ctype_digit($imei)) { |
|
| 28 | 28 | return false; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function check($value): bool |
| 35 | 35 | { |
| 36 | - if (! is_array($value)) { |
|
| 36 | + if (!is_array($value)) { |
|
| 37 | 37 | return false; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -30,15 +30,15 @@ |
||
| 30 | 30 | $this->requireParameters($this->fillableParams); |
| 31 | 31 | $time = $this->parameter('date'); |
| 32 | 32 | |
| 33 | - if (! $this->isValidDate($value)) { |
|
| 33 | + if (!$this->isValidDate($value)) { |
|
| 34 | 34 | throw $this->throwException($value); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if (! $this->isValidDate($time)) { |
|
| 37 | + if (!$this->isValidDate($time)) { |
|
| 38 | 38 | $time = $this->getAttribute()->getValue($time); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if (! $this->isValidDate($time)) { |
|
| 41 | + if (!$this->isValidDate($time)) { |
|
| 42 | 42 | throw $this->throwException($time); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $params = $args; |
| 57 | 57 | |
| 58 | 58 | $validator = static::$validationClass::instance()->getValidator($rule); |
| 59 | - if (! ($validator instanceof Rule)) { |
|
| 59 | + if (!($validator instanceof Rule)) { |
|
| 60 | 60 | throw ValidationException::ruleNotFound($rule); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | private static function ensureValidValidationClass(): void |
| 73 | 73 | { |
| 74 | - if (! is_a(static::$validationClass, Validation::class, true)) { |
|
| 74 | + if (!is_a(static::$validationClass, Validation::class, true)) { |
|
| 75 | 75 | throw new InvalidArgumentException('Static property $validationClass must be a subclass of ' . Validation::class); |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $keys = is_array($keys) ? $keys : func_get_args(); |
| 38 | 38 | |
| 39 | 39 | foreach ($keys as $key) { |
| 40 | - if (! Arr::has($this->input, $key)) { |
|
| 40 | + if (!Arr::has($this->input, $key)) { |
|
| 41 | 41 | return false; |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $keys = is_array($keys) ? $keys : func_get_args(); |
| 54 | 54 | |
| 55 | - return ! $this->has($keys); |
|
| 55 | + return !$this->has($keys); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | return $this->createWithContent($name, $kilobytes); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - return Helpers::tap(new File($name, tmpfile()), function ($file) use ($kilobytes, $mimeType) { |
|
| 28 | + return Helpers::tap(new File($name, tmpfile()), function($file) use ($kilobytes, $mimeType) { |
|
| 29 | 29 | $file->sizeToReport = $kilobytes * 1024; |
| 30 | 30 | $file->mimeTypeToReport = $mimeType; |
| 31 | 31 | }); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | fwrite($tmpfile, $content); |
| 42 | 42 | |
| 43 | - return Helpers::tap(new File($name, $tmpfile), function ($file) use ($tmpfile) { |
|
| 43 | + return Helpers::tap(new File($name, $tmpfile), function($file) use ($tmpfile) { |
|
| 44 | 44 | $file->sizeToReport = fstat($tmpfile)['size']; |
| 45 | 45 | }); |
| 46 | 46 | } |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | protected function generateImage(int $width, int $height, string $extension) |
| 70 | 70 | { |
| 71 | - if (! function_exists('imagecreatetruecolor')) { |
|
| 71 | + if (!function_exists('imagecreatetruecolor')) { |
|
| 72 | 72 | throw new LogicException('GD extension is not installed.'); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - return Helpers::tap(tmpfile(), function ($temp) use ($width, $height, $extension) { |
|
| 75 | + return Helpers::tap(tmpfile(), function($temp) use ($width, $height, $extension) { |
|
| 76 | 76 | ob_start(); |
| 77 | 77 | |
| 78 | 78 | $extension = in_array($extension, ['jpeg', 'png', 'gif', 'webp', 'wbmp', 'bmp'], true) |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $image = imagecreatetruecolor($width, $height); |
| 83 | 83 | |
| 84 | - if (! function_exists($functionName = "image{$extension}")) { |
|
| 84 | + if (!function_exists($functionName = "image{$extension}")) { |
|
| 85 | 85 | ob_get_clean(); |
| 86 | 86 | |
| 87 | 87 | throw new LogicException("{$functionName} function is not defined and image cannot be generated."); |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | public function fails(): bool |
| 247 | 247 | { |
| 248 | - return ! $this->passes(); |
|
| 248 | + return !$this->passes(); |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | /** |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | public function valid(): array |
| 297 | 297 | { |
| 298 | - if (! $this->validation) { |
|
| 298 | + if (!$this->validation) { |
|
| 299 | 299 | return []; |
| 300 | 300 | } |
| 301 | 301 | |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | public function invalid(): array |
| 323 | 323 | { |
| 324 | - if (! $this->validation) { |
|
| 324 | + if (!$this->validation) { |
|
| 325 | 325 | return []; |
| 326 | 326 | } |
| 327 | 327 | |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | public function errors(): ErrorBag |
| 347 | 347 | { |
| 348 | - if (! $this->validation) { |
|
| 348 | + if (!$this->validation) { |
|
| 349 | 349 | throw new RuntimeException(); |
| 350 | 350 | } |
| 351 | 351 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | $ignoreErrors = []; |
| 4 | 4 | $ignoreErrors[] = [ |
@@ -2,34 +2,34 @@ |
||
| 2 | 2 | |
| 3 | 3 | $ignoreErrors = []; |
| 4 | 4 | $ignoreErrors[] = [ |
| 5 | - 'message' => '#^Unsafe usage of new static\\(\\)\\.$#', |
|
| 6 | - 'count' => 1, |
|
| 7 | - 'path' => __DIR__ . '/src/ErrorBag.php', |
|
| 5 | + 'message' => '#^Unsafe usage of new static\\(\\)\\.$#', |
|
| 6 | + 'count' => 1, |
|
| 7 | + 'path' => __DIR__ . '/src/ErrorBag.php', |
|
| 8 | 8 | ]; |
| 9 | 9 | $ignoreErrors[] = [ |
| 10 | - 'message' => '#^Method Dimtrovich\\\\Validation\\\\Rules\\\\File\\:\\:defaults\\(\\) should return static\\(Dimtrovich\\\\Validation\\\\Rules\\\\File\\)\\|null but return statement is missing\\.$#', |
|
| 11 | - 'count' => 1, |
|
| 12 | - 'path' => __DIR__ . '/src/Rules/File.php', |
|
| 10 | + 'message' => '#^Method Dimtrovich\\\\Validation\\\\Rules\\\\File\\:\\:defaults\\(\\) should return static\\(Dimtrovich\\\\Validation\\\\Rules\\\\File\\)\\|null but return statement is missing\\.$#', |
|
| 11 | + 'count' => 1, |
|
| 12 | + 'path' => __DIR__ . '/src/Rules/File.php', |
|
| 13 | 13 | ]; |
| 14 | 14 | $ignoreErrors[] = [ |
| 15 | - 'message' => '#^Unsafe usage of new static\\(\\)\\.$#', |
|
| 16 | - 'count' => 2, |
|
| 17 | - 'path' => __DIR__ . '/src/Rules/File.php', |
|
| 15 | + 'message' => '#^Unsafe usage of new static\\(\\)\\.$#', |
|
| 16 | + 'count' => 2, |
|
| 17 | + 'path' => __DIR__ . '/src/Rules/File.php', |
|
| 18 | 18 | ]; |
| 19 | 19 | $ignoreErrors[] = [ |
| 20 | - 'message' => '#^Binary operation "\\*" between string and 2 results in an error\\.$#', |
|
| 21 | - 'count' => 1, |
|
| 22 | - 'path' => __DIR__ . '/src/Rules/Imei.php', |
|
| 20 | + 'message' => '#^Binary operation "\\*" between string and 2 results in an error\\.$#', |
|
| 21 | + 'count' => 1, |
|
| 22 | + 'path' => __DIR__ . '/src/Rules/Imei.php', |
|
| 23 | 23 | ]; |
| 24 | 24 | $ignoreErrors[] = [ |
| 25 | - 'message' => '#^Unsafe usage of new static\\(\\)\\.$#', |
|
| 26 | - 'count' => 2, |
|
| 27 | - 'path' => __DIR__ . '/src/Rules/Postalcode.php', |
|
| 25 | + 'message' => '#^Unsafe usage of new static\\(\\)\\.$#', |
|
| 26 | + 'count' => 2, |
|
| 27 | + 'path' => __DIR__ . '/src/Rules/Postalcode.php', |
|
| 28 | 28 | ]; |
| 29 | 29 | $ignoreErrors[] = [ |
| 30 | - 'message' => '#^Unsafe usage of new static\\(\\)\\.$#', |
|
| 31 | - 'count' => 1, |
|
| 32 | - 'path' => __DIR__ . '/src/Validation.php', |
|
| 30 | + 'message' => '#^Unsafe usage of new static\\(\\)\\.$#', |
|
| 31 | + 'count' => 1, |
|
| 32 | + 'path' => __DIR__ . '/src/Validation.php', |
|
| 33 | 33 | ]; |
| 34 | 34 | |
| 35 | 35 | return ['parameters' => ['ignoreErrors' => $ignoreErrors]]; |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public function check($value): bool |
| 22 | 22 | { |
| 23 | - if (! is_string($value) && ! is_numeric($value)) { |
|
| 23 | + if (!is_string($value) && !is_numeric($value)) { |
|
| 24 | 24 | return false; |
| 25 | 25 | } |
| 26 | 26 | |