@@ -27,13 +27,13 @@ discard block |
||
| 27 | 27 | //the auto service to be called. |
| 28 | 28 | return ClosureDispatcher::bind($controllerInstance)->call(function() use($controllerInstance){
|
| 29 | 29 | |
| 30 | - if(property_exists($controllerInstance,'response')){
|
|
| 30 | + if (property_exists($controllerInstance, 'response')) {
|
|
| 31 | 31 | return $controllerInstance->response; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | // if the client wishes, |
| 35 | 35 | // data can be returned in the supported format. |
| 36 | - if(app()->has('clientResponseType')){
|
|
| 36 | + if (app()->has('clientResponseType')) {
|
|
| 37 | 37 | return app()->get('clientResponseType');
|
| 38 | 38 | } |
| 39 | 39 | |
@@ -73,8 +73,7 @@ discard block |
||
| 73 | 73 | {
|
| 74 | 74 | //we get the response type by checking the instanceController object from the router. |
| 75 | 75 | //Each type of response is in the base class in project directory. |
| 76 | - return ($this->getControllerInstance()===null) ? core()->responseType : |
|
| 77 | - $this->appResponseType(); |
|
| 76 | + return ($this->getControllerInstance()===null) ? core()->responseType : $this->appResponseType(); |
|
| 78 | 77 | } |
| 79 | 78 | |
| 80 | 79 | /** |
@@ -85,19 +84,19 @@ discard block |
||
| 85 | 84 | public function handle() |
| 86 | 85 | {
|
| 87 | 86 | //definition for singleton instance |
| 88 | - define ('responseApp',true);
|
|
| 87 | + define('responseApp', true);
|
|
| 89 | 88 | |
| 90 | 89 | //get out putter for response |
| 91 | 90 | $formatter = $this->formatter(); |
| 92 | 91 | |
| 93 | 92 | //if out putter is not null |
| 94 | - if(Utils::isNamespaceExists($formatter)){
|
|
| 93 | + if (Utils::isNamespaceExists($formatter)) {
|
|
| 95 | 94 | |
| 96 | 95 | //We resolve the response via the service container |
| 97 | 96 | //and run the handle method. |
| 98 | 97 | $result = app()->resolve($formatter)->{$this->getResponseKind()}($this->getOutPutter());
|
| 99 | 98 | |
| 100 | - $this->app->register('result',$result);
|
|
| 99 | + $this->app->register('result', $result);
|
|
| 101 | 100 | } |
| 102 | 101 | } |
| 103 | 102 | |
@@ -107,7 +106,7 @@ discard block |
||
| 107 | 106 | * @param array $data |
| 108 | 107 | * @return array |
| 109 | 108 | */ |
| 110 | - public function outputFormatter($data=array()) |
|
| 109 | + public function outputFormatter($data = array()) |
|
| 111 | 110 | {
|
| 112 | 111 | $dataCapsule = config('response.data');
|
| 113 | 112 | |