@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Time string normalizer |
| 4 | 4 | * |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function normalize(string $input): string |
| 50 | 50 | { |
| 51 | 51 | $output = preg_replace_callback(self::$pattern, |
| 52 | - function ($matches) { |
|
| 52 | + function($matches) { |
|
| 53 | 53 | $int = $matches['int']; |
| 54 | 54 | switch ($matches['time']) { |
| 55 | 55 | case 's': |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | # rebuild the interval string |
| 80 | 80 | $time = $int . $t; |
| 81 | 81 | |
| 82 | - if(isset($matches['text'])){ |
|
| 82 | + if (isset($matches['text'])) { |
|
| 83 | 83 | $time .= trim($matches['text']); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace IntervalParser; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace IntervalParser; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Set of regular expressions utilized to match/replace/validate parts of a given input. |
| 4 | 4 | * |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | const DEFINE = "/(?(DEFINE)"; |
| 19 | 19 | |
| 20 | 20 | # Definitions of sub patterns for a valid interval |
| 21 | - const INTEGER = <<<'REGEX' |
|
| 21 | + const INTEGER = <<<'REGEX' |
|
| 22 | 22 | (?<integer> |
| 23 | 23 | (?:\G|(?!\n)) |
| 24 | 24 | (\s*\b)? |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace IntervalParser; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace IntervalParser; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | namespace IntervalParser; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Main IntervalParser class |
| 4 | 4 | * |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $input = trim($this->normalizer->normalize($input)); |
| 41 | 41 | |
| 42 | - $definition = Pattern::DEFINE . Pattern::INTEGER . Pattern::TIME_PART .')'; |
|
| 42 | + $definition = Pattern::DEFINE . Pattern::INTEGER . Pattern::TIME_PART . ')'; |
|
| 43 | 43 | $expression = $definition . Pattern::INTERVAL_ONLY; |
| 44 | 44 | |
| 45 | - if(preg_match($expression, $input, $matches)){ |
|
| 45 | + if (preg_match($expression, $input, $matches)) { |
|
| 46 | 46 | return \DateInterval::createFromDateString($input); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** Parser Settings |
| 3 | 3 | * |
| 4 | 4 | * IntervalParser takes a ParserSettings object which is handy for when you want to deal with multiple intervals. |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | string $leadingSeparationString = "in", |
| 38 | 38 | bool $keepLeadingSeparator = false, |
| 39 | 39 | int $multipleSeparationType = self::SYMBOL, |
| 40 | - string $multipleSeparationSymbol = ",", |
|
| 40 | + string $multipleSeparationSymbol = ",", |
|
| 41 | 41 | string $multipleSeparationWord = null |
| 42 | 42 | ) |
| 43 | 43 | { |