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