| Conditions | 7 |
| Paths | 5 |
| Total Lines | 23 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function exception($data=array()) |
||
| 14 | {
|
||
| 15 | if(!isset($data['project']) and !isset($data['version'])){
|
||
| 16 | throw new DomainException('No Project or Version');
|
||
| 17 | } |
||
| 18 | |||
| 19 | //get app path for checking |
||
| 20 | $appPath = StaticPathModel::appPath().'/'.$data['project']; |
||
| 21 | |||
| 22 | //If there is no project on the url |
||
| 23 | //we throw an exception |
||
| 24 | if($data['project']===null OR !file_exists($appPath)){
|
||
| 25 | throw new DomainException('No Project');
|
||
| 26 | } |
||
| 27 | |||
| 28 | if(!in_array($data['version'],UrlVersionIdentifier::supportedVersions())){
|
||
| 29 | throw new DomainException('Version Number is not supported');
|
||
| 30 | } |
||
| 31 | |||
| 32 | //If there is no endpoint on the url |
||
| 33 | //we throw an exception |
||
| 34 | if($data['endpoint']===null){
|
||
| 35 | throw new DomainException('No Endpoint');
|
||
| 36 | } |
||
| 38 | } |