@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | /** |
| 43 | 43 | * The class constructor |
| 44 | 44 | * |
| 45 | - * @param CallableRepository $repository |
|
| 45 | + * @param CallableRepository $xRepository |
|
| 46 | 46 | */ |
| 47 | 47 | public function __construct(CallableRepository $xRepository) |
| 48 | 48 | { |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * |
| 55 | 55 | * @param string|null $sClass The callable class |
| 56 | 56 | * |
| 57 | - * @return Factory |
|
| 57 | + * @return Request |
|
| 58 | 58 | */ |
| 59 | 59 | public function setClassName($sClass) |
| 60 | 60 | { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * |
| 83 | 83 | * @param CallableObject $xCallable The callable object |
| 84 | 84 | * |
| 85 | - * @return Factory |
|
| 85 | + * @return Request |
|
| 86 | 86 | */ |
| 87 | 87 | public function setCallable(CallableObject $xCallable) |
| 88 | 88 | { |
@@ -95,7 +95,6 @@ discard block |
||
| 95 | 95 | * Return the javascript call to a Jaxon function or object method |
| 96 | 96 | * |
| 97 | 97 | * @param string $sFunction The function or method (without class) name |
| 98 | - * @param ... $xParams The parameters of the function or method |
|
| 99 | 98 | * |
| 100 | 99 | * @return \Jaxon\Request\Request |
| 101 | 100 | */ |
@@ -124,7 +123,6 @@ discard block |
||
| 124 | 123 | * Return the javascript call to a generic function |
| 125 | 124 | * |
| 126 | 125 | * @param string $sFunction The function or method (with class) name |
| 127 | - * @param ... $xParams The parameters of the function or method |
|
| 128 | 126 | * |
| 129 | 127 | * @return \Jaxon\Request\Request |
| 130 | 128 | */ |
@@ -148,7 +146,6 @@ discard block |
||
| 148 | 146 | * @param integer $nItemsPerPage The number of items per page page |
| 149 | 147 | * @param integer $nCurrentPage The current page |
| 150 | 148 | * @param string $sMethod The name of function or a method prepended with its class name |
| 151 | - * @param ... $xParams The parameters of the function or method |
|
| 152 | 149 | * |
| 153 | 150 | * @return string the pagination links |
| 154 | 151 | */ |
@@ -61,12 +61,12 @@ discard block |
||
| 61 | 61 | $this->sPrefix = $this->getOption('core.prefix.function'); |
| 62 | 62 | |
| 63 | 63 | $sClass = trim($sClass, '.\\ '); |
| 64 | - if(!$sClass) |
|
| 64 | + if (!$sClass) |
|
| 65 | 65 | { |
| 66 | 66 | return $this; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - if(!($xCallable = $this->xRepository->getCallableObject($sClass))) |
|
| 69 | + if (!($xCallable = $this->xRepository->getCallableObject($sClass))) |
|
| 70 | 70 | { |
| 71 | 71 | // Todo: decide which of these values to return |
| 72 | 72 | // return null; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | array_shift($aArguments); |
| 108 | 108 | |
| 109 | 109 | // Makes legacy code works |
| 110 | - if(strpos($sFunction, '.') !== false) |
|
| 110 | + if (strpos($sFunction, '.') !== false) |
|
| 111 | 111 | { |
| 112 | 112 | // If there is a dot in the name, then it is a call to a class |
| 113 | 113 | $this->sPrefix = $this->getOption('core.prefix.class'); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | /** |
| 56 | 56 | * The class constructor |
| 57 | 57 | * |
| 58 | - * @param CallableRepository $repository |
|
| 58 | + * @param CallableRepository $xRepository |
|
| 59 | 59 | */ |
| 60 | 60 | public function __construct(CallableRepository $xRepository) |
| 61 | 61 | { |
@@ -61,19 +61,19 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | $this->xRepository = $xRepository; |
| 63 | 63 | |
| 64 | - if(!empty($_GET['jxncls'])) |
|
| 64 | + if (!empty($_GET['jxncls'])) |
|
| 65 | 65 | { |
| 66 | 66 | $this->sRequestedClass = $_GET['jxncls']; |
| 67 | 67 | } |
| 68 | - if(!empty($_GET['jxnmthd'])) |
|
| 68 | + if (!empty($_GET['jxnmthd'])) |
|
| 69 | 69 | { |
| 70 | 70 | $this->sRequestedMethod = $_GET['jxnmthd']; |
| 71 | 71 | } |
| 72 | - if(!empty($_POST['jxncls'])) |
|
| 72 | + if (!empty($_POST['jxncls'])) |
|
| 73 | 73 | { |
| 74 | 74 | $this->sRequestedClass = $_POST['jxncls']; |
| 75 | 75 | } |
| 76 | - if(!empty($_POST['jxnmthd'])) |
|
| 76 | + if (!empty($_POST['jxnmthd'])) |
|
| 77 | 77 | { |
| 78 | 78 | $this->sRequestedMethod = $_POST['jxnmthd']; |
| 79 | 79 | } |
@@ -100,20 +100,20 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function register($sType, $sClassName, $aOptions) |
| 102 | 102 | { |
| 103 | - if($sType != $this->getName()) |
|
| 103 | + if ($sType != $this->getName()) |
|
| 104 | 104 | { |
| 105 | 105 | return false; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if(!is_string($sClassName)) |
|
| 108 | + if (!is_string($sClassName)) |
|
| 109 | 109 | { |
| 110 | 110 | throw new \Jaxon\Exception\Error($this->trans('errors.objects.invalid-declaration')); |
| 111 | 111 | } |
| 112 | - if(is_string($aOptions)) |
|
| 112 | + if (is_string($aOptions)) |
|
| 113 | 113 | { |
| 114 | 114 | $aOptions = ['include' => $aOptions]; |
| 115 | 115 | } |
| 116 | - if(!is_array($aOptions)) |
|
| 116 | + if (!is_array($aOptions)) |
|
| 117 | 117 | { |
| 118 | 118 | throw new \Jaxon\Exception\Error($this->trans('errors.objects.invalid-declaration')); |
| 119 | 119 | } |
@@ -151,13 +151,13 @@ discard block |
||
| 151 | 151 | public function canProcessRequest() |
| 152 | 152 | { |
| 153 | 153 | // Check the validity of the class name |
| 154 | - if($this->sRequestedClass !== null && !$this->validateClass($this->sRequestedClass)) |
|
| 154 | + if ($this->sRequestedClass !== null && !$this->validateClass($this->sRequestedClass)) |
|
| 155 | 155 | { |
| 156 | 156 | $this->sRequestedClass = null; |
| 157 | 157 | $this->sRequestedMethod = null; |
| 158 | 158 | } |
| 159 | 159 | // Check the validity of the method name |
| 160 | - if($this->sRequestedMethod !== null && !$this->validateMethod($this->sRequestedMethod)) |
|
| 160 | + if ($this->sRequestedMethod !== null && !$this->validateMethod($this->sRequestedMethod)) |
|
| 161 | 161 | { |
| 162 | 162 | $this->sRequestedClass = null; |
| 163 | 163 | $this->sRequestedMethod = null; |
@@ -172,14 +172,14 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | public function processRequest() |
| 174 | 174 | { |
| 175 | - if(!$this->canProcessRequest()) |
|
| 175 | + if (!$this->canProcessRequest()) |
|
| 176 | 176 | { |
| 177 | 177 | return false; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // Find the requested method |
| 181 | 181 | $xCallableObject = $this->xRepository->getCallableObject($this->sRequestedClass); |
| 182 | - if(!$xCallableObject || !$xCallableObject->hasMethod($this->sRequestedMethod)) |
|
| 182 | + if (!$xCallableObject || !$xCallableObject->hasMethod($this->sRequestedMethod)) |
|
| 183 | 183 | { |
| 184 | 184 | // Unable to find the requested object or method |
| 185 | 185 | throw new \Jaxon\Exception\Error($this->trans('errors.objects.invalid', |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | // Call the requested method |
| 190 | 190 | $aArgs = $this->getRequestManager()->process(); |
| 191 | 191 | $xResponse = $xCallableObject->call($this->sRequestedMethod, $aArgs); |
| 192 | - if(($xResponse)) |
|
| 192 | + if (($xResponse)) |
|
| 193 | 193 | { |
| 194 | 194 | $this->getResponseManager()->append($xResponse); |
| 195 | 195 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | protected function getPrevLink() |
| 65 | 65 | { |
| 66 | - if(!($sCall = $this->xPaginator->getPrevCall())) |
|
| 66 | + if (!($sCall = $this->xPaginator->getPrevCall())) |
|
| 67 | 67 | { |
| 68 | 68 | return ''; |
| 69 | 69 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | protected function getNextLink() |
| 80 | 80 | { |
| 81 | - if(!($sCall = $this->xPaginator->getNextCall())) |
|
| 81 | + if (!($sCall = $this->xPaginator->getNextCall())) |
|
| 82 | 82 | { |
| 83 | 83 | return ''; |
| 84 | 84 | } |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | protected function getLinks() |
| 95 | 95 | { |
| 96 | 96 | $sLinks = ''; |
| 97 | - foreach($this->xPaginator->getPages() as $page) |
|
| 97 | + foreach ($this->xPaginator->getPages() as $page) |
|
| 98 | 98 | { |
| 99 | - if($page['call']) |
|
| 99 | + if ($page['call']) |
|
| 100 | 100 | { |
| 101 | 101 | $sTemplate = ($page['isCurrent'] ? 'pagination::links/current' : 'pagination::links/enabled'); |
| 102 | 102 | $sLinks .= $this->xTemplate->render($sTemplate, ['call' => $page['call'], 'text' => $page['num']]); |
@@ -100,8 +100,7 @@ |
||
| 100 | 100 | { |
| 101 | 101 | $sTemplate = ($page['isCurrent'] ? 'pagination::links/current' : 'pagination::links/enabled'); |
| 102 | 102 | $sLinks .= $this->xTemplate->render($sTemplate, ['call' => $page['call'], 'text' => $page['num']]); |
| 103 | - } |
|
| 104 | - else |
|
| 103 | + } else |
|
| 105 | 104 | { |
| 106 | 105 | $sLinks .= $this->xTemplate->render('pagination::links/disabled', ['text' => $page['num']]); |
| 107 | 106 | } |