@@ -173,22 +173,32 @@ |
||
| 173 | 173 | { |
| 174 | 174 | switch ($this->currentDirective) { |
| 175 | 175 | case self::DIRECTIVE_ALL: |
| 176 | - if (!$this->strict) break; |
|
| 176 | + if (!$this->strict) { |
|
| 177 | + break; |
|
| 178 | + } |
|
| 177 | 179 | $this->rules[$this->currentUserAgent][self::DIRECTIVE_ALL] = true; |
| 178 | 180 | break; |
| 179 | 181 | case self::DIRECTIVE_NONE: |
| 180 | 182 | $this->rules[$this->currentUserAgent][self::DIRECTIVE_NONE] = true; |
| 181 | - if ($this->strict) break; |
|
| 183 | + if ($this->strict) { |
|
| 184 | + break; |
|
| 185 | + } |
|
| 182 | 186 | $this->rules[$this->currentUserAgent][self::DIRECTIVE_NO_INDEX] = true; |
| 183 | 187 | $this->rules[$this->currentUserAgent][self::DIRECTIVE_NO_FOLLOW] = true; |
| 184 | 188 | break; |
| 185 | 189 | case self::DIRECTIVE_UNAVAILABLE_AFTER: |
| 186 | - if ($this->strict) $this->supportedDateFormats = [self::DATE_FORMAT_DEFAULT]; |
|
| 190 | + if ($this->strict) { |
|
| 191 | + $this->supportedDateFormats = [self::DATE_FORMAT_DEFAULT]; |
|
| 192 | + } |
|
| 187 | 193 | foreach (array_unique($this->supportedDateFormats) as $format) { |
| 188 | 194 | $dateTime = date_create_from_format($format, $this->currentValue); |
| 189 | - if ($dateTime === false) continue; |
|
| 195 | + if ($dateTime === false) { |
|
| 196 | + continue; |
|
| 197 | + } |
|
| 190 | 198 | $this->rules[$this->currentUserAgent][self::DIRECTIVE_UNAVAILABLE_AFTER] = $dateTime->format(DATE_RFC850); |
| 191 | - if ($this->strict) break; |
|
| 199 | + if ($this->strict) { |
|
| 200 | + break; |
|
| 201 | + } |
|
| 192 | 202 | if (time() >= $dateTime->getTimestamp()) { |
| 193 | 203 | $this->rules[$this->currentUserAgent][self::DIRECTIVE_NO_INDEX] = true; |
| 194 | 204 | } |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * URL parser |
|
| 4 | - * |
|
| 5 | - * @author Jan-Petter Gundersen ([email protected]) |
|
| 6 | - */ |
|
| 3 | + * URL parser |
|
| 4 | + * |
|
| 5 | + * @author Jan-Petter Gundersen ([email protected]) |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | namespace vipnytt\XRobotsTagParser; |
| 9 | 9 | |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * User-Agent parser |
|
| 4 | - * |
|
| 5 | - * @author Jan-Petter Gundersen ([email protected]) |
|
| 6 | - */ |
|
| 3 | + * User-Agent parser |
|
| 4 | + * |
|
| 5 | + * @author Jan-Petter Gundersen ([email protected]) |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | namespace vipnytt\XRobotsTagParser; |
| 9 | 9 | |