@@ -18,52 +18,52 @@ |
||
| 18 | 18 | |
| 19 | 19 | interface FileInterface |
| 20 | 20 | { |
| 21 | - /** |
|
| 21 | +/** |
|
| 22 | 22 | * Get the filesystem where the file is stored |
| 23 | 23 | * |
| 24 | 24 | * @return Filesystem |
| 25 | 25 | */ |
| 26 | - public function filesystem(): Filesystem; |
|
| 26 | +public function filesystem(): Filesystem; |
|
| 27 | 27 | |
| 28 | - /** |
|
| 28 | +/** |
|
| 29 | 29 | * Get the uploaded file type |
| 30 | 30 | * |
| 31 | 31 | * @return string |
| 32 | 32 | */ |
| 33 | - public function type(): string; |
|
| 33 | +public function type(): string; |
|
| 34 | 34 | |
| 35 | - /** |
|
| 35 | +/** |
|
| 36 | 36 | * Get the uploaded file name, without the extension and slugified |
| 37 | 37 | * |
| 38 | 38 | * @return string |
| 39 | 39 | */ |
| 40 | - public function name(): string; |
|
| 40 | +public function name(): string; |
|
| 41 | 41 | |
| 42 | - /** |
|
| 42 | +/** |
|
| 43 | 43 | * Get the uploaded file name, with the extension |
| 44 | 44 | * |
| 45 | 45 | * @return string |
| 46 | 46 | */ |
| 47 | - public function filename(): string; |
|
| 47 | +public function filename(): string; |
|
| 48 | 48 | |
| 49 | - /** |
|
| 49 | +/** |
|
| 50 | 50 | * Get the uploaded file path |
| 51 | 51 | * |
| 52 | 52 | * @return string |
| 53 | 53 | */ |
| 54 | - public function path(): string; |
|
| 54 | +public function path(): string; |
|
| 55 | 55 | |
| 56 | - /** |
|
| 56 | +/** |
|
| 57 | 57 | * Get the uploaded file size |
| 58 | 58 | * |
| 59 | 59 | * @return int |
| 60 | 60 | */ |
| 61 | - public function size(): int; |
|
| 61 | +public function size(): int; |
|
| 62 | 62 | |
| 63 | - /** |
|
| 63 | +/** |
|
| 64 | 64 | * Get the uploaded file extension |
| 65 | 65 | * |
| 66 | 66 | * @return string |
| 67 | 67 | */ |
| 68 | - public function extension(): string; |
|
| 68 | +public function extension(): string; |
|
| 69 | 69 | } |
@@ -31,9 +31,9 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function withPage(): self |
| 33 | 33 | { |
| 34 | - foreach($this->aArguments as $xArgument) |
|
| 34 | + foreach ($this->aArguments as $xArgument) |
|
| 35 | 35 | { |
| 36 | - if(TypedValue::isPage($xArgument)) |
|
| 36 | + if (TypedValue::isPage($xArgument)) |
|
| 37 | 37 | { |
| 38 | 38 | return $this; |
| 39 | 39 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $sName = trim($sPath) ?: 'this'; |
| 27 | 27 | $this->aCall = ['_type' => 'select', '_name' => $sName, 'mode' => $sMode]; |
| 28 | - if($sName !== 'this' && $xContext !== null) |
|
| 28 | + if ($sName !== 'this' && $xContext !== null) |
|
| 29 | 29 | { |
| 30 | 30 | $this->aCall['context'] = is_a($xContext, JsonSerializable::class) ? |
| 31 | 31 | $xContext->jsonSerialize() : $xContext; |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function func(): ?Func |
| 91 | 91 | { |
| 92 | - foreach($this->aCalls as $xCall) |
|
| 92 | + foreach ($this->aCalls as $xCall) |
|
| 93 | 93 | { |
| 94 | - if(is_a($xCall, Func::class)) |
|
| 94 | + if (is_a($xCall, Func::class)) |
|
| 95 | 95 | { |
| 96 | 96 | return $xCall; |
| 97 | 97 | } |
@@ -426,15 +426,15 @@ discard block |
||
| 426 | 426 | 'calls' => array_map(fn(JsonSerializable|array $xCall) => |
| 427 | 427 | is_array($xCall) ? $xCall : $xCall->jsonSerialize(), $this->aCalls), |
| 428 | 428 | ]; |
| 429 | - if(($this->aConfirm)) |
|
| 429 | + if (($this->aConfirm)) |
|
| 430 | 430 | { |
| 431 | 431 | $aJsExpr['confirm'] = $this->aConfirm; |
| 432 | 432 | } |
| 433 | - if(($this->aCondition)) |
|
| 433 | + if (($this->aCondition)) |
|
| 434 | 434 | { |
| 435 | 435 | $aJsExpr['condition'] = $this->aCondition; |
| 436 | 436 | } |
| 437 | - if(($this->aAlert)) |
|
| 437 | + if (($this->aAlert)) |
|
| 438 | 438 | { |
| 439 | 439 | $aJsExpr['alert'] = $this->aAlert; |
| 440 | 440 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | */ |
| 59 | 59 | public function __get(string $sAttribute): JsExpr |
| 60 | 60 | { |
| 61 | - return $this->_expr()->__get( $sAttribute); |
|
| 61 | + return $this->_expr()->__get($sAttribute); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -63,8 +63,10 @@ |
||
| 63 | 63 | |
| 64 | 64 | interface TestInterface |
| 65 | 65 | { |
| 66 | - public function do(); |
|
| 67 | -} |
|
| 66 | + public function do { |
|
| 67 | + (); |
|
| 68 | + } |
|
| 69 | + } |
|
| 68 | 70 | |
| 69 | 71 | class ClassWithInterface implements TestInterface |
| 70 | 72 | { |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | Dialog\Library\Butterup::class, // Butterup |
| 56 | 56 | Dialog\Library\IziToast::class, // IziToast |
| 57 | 57 | ]; |
| 58 | - foreach($aLibraries as $sClass) |
|
| 58 | + foreach ($aLibraries as $sClass) |
|
| 59 | 59 | { |
| 60 | 60 | try |
| 61 | 61 | { |
| 62 | 62 | $xDialog->registerLibrary($sClass, $sClass::NAME); |
| 63 | 63 | } |
| 64 | - catch(SetupException $_){} |
|
| 64 | + catch (SetupException $_) {} |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | return $xDialog; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | function register(): void |
| 80 | 80 | { |
| 81 | 81 | // Do nothing if running in cli. |
| 82 | - if(php_sapi_name() !== 'cli') |
|
| 82 | + if (php_sapi_name() !== 'cli') |
|
| 83 | 83 | { |
| 84 | 84 | _register(); |
| 85 | 85 | }; |
@@ -60,8 +60,7 @@ |
||
| 60 | 60 | try |
| 61 | 61 | { |
| 62 | 62 | $xDialog->registerLibrary($sClass, $sClass::NAME); |
| 63 | - } |
|
| 64 | - catch(SetupException $_){} |
|
| 63 | + } catch(SetupException $_){} |
|
| 65 | 64 | } |
| 66 | 65 | |
| 67 | 66 | return $xDialog; |
@@ -142,15 +142,15 @@ discard block |
||
| 142 | 142 | 'defaults' => $this->xConfigManager->getAppOption('dialogs.default', []), |
| 143 | 143 | ]; |
| 144 | 144 | $aLibrariesOptions = []; |
| 145 | - foreach($this->getLibraries() as $xLibrary) |
|
| 145 | + foreach ($this->getLibraries() as $xLibrary) |
|
| 146 | 146 | { |
| 147 | 147 | $aLibOptions = $xLibrary->helper()->getJsOptions(); |
| 148 | - if(count($aLibOptions) > 0) |
|
| 148 | + if (count($aLibOptions) > 0) |
|
| 149 | 149 | { |
| 150 | 150 | $aLibrariesOptions[$xLibrary->getName()] = $aLibOptions; |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | - if(count($aLibrariesOptions) > 0) |
|
| 153 | + if (count($aLibrariesOptions) > 0) |
|
| 154 | 154 | { |
| 155 | 155 | $aOptions['options'] = $aLibrariesOptions; |
| 156 | 156 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $xJsCode->sJsBefore = $this->getConfigScript(); |
| 168 | 168 | |
| 169 | 169 | $aCodes = []; |
| 170 | - foreach($this->getHelpers() as $xHelper) |
|
| 170 | + foreach ($this->getHelpers() as $xHelper) |
|
| 171 | 171 | { |
| 172 | 172 | $aCodes[] = $xHelper->getScript(); |
| 173 | 173 | $xJsCode->aFiles = array_merge($xJsCode->aFiles, $xHelper->getFiles()); |
@@ -55,8 +55,7 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | public function helper(): LibraryHelper |
| 57 | 57 | { |
| 58 | - return $this->xHelper ?: |
|
| 59 | - $this->xHelper = dialog()->getLibraryHelper($this->getName()); |
|
| 58 | + return $this->xHelper ?: $this->xHelper = dialog()->getLibraryHelper($this->getName()); |
|
| 60 | 59 | } |
| 61 | 60 | |
| 62 | 61 | /** |