@@ -63,7 +63,7 @@ |
||
| 63 | 63 | } |
| 64 | 64 | assert( |
| 65 | 65 | !$alreadyKey, |
| 66 | - 'Mapping already defined for model '.$key.' and CRUD verb '.$barrel |
|
| 66 | + 'Mapping already defined for model ' . $key . ' and CRUD verb ' . $barrel |
|
| 67 | 67 | ); |
| 68 | 68 | $metamix[$key][$barrel] = $roll; |
| 69 | 69 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | assert(0 < count($this->mapping), 'Mapping array must not be empty'); |
| 41 | 41 | |
| 42 | 42 | if (!array_key_exists($modelName, $this->mapping)) { |
| 43 | - throw new \Exception('Metadata mapping for model '.$modelName.' not defined'); |
|
| 43 | + throw new \Exception('Metadata mapping for model ' . $modelName . ' not defined'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $this->checkCrudVerbDefined($crudVerb); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $lookup = $this->mapping[$modelName]; |
| 50 | 50 | if (!is_array($lookup)) { |
| 51 | - throw new \Exception('Metadata mapping for model '.$modelName.' not an array'); |
|
| 51 | + throw new \Exception('Metadata mapping for model ' . $modelName . ' not an array'); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if (!array_key_exists($crudVerb, $lookup)) { |
@@ -56,16 +56,16 @@ discard block |
||
| 56 | 56 | // optional crud verbs don't have to be defined - so we can return null |
| 57 | 57 | return null; |
| 58 | 58 | } |
| 59 | - throw new \Exception('Metadata mapping for CRUD verb '.$crudVerb.' on model '.$modelName.' not defined'); |
|
| 59 | + throw new \Exception('Metadata mapping for CRUD verb ' . $crudVerb . ' on model ' . $modelName . ' not defined'); |
|
| 60 | 60 | } |
| 61 | 61 | $result = $lookup[$crudVerb]; |
| 62 | 62 | if (!isset($result)) { |
| 63 | - throw new \Exception('Metadata mapping for CRUD verb '.$crudVerb.' on model '.$modelName.' null'); |
|
| 63 | + throw new \Exception('Metadata mapping for CRUD verb ' . $crudVerb . ' on model ' . $modelName . ' null'); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | if (!method_exists($this, $result)) { |
| 67 | 67 | throw new \Exception( |
| 68 | - 'Metadata target for CRUD verb '.$crudVerb.' on model '.$modelName.' does not exist' |
|
| 68 | + 'Metadata target for CRUD verb ' . $crudVerb . ' on model ' . $modelName . ' does not exist' |
|
| 69 | 69 | ); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -87,17 +87,17 @@ discard block |
||
| 87 | 87 | // check that mapping array is well formed and sane, rather than waiting to stab us with a spatula |
| 88 | 88 | foreach ($this->mapping as $key => $map) { |
| 89 | 89 | if (!is_array($map)) { |
| 90 | - throw new \Exception('Metadata mapping for model '.$key.' not an array'); |
|
| 90 | + throw new \Exception('Metadata mapping for model ' . $key . ' not an array'); |
|
| 91 | 91 | } |
| 92 | 92 | foreach ($map as $verb => $method) { |
| 93 | 93 | $this->checkCrudVerbDefined($verb); |
| 94 | 94 | if (!isset($method)) { |
| 95 | - throw new \Exception('Metadata mapping for CRUD verb '.$verb.' on model '.$key.' null'); |
|
| 95 | + throw new \Exception('Metadata mapping for CRUD verb ' . $verb . ' on model ' . $key . ' null'); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | if (!method_exists($this, $method)) { |
| 99 | 99 | throw new \Exception( |
| 100 | - 'Metadata target for CRUD verb '.$verb.' on model '.$key.' does not exist' |
|
| 100 | + 'Metadata target for CRUD verb ' . $verb . ' on model ' . $key . ' does not exist' |
|
| 101 | 101 | ); |
| 102 | 102 | } |
| 103 | 103 | $parmArray = $this->getParameterNames($method); |
@@ -356,12 +356,12 @@ discard block |
||
| 356 | 356 | $map = $raw->getMetadata(); |
| 357 | 357 | |
| 358 | 358 | if (!array_key_exists($class, $map)) { |
| 359 | - throw new \POData\Common\InvalidOperationException('Controller mapping missing for class '.$class.'.'); |
|
| 359 | + throw new \POData\Common\InvalidOperationException('Controller mapping missing for class ' . $class . '.'); |
|
| 360 | 360 | } |
| 361 | 361 | $goal = $raw->getMapping($class, $verb); |
| 362 | 362 | if (null == $goal) { |
| 363 | 363 | throw new \POData\Common\InvalidOperationException( |
| 364 | - 'Controller mapping missing for '.$verb.' verb on class '.$class.'.' |
|
| 364 | + 'Controller mapping missing for ' . $verb . ' verb on class ' . $class . '.' |
|
| 365 | 365 | ); |
| 366 | 366 | } |
| 367 | 367 | |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | throw new ODataException($e->getMessage(), 500); |
| 436 | 436 | } |
| 437 | 437 | } |
| 438 | - throw new ODataException('Target model not successfully '.$lastWord, 422); |
|
| 438 | + throw new ODataException('Target model not successfully ' . $lastWord, 422); |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | /** |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | } |
| 479 | 479 | $outData = $result->getData(); |
| 480 | 480 | if (is_object($outData)) { |
| 481 | - $outData = (array)$outData; |
|
| 481 | + $outData = (array) $outData; |
|
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | if (!is_array($outData)) { |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | $otherPropName = $this->getMetadataProvider() |
| 667 | 667 | ->resolveReverseProperty($sourceEntityInstance, $targetEntityInstance, $navPropName); |
| 668 | 668 | if (null === $otherPropName) { |
| 669 | - $msg = 'Bad navigation property, '.$navPropName.', on source model '.get_class($sourceEntityInstance); |
|
| 669 | + $msg = 'Bad navigation property, ' . $navPropName . ', on source model ' . get_class($sourceEntityInstance); |
|
| 670 | 670 | throw new \InvalidArgumentException($msg); |
| 671 | 671 | } |
| 672 | 672 | $this->unhookSingleModel( |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | } |
| 701 | 701 | $targType = $relation->getRelated(); |
| 702 | 702 | if (!$targetEntityInstance instanceof $targType) { |
| 703 | - $msg = 'Target instance must be of type compatible with relation declared in method '.$navPropName; |
|
| 703 | + $msg = 'Target instance must be of type compatible with relation declared in method ' . $navPropName; |
|
| 704 | 704 | throw new \InvalidArgumentException($msg); |
| 705 | 705 | } |
| 706 | 706 | return $relation; |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | $var = new $varType(); |
| 742 | 742 | if ($spec['isRequest']) { |
| 743 | 743 | $var->setMethod($isCreate ? 'POST' : 'PUT'); |
| 744 | - $bulkData = [ 'data' => $data]; |
|
| 744 | + $bulkData = ['data' => $data]; |
|
| 745 | 745 | if (null !== $keyDescriptors) { |
| 746 | 746 | $keys = []; |
| 747 | 747 | foreach ($keyDescriptors as $desc) { |