@@ -77,12 +77,12 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | private function getPath(string $jQueryNs, string $sPath, $xContext) |
| 79 | 79 | { |
| 80 | - if(!$sPath) |
|
| 80 | + if (!$sPath) |
|
| 81 | 81 | { |
| 82 | 82 | // If an empty selector is given, use the event target instead |
| 83 | 83 | return "$jQueryNs(e.currentTarget)"; |
| 84 | 84 | } |
| 85 | - if(!$xContext) |
|
| 85 | + if (!$xContext) |
|
| 86 | 86 | { |
| 87 | 87 | return "$jQueryNs('" . $sPath . "')"; |
| 88 | 88 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | public function getScript(): string |
| 156 | 156 | { |
| 157 | 157 | $sScript = $this->sPath; |
| 158 | - if(count($this->aCalls) > 0) |
|
| 158 | + if (count($this->aCalls) > 0) |
|
| 159 | 159 | { |
| 160 | 160 | $sScript .= '.' . implode('.', $this->aCalls); |
| 161 | 161 | } |
@@ -134,23 +134,23 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public static function make($xValue): ParameterInterface |
| 136 | 136 | { |
| 137 | - if($xValue instanceof ParameterInterface) |
|
| 137 | + if ($xValue instanceof ParameterInterface) |
|
| 138 | 138 | { |
| 139 | 139 | return $xValue; |
| 140 | 140 | } |
| 141 | - if(is_numeric($xValue)) |
|
| 141 | + if (is_numeric($xValue)) |
|
| 142 | 142 | { |
| 143 | 143 | return new Parameter(self::NUMERIC_VALUE, $xValue); |
| 144 | 144 | } |
| 145 | - if(is_string($xValue)) |
|
| 145 | + if (is_string($xValue)) |
|
| 146 | 146 | { |
| 147 | 147 | return new Parameter(self::QUOTED_VALUE, $xValue); |
| 148 | 148 | } |
| 149 | - if(is_bool($xValue)) |
|
| 149 | + if (is_bool($xValue)) |
|
| 150 | 150 | { |
| 151 | 151 | return new Parameter(self::BOOL_VALUE, $xValue); |
| 152 | 152 | } |
| 153 | - if($xValue instanceof JsCall) |
|
| 153 | + if ($xValue instanceof JsCall) |
|
| 154 | 154 | { |
| 155 | 155 | return new Parameter(self::JS_CALL, $xValue); |
| 156 | 156 | } |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | protected function getNumericValueScript(): string |
| 254 | 254 | { |
| 255 | - return (string)$this->xValue; |
|
| 255 | + return (string) $this->xValue; |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | protected function getUnquotedValueScript(): string |
| 264 | 264 | { |
| 265 | - return (string)$this->xValue; |
|
| 265 | + return (string) $this->xValue; |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /** |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | */ |
| 285 | 285 | protected function getPageNumberScript(): string |
| 286 | 286 | { |
| 287 | - return (string)$this->xValue; |
|
| 287 | + return (string) $this->xValue; |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /** |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | public function getScript(): string |
| 306 | 306 | { |
| 307 | 307 | $sMethodName = 'get' . $this->sType . 'Script'; |
| 308 | - if(!method_exists($this, $sMethodName)) |
|
| 308 | + if (!method_exists($this, $sMethodName)) |
|
| 309 | 309 | { |
| 310 | 310 | return ''; |
| 311 | 311 | } |
@@ -79,18 +79,18 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | private function makePhrase(array $aArgs): string |
| 81 | 81 | { |
| 82 | - if(empty($aArgs)) |
|
| 82 | + if (empty($aArgs)) |
|
| 83 | 83 | { |
| 84 | 84 | return ''; |
| 85 | 85 | } |
| 86 | 86 | // The first array entry is the message. |
| 87 | 87 | $sPhrase = array_shift($aArgs); |
| 88 | - if(empty($aArgs)) |
|
| 88 | + if (empty($aArgs)) |
|
| 89 | 89 | { |
| 90 | 90 | return $sPhrase; |
| 91 | 91 | } |
| 92 | 92 | $nParamId = 1; |
| 93 | - foreach($aArgs as &$xParameter) |
|
| 93 | + foreach ($aArgs as &$xParameter) |
|
| 94 | 94 | { |
| 95 | 95 | $xParameter = "'$nParamId':" . $xParameter->getScript(); |
| 96 | 96 | $nParamId++; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | private function makeMessage(): string |
| 107 | 107 | { |
| 108 | - if(!($sPhrase = $this->makePhrase($this->aMessageArgs))) |
|
| 108 | + if (!($sPhrase = $this->makePhrase($this->aMessageArgs))) |
|
| 109 | 109 | { |
| 110 | 110 | return ''; |
| 111 | 111 | } |
@@ -124,16 +124,15 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | $sMessageScript = $this->makeMessage(); |
| 126 | 126 | $sScript = parent::getScript(); |
| 127 | - if($this->bConfirm) |
|
| 127 | + if ($this->bConfirm) |
|
| 128 | 128 | { |
| 129 | 129 | $sConfirmPhrase = $this->makePhrase($this->aConfirmArgs); |
| 130 | 130 | $sScript = $this->xDialogLibraryManager->getQuestionLibrary() |
| 131 | 131 | ->confirm($sConfirmPhrase, $sScript, $sMessageScript); |
| 132 | 132 | } |
| 133 | - if($this->sCondition !== '') |
|
| 133 | + if ($this->sCondition !== '') |
|
| 134 | 134 | { |
| 135 | - $sScript = empty($sMessageScript) ? 'if(' . $this->sCondition . '){' . $sScript . ';}' : |
|
| 136 | - 'if(' . $this->sCondition . '){' . $sScript . ';}else{' . $sMessageScript . ';}'; |
|
| 135 | + $sScript = empty($sMessageScript) ? 'if(' . $this->sCondition . '){' . $sScript . ';}' : 'if(' . $this->sCondition . '){' . $sScript . ';}else{' . $sMessageScript . ';}'; |
|
| 137 | 136 | } |
| 138 | 137 | return $this->sVars . $sScript; |
| 139 | 138 | } |
@@ -145,9 +144,9 @@ discard block |
||
| 145 | 144 | */ |
| 146 | 145 | public function hasPageNumber(): bool |
| 147 | 146 | { |
| 148 | - foreach($this->aParameters as $xParameter) |
|
| 147 | + foreach ($this->aParameters as $xParameter) |
|
| 149 | 148 | { |
| 150 | - if($xParameter->getType() === Parameter::PAGE_NUMBER) |
|
| 149 | + if ($xParameter->getType() === Parameter::PAGE_NUMBER) |
|
| 151 | 150 | { |
| 152 | 151 | return true; |
| 153 | 152 | } |
@@ -165,9 +164,9 @@ discard block |
||
| 165 | 164 | public function setPageNumber(int $nPageNumber): Call |
| 166 | 165 | { |
| 167 | 166 | // Set the value of the Parameter::PAGE_NUMBER parameter |
| 168 | - foreach($this->aParameters as $xParameter) |
|
| 167 | + foreach ($this->aParameters as $xParameter) |
|
| 169 | 168 | { |
| 170 | - if($xParameter->getType() === Parameter::PAGE_NUMBER) |
|
| 169 | + if ($xParameter->getType() === Parameter::PAGE_NUMBER) |
|
| 171 | 170 | { |
| 172 | 171 | $xParameter->setValue($nPageNumber); |
| 173 | 172 | break; |
@@ -188,7 +187,7 @@ discard block |
||
| 188 | 187 | public function pg(int $nCurrentPage, int $nItemsPerPage, int $nItemsTotal): Paginator |
| 189 | 188 | { |
| 190 | 189 | // Append the page number to the parameter list, if not yet given. |
| 191 | - if(!$this->hasPageNumber()) |
|
| 190 | + if (!$this->hasPageNumber()) |
|
| 192 | 191 | { |
| 193 | 192 | $this->addParameter(Parameter::PAGE_NUMBER, 0); |
| 194 | 193 | } |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | */ |
| 122 | 122 | public function addParameters(array $aParameters): JsCall |
| 123 | 123 | { |
| 124 | - foreach($aParameters as $xParameter) |
|
| 124 | + foreach ($aParameters as $xParameter) |
|
| 125 | 125 | { |
| 126 | 126 | $this->pushParameter(Parameter::make($xParameter)); |
| 127 | 127 | } |