| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | private function normalizeEndpoint($endpoint) |
||
| 44 | { |
||
| 45 | $versionMountPoint = ApplicationInterface::API_MOUNT_POINT; |
||
| 46 | |||
| 47 | // Test if URL already ends with API_MOUNT_POINT |
||
| 48 | $mountPoint = substr(trim($endpoint, '/'), -strlen($versionMountPoint)); |
||
| 49 | |||
| 50 | if ($versionMountPoint !== $mountPoint) { |
||
| 51 | $endpoint = sprintf('%s%s/', trim($endpoint, '/'), $versionMountPoint); |
||
| 52 | } |
||
| 53 | |||
| 54 | return $endpoint; |
||
| 55 | } |
||
| 56 | } |
||
| 57 |