| @@ 103-107 (lines=5) @@ | ||
| 100 | $fromString = $stringValues[0]; |
|
| 101 | $toString = $stringValues[1]; |
|
| 102 | ||
| 103 | if (is_numeric($fromString) || empty($fromString)) { |
|
| 104 | $from = is_numeric($fromString) ? new Age($fromString) : null; |
|
| 105 | } else { |
|
| 106 | throw new InvalidAgeRangeException( |
|
| 107 | 'The "from" age should be a natural number or empty.' |
|
| 108 | ); |
|
| 109 | } |
|
| 110 | ||
| @@ 111-115 (lines=5) @@ | ||
| 108 | ); |
|
| 109 | } |
|
| 110 | ||
| 111 | if (is_numeric($toString) || empty($toString)) { |
|
| 112 | $to = is_numeric($toString) ? new Age($toString) : null; |
|
| 113 | } else { |
|
| 114 | throw new InvalidAgeRangeException( |
|
| 115 | 'The "to" age should be a natural number or empty.' |
|
| 116 | ); |
|
| 117 | } |
|
| 118 | ||