| Conditions | 4 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 37 | public function check() |
||
| 38 | { |
||
| 39 | $response = Director::test($this->url); |
||
| 40 | |||
| 41 | if ($response->getStatusCode() != 200) { |
||
| 42 | return array( |
||
| 43 | EnvironmentCheck::ERROR, |
||
| 44 | sprintf('Error retrieving "%s" (Code: %d)', $this->url, $response->getStatusCode()) |
||
| 45 | ); |
||
| 46 | } elseif ($this->testString && (strpos($response->getBody(), $this->testString) === false)) { |
||
| 47 | return array( |
||
| 48 | EnvironmentCheck::WARNING, |
||
| 49 | sprintf('Success retrieving "%s", but string "%s" not found', $this->url, $this->testString) |
||
| 50 | ); |
||
| 51 | } else { |
||
| 52 | return array( |
||
| 53 | EnvironmentCheck::OK, |
||
| 54 | sprintf('Success retrieving "%s"', $this->url) |
||
| 55 | ); |
||
| 56 | } |
||
| 57 | } |
||
| 58 | } |
||
| 59 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.