@@ -20,5 +20,5 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | class TraitAnnotated extends FuncComponent |
| 22 | 22 | { |
| 23 | - use Traits\Annotated; |
|
| 23 | +use Traits\Annotated; |
|
| 24 | 24 | } |
@@ -8,197 +8,197 @@ |
||
| 8 | 8 | |
| 9 | 9 | class DocBlockAnnotated extends FuncComponent |
| 10 | 10 | { |
| 11 | - /** |
|
| 11 | +/** |
|
| 12 | 12 | * @exclude true |
| 13 | 13 | */ |
| 14 | - public function doNot() |
|
| 15 | - { |
|
| 16 | - } |
|
| 14 | +public function doNot() |
|
| 15 | +{ |
|
| 16 | +} |
|
| 17 | 17 | |
| 18 | - /** |
|
| 18 | +/** |
|
| 19 | 19 | * @exclude Me |
| 20 | 20 | */ |
| 21 | - public function doNotError() |
|
| 22 | - { |
|
| 23 | - } |
|
| 21 | +public function doNotError() |
|
| 22 | +{ |
|
| 23 | +} |
|
| 24 | 24 | |
| 25 | - /** |
|
| 25 | +/** |
|
| 26 | 26 | * @databag user.name |
| 27 | 27 | * @databag page.number |
| 28 | 28 | */ |
| 29 | - public function withBags() |
|
| 30 | - { |
|
| 31 | - } |
|
| 29 | +public function withBags() |
|
| 30 | +{ |
|
| 31 | +} |
|
| 32 | 32 | |
| 33 | - /** |
|
| 33 | +/** |
|
| 34 | 34 | * @databag user:name |
| 35 | 35 | */ |
| 36 | - public function withBagsErrorName() |
|
| 37 | - { |
|
| 38 | - } |
|
| 36 | +public function withBagsErrorName() |
|
| 37 | +{ |
|
| 38 | +} |
|
| 39 | 39 | |
| 40 | - /** |
|
| 40 | +/** |
|
| 41 | 41 | * @databag page number |
| 42 | 42 | */ |
| 43 | - public function withBagsErrorNumber() |
|
| 44 | - { |
|
| 45 | - } |
|
| 43 | +public function withBagsErrorNumber() |
|
| 44 | +{ |
|
| 45 | +} |
|
| 46 | 46 | |
| 47 | - /** |
|
| 47 | +/** |
|
| 48 | 48 | * @upload user-files |
| 49 | 49 | * @exclude false |
| 50 | 50 | */ |
| 51 | - public function saveFiles() |
|
| 52 | - { |
|
| 53 | - } |
|
| 51 | +public function saveFiles() |
|
| 52 | +{ |
|
| 53 | +} |
|
| 54 | 54 | |
| 55 | - /** |
|
| 55 | +/** |
|
| 56 | 56 | * @upload user:file |
| 57 | 57 | */ |
| 58 | - public function saveFileErrorFieldName() |
|
| 59 | - { |
|
| 60 | - } |
|
| 58 | +public function saveFileErrorFieldName() |
|
| 59 | +{ |
|
| 60 | +} |
|
| 61 | 61 | |
| 62 | - /** |
|
| 62 | +/** |
|
| 63 | 63 | * @upload user file |
| 64 | 64 | */ |
| 65 | - public function saveFileErrorFieldNumber() |
|
| 66 | - { |
|
| 67 | - } |
|
| 65 | +public function saveFileErrorFieldNumber() |
|
| 66 | +{ |
|
| 67 | +} |
|
| 68 | 68 | |
| 69 | - /** |
|
| 69 | +/** |
|
| 70 | 70 | * @upload user-files |
| 71 | 71 | */ |
| 72 | - public function saveFilesWrongName() |
|
| 73 | - { |
|
| 74 | - } |
|
| 72 | +public function saveFilesWrongName() |
|
| 73 | +{ |
|
| 74 | +} |
|
| 75 | 75 | |
| 76 | - /** |
|
| 76 | +/** |
|
| 77 | 77 | * @upload user-file1 |
| 78 | 78 | * @upload user-file2 |
| 79 | 79 | */ |
| 80 | - public function saveFilesMultiple() |
|
| 81 | - { |
|
| 82 | - } |
|
| 80 | +public function saveFilesMultiple() |
|
| 81 | +{ |
|
| 82 | +} |
|
| 83 | 83 | |
| 84 | - /** |
|
| 84 | +/** |
|
| 85 | 85 | * @before funcBefore |
| 86 | 86 | * @after funcAfter |
| 87 | 87 | */ |
| 88 | - public function cbSingle() |
|
| 89 | - { |
|
| 90 | - } |
|
| 88 | +public function cbSingle() |
|
| 89 | +{ |
|
| 90 | +} |
|
| 91 | 91 | |
| 92 | - /** |
|
| 92 | +/** |
|
| 93 | 93 | * @before funcBefore1 |
| 94 | 94 | * @before funcBefore2 |
| 95 | 95 | * @after funcAfter1 |
| 96 | 96 | * @after funcAfter2 |
| 97 | 97 | * @after funcAfter3 |
| 98 | 98 | */ |
| 99 | - public function cbMultiple() |
|
| 100 | - { |
|
| 101 | - } |
|
| 99 | +public function cbMultiple() |
|
| 100 | +{ |
|
| 101 | +} |
|
| 102 | 102 | |
| 103 | - /** |
|
| 103 | +/** |
|
| 104 | 104 | * @before funcBefore1 ["param1"] |
| 105 | 105 | * @before funcBefore2 ["param1", "param2"] |
| 106 | 106 | * @after funcAfter1 ["param1", "param2"] |
| 107 | 107 | */ |
| 108 | - public function cbParams() |
|
| 109 | - { |
|
| 110 | - } |
|
| 108 | +public function cbParams() |
|
| 109 | +{ |
|
| 110 | +} |
|
| 111 | 111 | |
| 112 | - /** |
|
| 112 | +/** |
|
| 113 | 113 | * @before func:Before |
| 114 | 114 | */ |
| 115 | - public function cbBeforeErrorName() |
|
| 116 | - { |
|
| 117 | - } |
|
| 115 | +public function cbBeforeErrorName() |
|
| 116 | +{ |
|
| 117 | +} |
|
| 118 | 118 | |
| 119 | - /** |
|
| 119 | +/** |
|
| 120 | 120 | * @before funcBefore false |
| 121 | 121 | */ |
| 122 | - public function cbBeforeErrorParam() |
|
| 123 | - { |
|
| 124 | - } |
|
| 122 | +public function cbBeforeErrorParam() |
|
| 123 | +{ |
|
| 124 | +} |
|
| 125 | 125 | |
| 126 | - /** |
|
| 126 | +/** |
|
| 127 | 127 | * @before funcBefore ["param1"] false |
| 128 | 128 | */ |
| 129 | - public function cbBeforeErrorNumber() |
|
| 130 | - { |
|
| 131 | - } |
|
| 129 | +public function cbBeforeErrorNumber() |
|
| 130 | +{ |
|
| 131 | +} |
|
| 132 | 132 | |
| 133 | - /** |
|
| 133 | +/** |
|
| 134 | 134 | * @before func:After |
| 135 | 135 | */ |
| 136 | - public function cbAfterErrorName() |
|
| 137 | - { |
|
| 138 | - } |
|
| 136 | +public function cbAfterErrorName() |
|
| 137 | +{ |
|
| 138 | +} |
|
| 139 | 139 | |
| 140 | - /** |
|
| 140 | +/** |
|
| 141 | 141 | * @before funcAfter false |
| 142 | 142 | */ |
| 143 | - public function cbAfterErrorParam() |
|
| 144 | - { |
|
| 145 | - } |
|
| 143 | +public function cbAfterErrorParam() |
|
| 144 | +{ |
|
| 145 | +} |
|
| 146 | 146 | |
| 147 | - /** |
|
| 147 | +/** |
|
| 148 | 148 | * @before funcAfter ["param1"] false |
| 149 | 149 | */ |
| 150 | - public function cbAfterErrorNumber() |
|
| 151 | - { |
|
| 152 | - } |
|
| 150 | +public function cbAfterErrorNumber() |
|
| 151 | +{ |
|
| 152 | +} |
|
| 153 | 153 | |
| 154 | - /** |
|
| 154 | +/** |
|
| 155 | 155 | * @di $colorService ColorService |
| 156 | 156 | * @di $fontService FontService |
| 157 | 157 | */ |
| 158 | - public function di1() |
|
| 159 | - { |
|
| 160 | - } |
|
| 158 | +public function di1() |
|
| 159 | +{ |
|
| 160 | +} |
|
| 161 | 161 | |
| 162 | - /** |
|
| 162 | +/** |
|
| 163 | 163 | * @di $colorService ColorService |
| 164 | 164 | * @di $textService \Jaxon\Annotations\Tests\Service\TextService |
| 165 | 165 | */ |
| 166 | - public function di2() |
|
| 167 | - { |
|
| 168 | - } |
|
| 166 | +public function di2() |
|
| 167 | +{ |
|
| 168 | +} |
|
| 169 | 169 | |
| 170 | - /** |
|
| 170 | +/** |
|
| 171 | 171 | * @di $color.Service ColorService |
| 172 | 172 | */ |
| 173 | - public function diErrorAttr() |
|
| 174 | - { |
|
| 175 | - } |
|
| 173 | +public function diErrorAttr() |
|
| 174 | +{ |
|
| 175 | +} |
|
| 176 | 176 | |
| 177 | - /** |
|
| 177 | +/** |
|
| 178 | 178 | * @di $colorService Color.Service |
| 179 | 179 | */ |
| 180 | - public function diErrorClass() |
|
| 181 | - { |
|
| 182 | - } |
|
| 180 | +public function diErrorClass() |
|
| 181 | +{ |
|
| 182 | +} |
|
| 183 | 183 | |
| 184 | - /** |
|
| 184 | +/** |
|
| 185 | 185 | * @di $colorService |
| 186 | 186 | */ |
| 187 | - public function diErrorOneParam() |
|
| 188 | - { |
|
| 189 | - } |
|
| 187 | +public function diErrorOneParam() |
|
| 188 | +{ |
|
| 189 | +} |
|
| 190 | 190 | |
| 191 | - /** |
|
| 191 | +/** |
|
| 192 | 192 | * @di $colorService ColorService TextService |
| 193 | 193 | */ |
| 194 | - public function diErrorThreeParams() |
|
| 195 | - { |
|
| 196 | - } |
|
| 194 | +public function diErrorThreeParams() |
|
| 195 | +{ |
|
| 196 | +} |
|
| 197 | 197 | |
| 198 | - /** |
|
| 198 | +/** |
|
| 199 | 199 | * @callback jaxon.ajax.callback.test |
| 200 | 200 | */ |
| 201 | - public function withCallback() |
|
| 202 | - { |
|
| 203 | - } |
|
| 201 | +public function withCallback() |
|
| 202 | +{ |
|
| 203 | +} |
|
| 204 | 204 | } |
@@ -7,130 +7,130 @@ |
||
| 7 | 7 | |
| 8 | 8 | class AttrAnnotated extends FuncComponent |
| 9 | 9 | { |
| 10 | - /** |
|
| 10 | +/** |
|
| 11 | 11 | * @var ColorService |
| 12 | 12 | */ |
| 13 | - protected $colorService; |
|
| 13 | +protected $colorService; |
|
| 14 | 14 | |
| 15 | - /** |
|
| 15 | +/** |
|
| 16 | 16 | * @var FontService |
| 17 | 17 | */ |
| 18 | - protected $fontService; |
|
| 18 | +protected $fontService; |
|
| 19 | 19 | |
| 20 | - /** |
|
| 20 | +/** |
|
| 21 | 21 | * @var \Jaxon\Annotations\Tests\Service\TextService |
| 22 | 22 | */ |
| 23 | - protected $textService; |
|
| 23 | +protected $textService; |
|
| 24 | 24 | |
| 25 | - /** |
|
| 25 | +/** |
|
| 26 | 26 | * @di ColorService |
| 27 | 27 | */ |
| 28 | - protected $colorService1; |
|
| 28 | +protected $colorService1; |
|
| 29 | 29 | |
| 30 | - /** |
|
| 30 | +/** |
|
| 31 | 31 | * @di FontService |
| 32 | 32 | */ |
| 33 | - protected $fontService1; |
|
| 33 | +protected $fontService1; |
|
| 34 | 34 | |
| 35 | - /** |
|
| 35 | +/** |
|
| 36 | 36 | * @di \Jaxon\Annotations\Tests\Service\TextService |
| 37 | 37 | */ |
| 38 | - protected $textService1; |
|
| 38 | +protected $textService1; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 40 | +/** |
|
| 41 | 41 | * @di |
| 42 | 42 | * @var ColorService |
| 43 | 43 | */ |
| 44 | - protected $colorService2; |
|
| 44 | +protected $colorService2; |
|
| 45 | 45 | |
| 46 | - /** |
|
| 46 | +/** |
|
| 47 | 47 | * @di |
| 48 | 48 | * @var FontService |
| 49 | 49 | */ |
| 50 | - protected $fontService2; |
|
| 50 | +protected $fontService2; |
|
| 51 | 51 | |
| 52 | - /** |
|
| 52 | +/** |
|
| 53 | 53 | * @di |
| 54 | 54 | * @var \Jaxon\Annotations\Tests\Service\TextService |
| 55 | 55 | */ |
| 56 | - protected $textService2; |
|
| 56 | +protected $textService2; |
|
| 57 | 57 | |
| 58 | - /** |
|
| 58 | +/** |
|
| 59 | 59 | * @di('class' => 'ColorService') |
| 60 | 60 | */ |
| 61 | - protected $colorService3; |
|
| 61 | +protected $colorService3; |
|
| 62 | 62 | |
| 63 | - /** |
|
| 63 | +/** |
|
| 64 | 64 | * @di('class' => 'FontService') |
| 65 | 65 | */ |
| 66 | - protected $fontService3; |
|
| 66 | +protected $fontService3; |
|
| 67 | 67 | |
| 68 | - /** |
|
| 68 | +/** |
|
| 69 | 69 | * @di('class' => '\Jaxon\Annotations\Tests\Service\TextService') |
| 70 | 70 | */ |
| 71 | - protected $textService3; |
|
| 71 | +protected $textService3; |
|
| 72 | 72 | |
| 73 | - /** |
|
| 73 | +/** |
|
| 74 | 74 | * @di $fontService FontService |
| 75 | 75 | */ |
| 76 | - protected $errorTwoParams; |
|
| 76 | +protected $errorTwoParams; |
|
| 77 | 77 | |
| 78 | - /** |
|
| 78 | +/** |
|
| 79 | 79 | * @di('attr' => 'fontService') |
| 80 | 80 | */ |
| 81 | - protected $errorDiAttr; |
|
| 81 | +protected $errorDiAttr; |
|
| 82 | 82 | |
| 83 | - /** |
|
| 83 | +/** |
|
| 84 | 84 | * @di $fontService |
| 85 | 85 | */ |
| 86 | - protected $errorDiDbAttr; |
|
| 86 | +protected $errorDiDbAttr; |
|
| 87 | 87 | |
| 88 | - /** |
|
| 88 | +/** |
|
| 89 | 89 | * @di |
| 90 | 90 | * @di FontService |
| 91 | 91 | */ |
| 92 | - protected $errorTwoDi; |
|
| 92 | +protected $errorTwoDi; |
|
| 93 | 93 | |
| 94 | - /** |
|
| 94 | +/** |
|
| 95 | 95 | * @di('attr' => 'colorService') |
| 96 | 96 | * @di('attr' => 'fontService') |
| 97 | 97 | * @di('attr' => 'textService') |
| 98 | 98 | */ |
| 99 | - public function attrVar() |
|
| 100 | - { |
|
| 101 | - } |
|
| 99 | +public function attrVar() |
|
| 100 | +{ |
|
| 101 | +} |
|
| 102 | 102 | |
| 103 | - /** |
|
| 103 | +/** |
|
| 104 | 104 | * @di $colorService |
| 105 | 105 | * @di $fontService |
| 106 | 106 | * @di $textService |
| 107 | 107 | */ |
| 108 | - public function attrDbVar() |
|
| 109 | - { |
|
| 110 | - } |
|
| 108 | +public function attrDbVar() |
|
| 109 | +{ |
|
| 110 | +} |
|
| 111 | 111 | |
| 112 | - public function attrDi() |
|
| 113 | - { |
|
| 114 | - } |
|
| 112 | +public function attrDi() |
|
| 113 | +{ |
|
| 114 | +} |
|
| 115 | 115 | |
| 116 | - /** |
|
| 116 | +/** |
|
| 117 | 117 | * @di ColorService |
| 118 | 118 | */ |
| 119 | - public function errorDiClass() |
|
| 120 | - { |
|
| 121 | - } |
|
| 119 | +public function errorDiClass() |
|
| 120 | +{ |
|
| 121 | +} |
|
| 122 | 122 | |
| 123 | - /** |
|
| 123 | +/** |
|
| 124 | 124 | * @di colorService ColorService |
| 125 | 125 | */ |
| 126 | - public function errorDiNoVar() |
|
| 127 | - { |
|
| 128 | - } |
|
| 126 | +public function errorDiNoVar() |
|
| 127 | +{ |
|
| 128 | +} |
|
| 129 | 129 | |
| 130 | - /** |
|
| 130 | +/** |
|
| 131 | 131 | * @di $colorService $ColorService |
| 132 | 132 | */ |
| 133 | - public function errorDiTwoVars() |
|
| 134 | - { |
|
| 135 | - } |
|
| 133 | +public function errorDiTwoVars() |
|
| 134 | +{ |
|
| 135 | +} |
|
| 136 | 136 | } |
@@ -6,9 +6,9 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ContainerError extends FuncComponent |
| 8 | 8 | {
|
| 9 | - /** |
|
| 9 | +/** |
|
| 10 | 10 | * @di('class' => 'Class1')
|
| 11 | 11 | * @di('class' => 'Class2')
|
| 12 | 12 | */ |
| 13 | - public $prop; |
|
| 13 | +public $prop; |
|
| 14 | 14 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | trait AnnotationTrait |
| 12 | 12 | { |
| 13 | - /** |
|
| 13 | +/** |
|
| 14 | 14 | * Get the metadata from a given class |
| 15 | 15 | * |
| 16 | 16 | * @param ReflectionClass|string $xClass |
@@ -19,11 +19,11 @@ discard block |
||
| 19 | 19 | * |
| 20 | 20 | * @return Metadata|null |
| 21 | 21 | */ |
| 22 | - public function getAttributes(ReflectionClass|string $xClass, |
|
| 23 | - array $aMethods = [], array $aProperties = []): ?Metadata |
|
| 24 | - { |
|
| 25 | - $xInputData = new InputData($xClass, $aMethods, $aProperties); |
|
| 26 | - $xMetadataReader = jaxon()->di()->getMetadataReader('annotations'); |
|
| 27 | - return $xMetadataReader->getAttributes($xInputData); |
|
| 28 | - } |
|
| 22 | +public function getAttributes(ReflectionClass|string $xClass, |
|
| 23 | +array $aMethods = [], array $aProperties = []): ?Metadata |
|
| 24 | +{ |
|
| 25 | +$xInputData = new InputData($xClass, $aMethods, $aProperties); |
|
| 26 | +$xMetadataReader = jaxon()->di()->getMetadataReader('annotations'); |
|
| 27 | +return $xMetadataReader->getAttributes($xInputData); |
|
| 28 | +} |
|
| 29 | 29 | } |
@@ -20,45 +20,45 @@ |
||
| 20 | 20 | |
| 21 | 21 | interface UploadHandlerInterface |
| 22 | 22 | { |
| 23 | - /** |
|
| 23 | +/** |
|
| 24 | 24 | * Set the uploaded file name sanitizer |
| 25 | 25 | * |
| 26 | 26 | * @param Closure $cSanitizer The closure |
| 27 | 27 | * |
| 28 | 28 | * @return void |
| 29 | 29 | */ |
| 30 | - public function sanitizer(Closure $cSanitizer); |
|
| 30 | +public function sanitizer(Closure $cSanitizer); |
|
| 31 | 31 | |
| 32 | - /** |
|
| 32 | +/** |
|
| 33 | 33 | * Get the uploaded files |
| 34 | 34 | * |
| 35 | 35 | * @return FileInterface[] |
| 36 | 36 | */ |
| 37 | - public function files(): array; |
|
| 37 | +public function files(): array; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 39 | +/** |
|
| 40 | 40 | * Check if the current request contains uploaded files |
| 41 | 41 | * |
| 42 | 42 | * @param ServerRequestInterface $xRequest |
| 43 | 43 | * |
| 44 | 44 | * @return bool |
| 45 | 45 | */ |
| 46 | - public function canProcessRequest(ServerRequestInterface $xRequest): bool; |
|
| 46 | +public function canProcessRequest(ServerRequestInterface $xRequest): bool; |
|
| 47 | 47 | |
| 48 | - /** |
|
| 48 | +/** |
|
| 49 | 49 | * Process the uploaded files in the HTTP request |
| 50 | 50 | * |
| 51 | 51 | * @param ServerRequestInterface $xRequest |
| 52 | 52 | * |
| 53 | 53 | * @return bool |
| 54 | 54 | */ |
| 55 | - public function processRequest(ServerRequestInterface $xRequest): bool; |
|
| 55 | +public function processRequest(ServerRequestInterface $xRequest): bool; |
|
| 56 | 56 | |
| 57 | - /** |
|
| 57 | +/** |
|
| 58 | 58 | * @param string $sStorage |
| 59 | 59 | * @param Closure $cFactory |
| 60 | 60 | * |
| 61 | 61 | * @return void |
| 62 | 62 | */ |
| 63 | - public function registerStorageAdapter(string $sStorage, Closure $cFactory); |
|
| 63 | +public function registerStorageAdapter(string $sStorage, Closure $cFactory); |
|
| 64 | 64 | } |
@@ -81,8 +81,7 @@ discard block |
||
| 81 | 81 | { |
| 82 | 82 | // Local file system adapter |
| 83 | 83 | $this->registerAdapter('local', function(string $sRootDir, $xOptions) { |
| 84 | - return empty($xOptions) ? new LocalFilesystemAdapter($sRootDir) : |
|
| 85 | - new LocalFilesystemAdapter($sRootDir, $xOptions); |
|
| 84 | + return empty($xOptions) ? new LocalFilesystemAdapter($sRootDir) : new LocalFilesystemAdapter($sRootDir, $xOptions); |
|
| 86 | 85 | }); |
| 87 | 86 | |
| 88 | 87 | // AWS S3 file system adapter |
@@ -140,7 +139,7 @@ discard block |
||
| 140 | 139 | public function filesystem(string $sField = ''): Filesystem |
| 141 | 140 | { |
| 142 | 141 | $sField = trim($sField); |
| 143 | - if(isset($this->aFilesystems[$sField])) |
|
| 142 | + if (isset($this->aFilesystems[$sField])) |
|
| 144 | 143 | { |
| 145 | 144 | return $this->aFilesystems[$sField]; |
| 146 | 145 | } |
@@ -150,18 +149,18 @@ discard block |
||
| 150 | 149 | $sRootDir = $this->xConfigManager->getOption('upload.default.dir', ''); |
| 151 | 150 | $aOptions = $this->xConfigManager->getOption('upload.default.options'); |
| 152 | 151 | $sConfigKey = "upload.files.$sField"; |
| 153 | - if($sField !== '' && $this->xConfigManager->hasOption($sConfigKey)) |
|
| 152 | + if ($sField !== '' && $this->xConfigManager->hasOption($sConfigKey)) |
|
| 154 | 153 | { |
| 155 | 154 | $sStorage = $this->xConfigManager->getOption("$sConfigKey.storage", $sStorage); |
| 156 | 155 | $sRootDir = $this->xConfigManager->getOption("$sConfigKey.dir", $sRootDir); |
| 157 | 156 | $aOptions = $this->xConfigManager->getOption("$sConfigKey.options", $aOptions); |
| 158 | 157 | } |
| 159 | 158 | |
| 160 | - if(!is_string($sRootDir)) |
|
| 159 | + if (!is_string($sRootDir)) |
|
| 161 | 160 | { |
| 162 | 161 | throw new RequestException($this->xTranslator->trans('errors.upload.dir')); |
| 163 | 162 | } |
| 164 | - if(!isset($this->aAdapters[$sStorage])) |
|
| 163 | + if (!isset($this->aAdapters[$sStorage])) |
|
| 165 | 164 | { |
| 166 | 165 | throw new RequestException($this->xTranslator->trans('errors.upload.adapter')); |
| 167 | 166 | } |
@@ -144,15 +144,15 @@ discard block |
||
| 144 | 144 | $xRegistry->updateHash(false); // Disable hash calculation. |
| 145 | 145 | |
| 146 | 146 | $sComponentId = str_replace('\\', '.', $sClassName); |
| 147 | - if(!isset($this->aComponents[$sComponentId])) |
|
| 147 | + if (!isset($this->aComponents[$sComponentId])) |
|
| 148 | 148 | { |
| 149 | 149 | $aOptions = $xRegistry->getNamespaceComponentOptions($sClassName); |
| 150 | - if($aOptions !== null) |
|
| 150 | + if ($aOptions !== null) |
|
| 151 | 151 | { |
| 152 | 152 | $this->saveComponent($sClassName, $aOptions); |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | - if(isset($this->aComponents[$sComponentId])) |
|
| 155 | + if (isset($this->aComponents[$sComponentId])) |
|
| 156 | 156 | { |
| 157 | 157 | return; // The component is found. |
| 158 | 158 | } |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | // The component was not found in a registered namespace. We need to parse all |
| 161 | 161 | // the directories to be able to find a component registered without a namespace. |
| 162 | 162 | $sComponentId = str_replace('\\', '_', $sClassName); |
| 163 | - if(!isset($this->aComponents[$sComponentId])) |
|
| 163 | + if (!isset($this->aComponents[$sComponentId])) |
|
| 164 | 164 | { |
| 165 | 165 | $xRegistry->registerComponentsInDirectories(); |
| 166 | 166 | } |
| 167 | - if(isset($this->aComponents[$sComponentId])) |
|
| 167 | + if (isset($this->aComponents[$sComponentId])) |
|
| 168 | 168 | { |
| 169 | 169 | return; // The component is found. |
| 170 | 170 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | public function getCallableObjects(): array |
| 183 | 183 | { |
| 184 | 184 | $aCallableObjects = []; |
| 185 | - foreach($this->aComponents as $sComponentId => $_) |
|
| 185 | + foreach ($this->aComponents as $sComponentId => $_) |
|
| 186 | 186 | { |
| 187 | 187 | $aCallableObjects[$sComponentId] = $this->makeCallableObject($sComponentId); |
| 188 | 188 | } |
@@ -233,12 +233,12 @@ discard block |
||
| 233 | 233 | { |
| 234 | 234 | /** @var Config|null */ |
| 235 | 235 | $xPackageConfig = $aOptions['config'] ?? null; |
| 236 | - if($xPackageConfig === null || (bool)($aOptions['excluded'] ?? false)) |
|
| 236 | + if ($xPackageConfig === null || (bool)($aOptions['excluded'] ?? false)) |
|
| 237 | 237 | { |
| 238 | 238 | return null; |
| 239 | 239 | } |
| 240 | 240 | $sMetadataFormat = $xPackageConfig->getOption('metadata.format'); |
| 241 | - if(!in_array($sMetadataFormat, ['attributes', 'annotations'])) |
|
| 241 | + if (!in_array($sMetadataFormat, ['attributes', 'annotations'])) |
|
| 242 | 242 | { |
| 243 | 243 | return null; |
| 244 | 244 | } |
@@ -248,23 +248,23 @@ discard block |
||
| 248 | 248 | $xMetadata = null; |
| 249 | 249 | $xMetadataCache = null; |
| 250 | 250 | $xConfig = $di->config(); |
| 251 | - if($xConfig->getAppOption('metadata.cache.enabled', false)) |
|
| 251 | + if ($xConfig->getAppOption('metadata.cache.enabled', false)) |
|
| 252 | 252 | { |
| 253 | - if(!$di->h('jaxon_metadata_cache_dir')) |
|
| 253 | + if (!$di->h('jaxon_metadata_cache_dir')) |
|
| 254 | 254 | { |
| 255 | 255 | $sCacheDir = $xConfig->getAppOption('metadata.cache.dir'); |
| 256 | 256 | $di->val('jaxon_metadata_cache_dir', $sCacheDir); |
| 257 | 257 | } |
| 258 | 258 | $xMetadataCache = $di->getMetadataCache(); |
| 259 | 259 | $xMetadata = $xMetadataCache->read($xReflectionClass->getName()); |
| 260 | - if($xMetadata !== null) |
|
| 260 | + if ($xMetadata !== null) |
|
| 261 | 261 | { |
| 262 | 262 | return $xMetadata; |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | $aProperties = array_map(fn($xProperty) => $xProperty->getName(), |
| 267 | - $xReflectionClass->getProperties(ReflectionProperty::IS_PUBLIC | |
|
| 267 | + $xReflectionClass->getProperties(ReflectionProperty::IS_PUBLIC| |
|
| 268 | 268 | ReflectionProperty::IS_PROTECTED)); |
| 269 | 269 | $aMethods = $this->getPublicMethods($xReflectionClass); |
| 270 | 270 | |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $xMetadata = $xMetadataReader->getAttributes($xInput); |
| 274 | 274 | |
| 275 | 275 | // Try to save the metadata in the cache |
| 276 | - if($xMetadataCache !== null && $xMetadata !== null) |
|
| 276 | + if ($xMetadataCache !== null && $xMetadata !== null) |
|
| 277 | 277 | { |
| 278 | 278 | $xMetadataCache->save($xReflectionClass->getName(), $xMetadata); |
| 279 | 279 | } |
@@ -291,8 +291,7 @@ discard block |
||
| 291 | 291 | array $aOptions): ComponentOptions |
| 292 | 292 | { |
| 293 | 293 | $xMetadata = $this->getComponentMetadata($xReflectionClass, $aOptions); |
| 294 | - return !$xMetadata ? new ComponentOptions($aOptions) : |
|
| 295 | - new ComponentOptions($aOptions, $xMetadata->isExcluded(), |
|
| 294 | + return !$xMetadata ? new ComponentOptions($aOptions) : new ComponentOptions($aOptions, $xMetadata->isExcluded(), |
|
| 296 | 295 | $xMetadata->getProtectedMethods(), $xMetadata->getProperties()); |
| 297 | 296 | } |
| 298 | 297 | } |
@@ -16,23 +16,23 @@ |
||
| 16 | 16 | |
| 17 | 17 | class Jaxon |
| 18 | 18 | { |
| 19 | - /** |
|
| 19 | +/** |
|
| 20 | 20 | * @const string |
| 21 | 21 | */ |
| 22 | - public const VERSION = 'Jaxon 5.x'; |
|
| 22 | +public const VERSION = 'Jaxon 5.x'; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | +/** |
|
| 25 | 25 | * @const string |
| 26 | 26 | */ |
| 27 | - public const CALLABLE_CLASS = 'CallableClass'; |
|
| 27 | +public const CALLABLE_CLASS = 'CallableClass'; |
|
| 28 | 28 | |
| 29 | - /** |
|
| 29 | +/** |
|
| 30 | 30 | * @const string |
| 31 | 31 | */ |
| 32 | - public const CALLABLE_DIR = 'CallableDir'; |
|
| 32 | +public const CALLABLE_DIR = 'CallableDir'; |
|
| 33 | 33 | |
| 34 | - /** |
|
| 34 | +/** |
|
| 35 | 35 | * @const string |
| 36 | 36 | */ |
| 37 | - public const CALLABLE_FUNCTION = 'CallableFunction'; |
|
| 37 | +public const CALLABLE_FUNCTION = 'CallableFunction'; |
|
| 38 | 38 | } |