@@ -16,320 +16,320 @@ |
||
| 16 | 16 | |
| 17 | 17 | class DocBlockAnnotationTest extends TestCase |
| 18 | 18 | { |
| 19 | - use AnnotationTrait; |
|
| 19 | +use AnnotationTrait; |
|
| 20 | 20 | |
| 21 | - /** |
|
| 21 | +/** |
|
| 22 | 22 | * @var string |
| 23 | 23 | */ |
| 24 | - protected $sCacheDir; |
|
| 24 | +protected $sCacheDir; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 26 | +/** |
|
| 27 | 27 | * @throws SetupException |
| 28 | 28 | */ |
| 29 | - public function setUp(): void |
|
| 30 | - { |
|
| 31 | - $this->sCacheDir = __DIR__ . '/../tmp'; |
|
| 32 | - @mkdir($this->sCacheDir); |
|
| 29 | +public function setUp(): void |
|
| 30 | +{ |
|
| 31 | +$this->sCacheDir = __DIR__ . '/../tmp'; |
|
| 32 | +@mkdir($this->sCacheDir); |
|
| 33 | 33 | |
| 34 | - jaxon()->di()->getPluginManager()->registerPlugins(); |
|
| 35 | - _register(); |
|
| 34 | +jaxon()->di()->getPluginManager()->registerPlugins(); |
|
| 35 | +_register(); |
|
| 36 | 36 | |
| 37 | - jaxon()->di()->val('jaxon_annotations_cache_dir', $this->sCacheDir); |
|
| 38 | - } |
|
| 37 | +jaxon()->di()->val('jaxon_annotations_cache_dir', $this->sCacheDir); |
|
| 38 | +} |
|
| 39 | 39 | |
| 40 | - /** |
|
| 40 | +/** |
|
| 41 | 41 | * @throws SetupException |
| 42 | 42 | */ |
| 43 | - public function tearDown(): void |
|
| 44 | - { |
|
| 45 | - jaxon()->reset(); |
|
| 46 | - parent::tearDown(); |
|
| 47 | - |
|
| 48 | - // Delete the temp dir and all its content |
|
| 49 | - $aFiles = scandir($this->sCacheDir); |
|
| 50 | - foreach ($aFiles as $sFile) |
|
| 51 | - { |
|
| 52 | - if($sFile !== '.' && $sFile !== '..') |
|
| 53 | - { |
|
| 54 | - @unlink($this->sCacheDir . DIRECTORY_SEPARATOR . $sFile); |
|
| 55 | - } |
|
| 56 | - } |
|
| 57 | - @rmdir($this->sCacheDir); |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - /** |
|
| 43 | +public function tearDown(): void |
|
| 44 | +{ |
|
| 45 | +jaxon()->reset(); |
|
| 46 | +parent::tearDown(); |
|
| 47 | + |
|
| 48 | +// Delete the temp dir and all its content |
|
| 49 | +$aFiles = scandir($this->sCacheDir); |
|
| 50 | +foreach ($aFiles as $sFile) |
|
| 51 | +{ |
|
| 52 | +if($sFile !== '.' && $sFile !== '..') |
|
| 53 | +{ |
|
| 54 | + @unlink($this->sCacheDir . DIRECTORY_SEPARATOR . $sFile); |
|
| 55 | +} |
|
| 56 | +} |
|
| 57 | +@rmdir($this->sCacheDir); |
|
| 58 | +} |
|
| 59 | + |
|
| 60 | +/** |
|
| 61 | 61 | * @throws SetupException |
| 62 | 62 | */ |
| 63 | - public function testUploadAndExcludeAnnotation() |
|
| 64 | - { |
|
| 65 | - $xMetadata = $this->getAttributes(DocBlockAnnotated::class, ['saveFiles', 'doNot']); |
|
| 66 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 67 | - $aProperties = $xMetadata->getProperties(); |
|
| 68 | - $aProtected = $xMetadata->getProtectedMethods(); |
|
| 63 | +public function testUploadAndExcludeAnnotation() |
|
| 64 | +{ |
|
| 65 | +$xMetadata = $this->getAttributes(DocBlockAnnotated::class, ['saveFiles', 'doNot']); |
|
| 66 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 67 | +$aProperties = $xMetadata->getProperties(); |
|
| 68 | +$aProtected = $xMetadata->getProtectedMethods(); |
|
| 69 | 69 | |
| 70 | - $this->assertFalse($bExcluded); |
|
| 70 | +$this->assertFalse($bExcluded); |
|
| 71 | 71 | |
| 72 | - $this->assertCount(1, $aProtected); |
|
| 73 | - $this->assertEquals('doNot', $aProtected[0]); |
|
| 72 | +$this->assertCount(1, $aProtected); |
|
| 73 | +$this->assertEquals('doNot', $aProtected[0]); |
|
| 74 | 74 | |
| 75 | - $this->assertCount(1, $aProperties); |
|
| 76 | - $this->assertArrayHasKey('saveFiles', $aProperties); |
|
| 77 | - $this->assertCount(1, $aProperties['saveFiles']); |
|
| 78 | - $this->assertEquals("'user-files'", $aProperties['saveFiles']['upload']); |
|
| 79 | - } |
|
| 75 | +$this->assertCount(1, $aProperties); |
|
| 76 | +$this->assertArrayHasKey('saveFiles', $aProperties); |
|
| 77 | +$this->assertCount(1, $aProperties['saveFiles']); |
|
| 78 | +$this->assertEquals("'user-files'", $aProperties['saveFiles']['upload']); |
|
| 79 | +} |
|
| 80 | 80 | |
| 81 | - /** |
|
| 81 | +/** |
|
| 82 | 82 | * @throws SetupException |
| 83 | 83 | */ |
| 84 | - public function testDataBagAnnotation() |
|
| 85 | - { |
|
| 86 | - $xMetadata = $this->getAttributes(DocBlockAnnotated::class, ['withBags']); |
|
| 87 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 88 | - $aProperties = $xMetadata->getProperties(); |
|
| 89 | - |
|
| 90 | - $this->assertFalse($bExcluded); |
|
| 91 | - |
|
| 92 | - $this->assertCount(1, $aProperties); |
|
| 93 | - $this->assertArrayHasKey('withBags', $aProperties); |
|
| 94 | - $this->assertCount(1, $aProperties['withBags']); |
|
| 95 | - $this->assertCount(2, $aProperties['withBags']['bags']); |
|
| 96 | - $this->assertEquals('user.name', $aProperties['withBags']['bags'][0]); |
|
| 97 | - $this->assertEquals('page.number', $aProperties['withBags']['bags'][1]); |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - /** |
|
| 84 | +public function testDataBagAnnotation() |
|
| 85 | +{ |
|
| 86 | +$xMetadata = $this->getAttributes(DocBlockAnnotated::class, ['withBags']); |
|
| 87 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 88 | +$aProperties = $xMetadata->getProperties(); |
|
| 89 | + |
|
| 90 | +$this->assertFalse($bExcluded); |
|
| 91 | + |
|
| 92 | +$this->assertCount(1, $aProperties); |
|
| 93 | +$this->assertArrayHasKey('withBags', $aProperties); |
|
| 94 | +$this->assertCount(1, $aProperties['withBags']); |
|
| 95 | +$this->assertCount(2, $aProperties['withBags']['bags']); |
|
| 96 | +$this->assertEquals('user.name', $aProperties['withBags']['bags'][0]); |
|
| 97 | +$this->assertEquals('page.number', $aProperties['withBags']['bags'][1]); |
|
| 98 | +} |
|
| 99 | + |
|
| 100 | +/** |
|
| 101 | 101 | * @throws SetupException |
| 102 | 102 | */ |
| 103 | - public function testCallbackAnnotation() |
|
| 104 | - { |
|
| 105 | - $xMetadata = $this->getAttributes(DocBlockAnnotated::class, ['withCallback']); |
|
| 106 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 107 | - $aProperties = $xMetadata->getProperties(); |
|
| 108 | - |
|
| 109 | - $this->assertFalse($bExcluded); |
|
| 110 | - |
|
| 111 | - $this->assertCount(1, $aProperties); |
|
| 112 | - $this->assertArrayHasKey('withCallback', $aProperties); |
|
| 113 | - $this->assertCount(1, $aProperties['withCallback']); |
|
| 114 | - $this->assertIsArray($aProperties['withCallback']['callback']); |
|
| 115 | - $this->assertEquals('jaxon.ajax.callback.test', $aProperties['withCallback']['callback'][0]); |
|
| 116 | - } |
|
| 117 | - |
|
| 118 | - /** |
|
| 103 | +public function testCallbackAnnotation() |
|
| 104 | +{ |
|
| 105 | +$xMetadata = $this->getAttributes(DocBlockAnnotated::class, ['withCallback']); |
|
| 106 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 107 | +$aProperties = $xMetadata->getProperties(); |
|
| 108 | + |
|
| 109 | +$this->assertFalse($bExcluded); |
|
| 110 | + |
|
| 111 | +$this->assertCount(1, $aProperties); |
|
| 112 | +$this->assertArrayHasKey('withCallback', $aProperties); |
|
| 113 | +$this->assertCount(1, $aProperties['withCallback']); |
|
| 114 | +$this->assertIsArray($aProperties['withCallback']['callback']); |
|
| 115 | +$this->assertEquals('jaxon.ajax.callback.test', $aProperties['withCallback']['callback'][0]); |
|
| 116 | +} |
|
| 117 | + |
|
| 118 | +/** |
|
| 119 | 119 | * @throws SetupException |
| 120 | 120 | */ |
| 121 | - public function testHooksAnnotation() |
|
| 122 | - { |
|
| 123 | - $xMetadata = $this->getAttributes(DocBlockAnnotated::class, |
|
| 124 | - ['cbSingle', 'cbMultiple', 'cbParams']); |
|
| 125 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 126 | - $aProperties = $xMetadata->getProperties(); |
|
| 127 | - |
|
| 128 | - $this->assertFalse($bExcluded); |
|
| 129 | - |
|
| 130 | - $this->assertCount(3, $aProperties); |
|
| 131 | - $this->assertArrayHasKey('cbSingle', $aProperties); |
|
| 132 | - $this->assertArrayHasKey('cbMultiple', $aProperties); |
|
| 133 | - $this->assertArrayHasKey('cbParams', $aProperties); |
|
| 134 | - |
|
| 135 | - $this->assertCount(1, $aProperties['cbSingle']['__before']); |
|
| 136 | - $this->assertCount(2, $aProperties['cbMultiple']['__before']); |
|
| 137 | - $this->assertCount(2, $aProperties['cbParams']['__before']); |
|
| 138 | - $this->assertArrayHasKey('funcBefore', $aProperties['cbSingle']['__before']); |
|
| 139 | - $this->assertArrayHasKey('funcBefore1', $aProperties['cbMultiple']['__before']); |
|
| 140 | - $this->assertArrayHasKey('funcBefore2', $aProperties['cbMultiple']['__before']); |
|
| 141 | - $this->assertArrayHasKey('funcBefore1', $aProperties['cbParams']['__before']); |
|
| 142 | - $this->assertArrayHasKey('funcBefore2', $aProperties['cbParams']['__before']); |
|
| 143 | - $this->assertIsArray($aProperties['cbSingle']['__before']['funcBefore']); |
|
| 144 | - $this->assertIsArray($aProperties['cbMultiple']['__before']['funcBefore1']); |
|
| 145 | - $this->assertIsArray($aProperties['cbMultiple']['__before']['funcBefore2']); |
|
| 146 | - $this->assertIsArray($aProperties['cbParams']['__before']['funcBefore1']); |
|
| 147 | - $this->assertIsArray($aProperties['cbParams']['__before']['funcBefore2']); |
|
| 148 | - |
|
| 149 | - $this->assertCount(1, $aProperties['cbSingle']['__after']); |
|
| 150 | - $this->assertCount(3, $aProperties['cbMultiple']['__after']); |
|
| 151 | - $this->assertCount(1, $aProperties['cbParams']['__after']); |
|
| 152 | - $this->assertArrayHasKey('funcAfter', $aProperties['cbSingle']['__after']); |
|
| 153 | - $this->assertArrayHasKey('funcAfter1', $aProperties['cbMultiple']['__after']); |
|
| 154 | - $this->assertArrayHasKey('funcAfter2', $aProperties['cbMultiple']['__after']); |
|
| 155 | - $this->assertArrayHasKey('funcAfter3', $aProperties['cbMultiple']['__after']); |
|
| 156 | - $this->assertArrayHasKey('funcAfter1', $aProperties['cbParams']['__after']); |
|
| 157 | - $this->assertIsArray($aProperties['cbSingle']['__after']['funcAfter']); |
|
| 158 | - $this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter1']); |
|
| 159 | - $this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter2']); |
|
| 160 | - $this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter3']); |
|
| 161 | - $this->assertIsArray($aProperties['cbParams']['__after']['funcAfter1']); |
|
| 162 | - } |
|
| 163 | - |
|
| 164 | - /** |
|
| 121 | +public function testHooksAnnotation() |
|
| 122 | +{ |
|
| 123 | +$xMetadata = $this->getAttributes(DocBlockAnnotated::class, |
|
| 124 | +['cbSingle', 'cbMultiple', 'cbParams']); |
|
| 125 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 126 | +$aProperties = $xMetadata->getProperties(); |
|
| 127 | + |
|
| 128 | +$this->assertFalse($bExcluded); |
|
| 129 | + |
|
| 130 | +$this->assertCount(3, $aProperties); |
|
| 131 | +$this->assertArrayHasKey('cbSingle', $aProperties); |
|
| 132 | +$this->assertArrayHasKey('cbMultiple', $aProperties); |
|
| 133 | +$this->assertArrayHasKey('cbParams', $aProperties); |
|
| 134 | + |
|
| 135 | +$this->assertCount(1, $aProperties['cbSingle']['__before']); |
|
| 136 | +$this->assertCount(2, $aProperties['cbMultiple']['__before']); |
|
| 137 | +$this->assertCount(2, $aProperties['cbParams']['__before']); |
|
| 138 | +$this->assertArrayHasKey('funcBefore', $aProperties['cbSingle']['__before']); |
|
| 139 | +$this->assertArrayHasKey('funcBefore1', $aProperties['cbMultiple']['__before']); |
|
| 140 | +$this->assertArrayHasKey('funcBefore2', $aProperties['cbMultiple']['__before']); |
|
| 141 | +$this->assertArrayHasKey('funcBefore1', $aProperties['cbParams']['__before']); |
|
| 142 | +$this->assertArrayHasKey('funcBefore2', $aProperties['cbParams']['__before']); |
|
| 143 | +$this->assertIsArray($aProperties['cbSingle']['__before']['funcBefore']); |
|
| 144 | +$this->assertIsArray($aProperties['cbMultiple']['__before']['funcBefore1']); |
|
| 145 | +$this->assertIsArray($aProperties['cbMultiple']['__before']['funcBefore2']); |
|
| 146 | +$this->assertIsArray($aProperties['cbParams']['__before']['funcBefore1']); |
|
| 147 | +$this->assertIsArray($aProperties['cbParams']['__before']['funcBefore2']); |
|
| 148 | + |
|
| 149 | +$this->assertCount(1, $aProperties['cbSingle']['__after']); |
|
| 150 | +$this->assertCount(3, $aProperties['cbMultiple']['__after']); |
|
| 151 | +$this->assertCount(1, $aProperties['cbParams']['__after']); |
|
| 152 | +$this->assertArrayHasKey('funcAfter', $aProperties['cbSingle']['__after']); |
|
| 153 | +$this->assertArrayHasKey('funcAfter1', $aProperties['cbMultiple']['__after']); |
|
| 154 | +$this->assertArrayHasKey('funcAfter2', $aProperties['cbMultiple']['__after']); |
|
| 155 | +$this->assertArrayHasKey('funcAfter3', $aProperties['cbMultiple']['__after']); |
|
| 156 | +$this->assertArrayHasKey('funcAfter1', $aProperties['cbParams']['__after']); |
|
| 157 | +$this->assertIsArray($aProperties['cbSingle']['__after']['funcAfter']); |
|
| 158 | +$this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter1']); |
|
| 159 | +$this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter2']); |
|
| 160 | +$this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter3']); |
|
| 161 | +$this->assertIsArray($aProperties['cbParams']['__after']['funcAfter1']); |
|
| 162 | +} |
|
| 163 | + |
|
| 164 | +/** |
|
| 165 | 165 | * @throws SetupException |
| 166 | 166 | */ |
| 167 | - public function testContainerAnnotation() |
|
| 168 | - { |
|
| 169 | - $xMetadata = $this->getAttributes(DocBlockAnnotated::class, ['di1', 'di2']); |
|
| 170 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 171 | - $aProperties = $xMetadata->getProperties(); |
|
| 172 | - |
|
| 173 | - $this->assertFalse($bExcluded); |
|
| 174 | - |
|
| 175 | - $this->assertCount(2, $aProperties); |
|
| 176 | - $this->assertArrayHasKey('di1', $aProperties); |
|
| 177 | - $this->assertArrayHasKey('di2', $aProperties); |
|
| 178 | - $this->assertCount(2, $aProperties['di1']['__di']); |
|
| 179 | - $this->assertCount(2, $aProperties['di2']['__di']); |
|
| 180 | - $this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['di1']['__di']['colorService']); |
|
| 181 | - $this->assertEquals('Jaxon\Annotations\Tests\App\Ajax\FontService', $aProperties['di1']['__di']['fontService']); |
|
| 182 | - $this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['di2']['__di']['colorService']); |
|
| 183 | - $this->assertEquals('Jaxon\Annotations\Tests\Service\TextService', $aProperties['di2']['__di']['textService']); |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - /** |
|
| 167 | +public function testContainerAnnotation() |
|
| 168 | +{ |
|
| 169 | +$xMetadata = $this->getAttributes(DocBlockAnnotated::class, ['di1', 'di2']); |
|
| 170 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 171 | +$aProperties = $xMetadata->getProperties(); |
|
| 172 | + |
|
| 173 | +$this->assertFalse($bExcluded); |
|
| 174 | + |
|
| 175 | +$this->assertCount(2, $aProperties); |
|
| 176 | +$this->assertArrayHasKey('di1', $aProperties); |
|
| 177 | +$this->assertArrayHasKey('di2', $aProperties); |
|
| 178 | +$this->assertCount(2, $aProperties['di1']['__di']); |
|
| 179 | +$this->assertCount(2, $aProperties['di2']['__di']); |
|
| 180 | +$this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['di1']['__di']['colorService']); |
|
| 181 | +$this->assertEquals('Jaxon\Annotations\Tests\App\Ajax\FontService', $aProperties['di1']['__di']['fontService']); |
|
| 182 | +$this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['di2']['__di']['colorService']); |
|
| 183 | +$this->assertEquals('Jaxon\Annotations\Tests\Service\TextService', $aProperties['di2']['__di']['textService']); |
|
| 184 | +} |
|
| 185 | + |
|
| 186 | +/** |
|
| 187 | 187 | * @throws SetupException |
| 188 | 188 | */ |
| 189 | - public function testClassAnnotation() |
|
| 190 | - { |
|
| 191 | - $xMetadata = $this->getAttributes(DocBlockClassAnnotated::class, []); |
|
| 192 | - // $this->assertEquals('', json_encode($aProperties)); |
|
| 193 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 194 | - $aProperties = $xMetadata->getProperties(); |
|
| 195 | - |
|
| 196 | - $this->assertFalse($bExcluded); |
|
| 197 | - |
|
| 198 | - $this->assertCount(1, $aProperties); |
|
| 199 | - $this->assertArrayHasKey('*', $aProperties); |
|
| 200 | - $this->assertCount(5, $aProperties['*']); |
|
| 201 | - $this->assertArrayHasKey('bags', $aProperties['*']); |
|
| 202 | - $this->assertArrayHasKey('callback', $aProperties['*']); |
|
| 203 | - $this->assertArrayHasKey('__before', $aProperties['*']); |
|
| 204 | - $this->assertArrayHasKey('__after', $aProperties['*']); |
|
| 205 | - |
|
| 206 | - $this->assertCount(2, $aProperties['*']['bags']); |
|
| 207 | - $this->assertEquals('user.name', $aProperties['*']['bags'][0]); |
|
| 208 | - $this->assertEquals('page.number', $aProperties['*']['bags'][1]); |
|
| 209 | - |
|
| 210 | - $this->assertIsArray($aProperties['*']['callback']); |
|
| 211 | - $this->assertEquals('jaxon.ajax.callback.test', $aProperties['*']['callback'][0]); |
|
| 212 | - |
|
| 213 | - $this->assertCount(2, $aProperties['*']['__before']); |
|
| 214 | - $this->assertArrayHasKey('funcBefore1', $aProperties['*']['__before']); |
|
| 215 | - $this->assertArrayHasKey('funcBefore2', $aProperties['*']['__before']); |
|
| 216 | - $this->assertIsArray($aProperties['*']['__before']['funcBefore1']); |
|
| 217 | - $this->assertIsArray($aProperties['*']['__before']['funcBefore2']); |
|
| 218 | - |
|
| 219 | - $this->assertCount(3, $aProperties['*']['__after']); |
|
| 220 | - $this->assertArrayHasKey('funcAfter1', $aProperties['*']['__after']); |
|
| 221 | - $this->assertArrayHasKey('funcAfter2', $aProperties['*']['__after']); |
|
| 222 | - $this->assertArrayHasKey('funcAfter3', $aProperties['*']['__after']); |
|
| 223 | - $this->assertIsArray($aProperties['*']['__after']['funcAfter1']); |
|
| 224 | - $this->assertIsArray($aProperties['*']['__after']['funcAfter2']); |
|
| 225 | - $this->assertIsArray($aProperties['*']['__after']['funcAfter3']); |
|
| 226 | - |
|
| 227 | - $this->assertCount(3, $aProperties['*']['__di']); |
|
| 228 | - $this->assertArrayHasKey('colorService', $aProperties['*']['__di']); |
|
| 229 | - $this->assertArrayHasKey('textService', $aProperties['*']['__di']); |
|
| 230 | - $this->assertArrayHasKey('fontService', $aProperties['*']['__di']); |
|
| 231 | - $this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['*']['__di']['colorService']); |
|
| 232 | - $this->assertEquals('Jaxon\Annotations\Tests\Service\TextService', $aProperties['*']['__di']['textService']); |
|
| 233 | - $this->assertEquals('Jaxon\Annotations\Tests\App\Ajax\FontService', $aProperties['*']['__di']['fontService']); |
|
| 234 | - } |
|
| 235 | - |
|
| 236 | - /** |
|
| 189 | +public function testClassAnnotation() |
|
| 190 | +{ |
|
| 191 | +$xMetadata = $this->getAttributes(DocBlockClassAnnotated::class, []); |
|
| 192 | +// $this->assertEquals('', json_encode($aProperties)); |
|
| 193 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 194 | +$aProperties = $xMetadata->getProperties(); |
|
| 195 | + |
|
| 196 | +$this->assertFalse($bExcluded); |
|
| 197 | + |
|
| 198 | +$this->assertCount(1, $aProperties); |
|
| 199 | +$this->assertArrayHasKey('*', $aProperties); |
|
| 200 | +$this->assertCount(5, $aProperties['*']); |
|
| 201 | +$this->assertArrayHasKey('bags', $aProperties['*']); |
|
| 202 | +$this->assertArrayHasKey('callback', $aProperties['*']); |
|
| 203 | +$this->assertArrayHasKey('__before', $aProperties['*']); |
|
| 204 | +$this->assertArrayHasKey('__after', $aProperties['*']); |
|
| 205 | + |
|
| 206 | +$this->assertCount(2, $aProperties['*']['bags']); |
|
| 207 | +$this->assertEquals('user.name', $aProperties['*']['bags'][0]); |
|
| 208 | +$this->assertEquals('page.number', $aProperties['*']['bags'][1]); |
|
| 209 | + |
|
| 210 | +$this->assertIsArray($aProperties['*']['callback']); |
|
| 211 | +$this->assertEquals('jaxon.ajax.callback.test', $aProperties['*']['callback'][0]); |
|
| 212 | + |
|
| 213 | +$this->assertCount(2, $aProperties['*']['__before']); |
|
| 214 | +$this->assertArrayHasKey('funcBefore1', $aProperties['*']['__before']); |
|
| 215 | +$this->assertArrayHasKey('funcBefore2', $aProperties['*']['__before']); |
|
| 216 | +$this->assertIsArray($aProperties['*']['__before']['funcBefore1']); |
|
| 217 | +$this->assertIsArray($aProperties['*']['__before']['funcBefore2']); |
|
| 218 | + |
|
| 219 | +$this->assertCount(3, $aProperties['*']['__after']); |
|
| 220 | +$this->assertArrayHasKey('funcAfter1', $aProperties['*']['__after']); |
|
| 221 | +$this->assertArrayHasKey('funcAfter2', $aProperties['*']['__after']); |
|
| 222 | +$this->assertArrayHasKey('funcAfter3', $aProperties['*']['__after']); |
|
| 223 | +$this->assertIsArray($aProperties['*']['__after']['funcAfter1']); |
|
| 224 | +$this->assertIsArray($aProperties['*']['__after']['funcAfter2']); |
|
| 225 | +$this->assertIsArray($aProperties['*']['__after']['funcAfter3']); |
|
| 226 | + |
|
| 227 | +$this->assertCount(3, $aProperties['*']['__di']); |
|
| 228 | +$this->assertArrayHasKey('colorService', $aProperties['*']['__di']); |
|
| 229 | +$this->assertArrayHasKey('textService', $aProperties['*']['__di']); |
|
| 230 | +$this->assertArrayHasKey('fontService', $aProperties['*']['__di']); |
|
| 231 | +$this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['*']['__di']['colorService']); |
|
| 232 | +$this->assertEquals('Jaxon\Annotations\Tests\Service\TextService', $aProperties['*']['__di']['textService']); |
|
| 233 | +$this->assertEquals('Jaxon\Annotations\Tests\App\Ajax\FontService', $aProperties['*']['__di']['fontService']); |
|
| 234 | +} |
|
| 235 | + |
|
| 236 | +/** |
|
| 237 | 237 | * @throws SetupException |
| 238 | 238 | */ |
| 239 | - public function testClassExcludeAnnotation() |
|
| 240 | - { |
|
| 241 | - $xMetadata = $this->getAttributes(DocBlockClassExcluded::class, |
|
| 242 | - ['doNot', 'withBags', 'cbSingle']); |
|
| 243 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 244 | - $aProperties = $xMetadata->getProperties(); |
|
| 245 | - $aProtected = $xMetadata->getProtectedMethods(); |
|
| 246 | - |
|
| 247 | - $this->assertTrue($bExcluded); |
|
| 248 | - $this->assertEmpty($aProperties); |
|
| 249 | - $this->assertEmpty($aProtected); |
|
| 250 | - } |
|
| 251 | - |
|
| 252 | - public function testUploadAnnotationErrorFieldName() |
|
| 253 | - { |
|
| 254 | - $this->expectException(SetupException::class); |
|
| 255 | - $this->getAttributes(DocBlockAnnotated::class, ['saveFileErrorFieldName']); |
|
| 256 | - } |
|
| 257 | - |
|
| 258 | - public function testUploadAnnotationErrorFieldNumber() |
|
| 259 | - { |
|
| 260 | - $this->expectException(SetupException::class); |
|
| 261 | - $this->getAttributes(DocBlockAnnotated::class, ['saveFileErrorFieldNumber']); |
|
| 262 | - } |
|
| 263 | - |
|
| 264 | - public function testDataBagAnnotationErrorName() |
|
| 265 | - { |
|
| 266 | - $this->expectException(SetupException::class); |
|
| 267 | - $this->getAttributes(DocBlockAnnotated::class, ['withBagsErrorName']); |
|
| 268 | - } |
|
| 269 | - |
|
| 270 | - public function testDataBagAnnotationErrorNumber() |
|
| 271 | - { |
|
| 272 | - $this->expectException(SetupException::class); |
|
| 273 | - $this->getAttributes(DocBlockAnnotated::class, ['withBagsErrorNumber']); |
|
| 274 | - } |
|
| 275 | - |
|
| 276 | - public function testContainerAnnotationErrorAttr() |
|
| 277 | - { |
|
| 278 | - $this->expectException(SetupException::class); |
|
| 279 | - $this->getAttributes(DocBlockAnnotated::class, ['diErrorAttr']); |
|
| 280 | - } |
|
| 281 | - |
|
| 282 | - public function testContainerAnnotationErrorClass() |
|
| 283 | - { |
|
| 284 | - $this->expectException(SetupException::class); |
|
| 285 | - $this->getAttributes(DocBlockAnnotated::class, ['diErrorClass']); |
|
| 286 | - } |
|
| 287 | - |
|
| 288 | - public function testContainerAnnotationErrorOneParam() |
|
| 289 | - { |
|
| 290 | - $this->expectException(SetupException::class); |
|
| 291 | - $this->getAttributes(DocBlockAnnotated::class, ['diErrorOneParam']); |
|
| 292 | - } |
|
| 293 | - |
|
| 294 | - public function testContainerAnnotationErrorThreeParams() |
|
| 295 | - { |
|
| 296 | - $this->expectException(SetupException::class); |
|
| 297 | - $this->getAttributes(DocBlockAnnotated::class, ['diErrorThreeParams']); |
|
| 298 | - } |
|
| 299 | - |
|
| 300 | - public function testCbBeforeAnnotationErrorName() |
|
| 301 | - { |
|
| 302 | - $this->expectException(SetupException::class); |
|
| 303 | - $this->getAttributes(DocBlockAnnotated::class, ['cbBeforeErrorName']); |
|
| 304 | - } |
|
| 305 | - |
|
| 306 | - public function testCbBeforeAnnotationErrorParam() |
|
| 307 | - { |
|
| 308 | - $this->expectException(SetupException::class); |
|
| 309 | - $this->getAttributes(DocBlockAnnotated::class, ['cbBeforeErrorParam']); |
|
| 310 | - } |
|
| 311 | - |
|
| 312 | - public function testCbBeforeAnnotationErrorNumber() |
|
| 313 | - { |
|
| 314 | - $this->expectException(SetupException::class); |
|
| 315 | - $this->getAttributes(DocBlockAnnotated::class, ['cbBeforeErrorNumber']); |
|
| 316 | - } |
|
| 317 | - |
|
| 318 | - public function testCbAfterAnnotationErrorName() |
|
| 319 | - { |
|
| 320 | - $this->expectException(SetupException::class); |
|
| 321 | - $this->getAttributes(DocBlockAnnotated::class, ['cbAfterErrorName']); |
|
| 322 | - } |
|
| 323 | - |
|
| 324 | - public function testCbAfterAnnotationErrorParam() |
|
| 325 | - { |
|
| 326 | - $this->expectException(SetupException::class); |
|
| 327 | - $this->getAttributes(DocBlockAnnotated::class, ['cbAfterErrorParam']); |
|
| 328 | - } |
|
| 329 | - |
|
| 330 | - public function testCbAfterAnnotationErrorNumber() |
|
| 331 | - { |
|
| 332 | - $this->expectException(SetupException::class); |
|
| 333 | - $this->getAttributes(DocBlockAnnotated::class, ['cbAfterErrorNumber']); |
|
| 334 | - } |
|
| 239 | +public function testClassExcludeAnnotation() |
|
| 240 | +{ |
|
| 241 | +$xMetadata = $this->getAttributes(DocBlockClassExcluded::class, |
|
| 242 | +['doNot', 'withBags', 'cbSingle']); |
|
| 243 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 244 | +$aProperties = $xMetadata->getProperties(); |
|
| 245 | +$aProtected = $xMetadata->getProtectedMethods(); |
|
| 246 | + |
|
| 247 | +$this->assertTrue($bExcluded); |
|
| 248 | +$this->assertEmpty($aProperties); |
|
| 249 | +$this->assertEmpty($aProtected); |
|
| 250 | +} |
|
| 251 | + |
|
| 252 | +public function testUploadAnnotationErrorFieldName() |
|
| 253 | +{ |
|
| 254 | +$this->expectException(SetupException::class); |
|
| 255 | +$this->getAttributes(DocBlockAnnotated::class, ['saveFileErrorFieldName']); |
|
| 256 | +} |
|
| 257 | + |
|
| 258 | +public function testUploadAnnotationErrorFieldNumber() |
|
| 259 | +{ |
|
| 260 | +$this->expectException(SetupException::class); |
|
| 261 | +$this->getAttributes(DocBlockAnnotated::class, ['saveFileErrorFieldNumber']); |
|
| 262 | +} |
|
| 263 | + |
|
| 264 | +public function testDataBagAnnotationErrorName() |
|
| 265 | +{ |
|
| 266 | +$this->expectException(SetupException::class); |
|
| 267 | +$this->getAttributes(DocBlockAnnotated::class, ['withBagsErrorName']); |
|
| 268 | +} |
|
| 269 | + |
|
| 270 | +public function testDataBagAnnotationErrorNumber() |
|
| 271 | +{ |
|
| 272 | +$this->expectException(SetupException::class); |
|
| 273 | +$this->getAttributes(DocBlockAnnotated::class, ['withBagsErrorNumber']); |
|
| 274 | +} |
|
| 275 | + |
|
| 276 | +public function testContainerAnnotationErrorAttr() |
|
| 277 | +{ |
|
| 278 | +$this->expectException(SetupException::class); |
|
| 279 | +$this->getAttributes(DocBlockAnnotated::class, ['diErrorAttr']); |
|
| 280 | +} |
|
| 281 | + |
|
| 282 | +public function testContainerAnnotationErrorClass() |
|
| 283 | +{ |
|
| 284 | +$this->expectException(SetupException::class); |
|
| 285 | +$this->getAttributes(DocBlockAnnotated::class, ['diErrorClass']); |
|
| 286 | +} |
|
| 287 | + |
|
| 288 | +public function testContainerAnnotationErrorOneParam() |
|
| 289 | +{ |
|
| 290 | +$this->expectException(SetupException::class); |
|
| 291 | +$this->getAttributes(DocBlockAnnotated::class, ['diErrorOneParam']); |
|
| 292 | +} |
|
| 293 | + |
|
| 294 | +public function testContainerAnnotationErrorThreeParams() |
|
| 295 | +{ |
|
| 296 | +$this->expectException(SetupException::class); |
|
| 297 | +$this->getAttributes(DocBlockAnnotated::class, ['diErrorThreeParams']); |
|
| 298 | +} |
|
| 299 | + |
|
| 300 | +public function testCbBeforeAnnotationErrorName() |
|
| 301 | +{ |
|
| 302 | +$this->expectException(SetupException::class); |
|
| 303 | +$this->getAttributes(DocBlockAnnotated::class, ['cbBeforeErrorName']); |
|
| 304 | +} |
|
| 305 | + |
|
| 306 | +public function testCbBeforeAnnotationErrorParam() |
|
| 307 | +{ |
|
| 308 | +$this->expectException(SetupException::class); |
|
| 309 | +$this->getAttributes(DocBlockAnnotated::class, ['cbBeforeErrorParam']); |
|
| 310 | +} |
|
| 311 | + |
|
| 312 | +public function testCbBeforeAnnotationErrorNumber() |
|
| 313 | +{ |
|
| 314 | +$this->expectException(SetupException::class); |
|
| 315 | +$this->getAttributes(DocBlockAnnotated::class, ['cbBeforeErrorNumber']); |
|
| 316 | +} |
|
| 317 | + |
|
| 318 | +public function testCbAfterAnnotationErrorName() |
|
| 319 | +{ |
|
| 320 | +$this->expectException(SetupException::class); |
|
| 321 | +$this->getAttributes(DocBlockAnnotated::class, ['cbAfterErrorName']); |
|
| 322 | +} |
|
| 323 | + |
|
| 324 | +public function testCbAfterAnnotationErrorParam() |
|
| 325 | +{ |
|
| 326 | +$this->expectException(SetupException::class); |
|
| 327 | +$this->getAttributes(DocBlockAnnotated::class, ['cbAfterErrorParam']); |
|
| 328 | +} |
|
| 329 | + |
|
| 330 | +public function testCbAfterAnnotationErrorNumber() |
|
| 331 | +{ |
|
| 332 | +$this->expectException(SetupException::class); |
|
| 333 | +$this->getAttributes(DocBlockAnnotated::class, ['cbAfterErrorNumber']); |
|
| 334 | +} |
|
| 335 | 335 | } |
@@ -6,18 +6,18 @@ |
||
| 6 | 6 | |
| 7 | 7 | trait Annotated |
| 8 | 8 | { |
| 9 | - /** |
|
| 9 | +/** |
|
| 10 | 10 | * @var \Jaxon\Annotations\Tests\Service\ColorService |
| 11 | 11 | */ |
| 12 | - protected $colorService; |
|
| 12 | +protected $colorService; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 14 | +/** |
|
| 15 | 15 | * @var TextService |
| 16 | 16 | */ |
| 17 | - protected $textService; |
|
| 17 | +protected $textService; |
|
| 18 | 18 | |
| 19 | - /** |
|
| 19 | +/** |
|
| 20 | 20 | * @var FontService |
| 21 | 21 | */ |
| 22 | - protected $fontService; |
|
| 22 | +protected $fontService; |
|
| 23 | 23 | } |
@@ -21,18 +21,18 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class ClassAnnotated extends FuncComponent |
| 23 | 23 | { |
| 24 | - /** |
|
| 24 | +/** |
|
| 25 | 25 | * @var \Jaxon\Annotations\Tests\Service\ColorService |
| 26 | 26 | */ |
| 27 | - protected $colorService; |
|
| 27 | +protected $colorService; |
|
| 28 | 28 | |
| 29 | - /** |
|
| 29 | +/** |
|
| 30 | 30 | * @var TextService |
| 31 | 31 | */ |
| 32 | - protected $textService; |
|
| 32 | +protected $textService; |
|
| 33 | 33 | |
| 34 | - /** |
|
| 34 | +/** |
|
| 35 | 35 | * @var FontService |
| 36 | 36 | */ |
| 37 | - protected $fontService; |
|
| 37 | +protected $fontService; |
|
| 38 | 38 | } |
@@ -9,26 +9,26 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class DocBlockClassExcluded extends FuncComponent |
| 11 | 11 | { |
| 12 | - /** |
|
| 12 | +/** |
|
| 13 | 13 | * @exclude |
| 14 | 14 | */ |
| 15 | - public function doNot() |
|
| 16 | - { |
|
| 17 | - } |
|
| 15 | +public function doNot() |
|
| 16 | +{ |
|
| 17 | +} |
|
| 18 | 18 | |
| 19 | - /** |
|
| 19 | +/** |
|
| 20 | 20 | * @databag user.name |
| 21 | 21 | * @databag page.number |
| 22 | 22 | */ |
| 23 | - public function withBags() |
|
| 24 | - { |
|
| 25 | - } |
|
| 23 | +public function withBags() |
|
| 24 | +{ |
|
| 25 | +} |
|
| 26 | 26 | |
| 27 | - /** |
|
| 27 | +/** |
|
| 28 | 28 | * @before funcBefore |
| 29 | 29 | * @after funcAfter |
| 30 | 30 | */ |
| 31 | - public function cbSingle() |
|
| 32 | - { |
|
| 33 | - } |
|
| 31 | +public function cbSingle() |
|
| 32 | +{ |
|
| 33 | +} |
|
| 34 | 34 | } |
@@ -6,38 +6,38 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CallbackError extends FuncComponent |
| 8 | 8 | {
|
| 9 | - /** |
|
| 9 | +/** |
|
| 10 | 10 | * @callback |
| 11 | 11 | */ |
| 12 | - public function noName() |
|
| 13 | - {
|
|
| 14 | - } |
|
| 12 | +public function noName() |
|
| 13 | +{
|
|
| 14 | +} |
|
| 15 | 15 | |
| 16 | - /** |
|
| 16 | +/** |
|
| 17 | 17 | * @callback('name' => [])
|
| 18 | 18 | */ |
| 19 | - public function wrongNameType() |
|
| 20 | - {
|
|
| 21 | - } |
|
| 19 | +public function wrongNameType() |
|
| 20 | +{
|
|
| 21 | +} |
|
| 22 | 22 | |
| 23 | - /** |
|
| 23 | +/** |
|
| 24 | 24 | * @callback('class' => 'jaxon.ajax.callback.test')
|
| 25 | 25 | */ |
| 26 | - public function wrongNameAttr() |
|
| 27 | - {
|
|
| 28 | - } |
|
| 26 | +public function wrongNameAttr() |
|
| 27 | +{
|
|
| 28 | +} |
|
| 29 | 29 | |
| 30 | - /** |
|
| 30 | +/** |
|
| 31 | 31 | * @callback('name' => 'jaxon.ajax callback.test')
|
| 32 | 32 | */ |
| 33 | - public function nameWithSpace() |
|
| 34 | - {
|
|
| 35 | - } |
|
| 33 | +public function nameWithSpace() |
|
| 34 | +{
|
|
| 35 | +} |
|
| 36 | 36 | |
| 37 | - /** |
|
| 37 | +/** |
|
| 38 | 38 | * @callback('class' => '12jaxon.ajax.callback.test')
|
| 39 | 39 | */ |
| 40 | - public function startWithInt() |
|
| 41 | - {
|
|
| 42 | - } |
|
| 40 | +public function startWithInt() |
|
| 41 | +{
|
|
| 42 | +} |
|
| 43 | 43 | } |
@@ -9,26 +9,26 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class ClassExcluded extends FuncComponent |
| 11 | 11 | { |
| 12 | - /** |
|
| 12 | +/** |
|
| 13 | 13 | * @exclude |
| 14 | 14 | */ |
| 15 | - public function doNot() |
|
| 16 | - { |
|
| 17 | - } |
|
| 15 | +public function doNot() |
|
| 16 | +{ |
|
| 17 | +} |
|
| 18 | 18 | |
| 19 | - /** |
|
| 19 | +/** |
|
| 20 | 20 | * @databag('name' => 'user.name') |
| 21 | 21 | * @databag('name' => 'page.number') |
| 22 | 22 | */ |
| 23 | - public function withBags() |
|
| 24 | - { |
|
| 25 | - } |
|
| 23 | +public function withBags() |
|
| 24 | +{ |
|
| 25 | +} |
|
| 26 | 26 | |
| 27 | - /** |
|
| 27 | +/** |
|
| 28 | 28 | * @before('call' => 'funcBefore') |
| 29 | 29 | * @after('call' => 'funcAfter') |
| 30 | 30 | */ |
| 31 | - public function cbSingle() |
|
| 32 | - { |
|
| 33 | - } |
|
| 31 | +public function cbSingle() |
|
| 32 | +{ |
|
| 33 | +} |
|
| 34 | 34 | } |
@@ -7,176 +7,176 @@ |
||
| 7 | 7 | |
| 8 | 8 | class Annotated extends FuncComponent |
| 9 | 9 | { |
| 10 | - /** |
|
| 10 | +/** |
|
| 11 | 11 | * @exclude |
| 12 | 12 | */ |
| 13 | - public function doNot() |
|
| 14 | - { |
|
| 15 | - } |
|
| 13 | +public function doNot() |
|
| 14 | +{ |
|
| 15 | +} |
|
| 16 | 16 | |
| 17 | - /** |
|
| 17 | +/** |
|
| 18 | 18 | * @exclude(true) |
| 19 | 19 | */ |
| 20 | - public function doNotBool() |
|
| 21 | - { |
|
| 22 | - } |
|
| 20 | +public function doNotBool() |
|
| 21 | +{ |
|
| 22 | +} |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | +/** |
|
| 25 | 25 | * @exclude('Me') |
| 26 | 26 | */ |
| 27 | - public function doNotError() |
|
| 28 | - { |
|
| 29 | - } |
|
| 27 | +public function doNotError() |
|
| 28 | +{ |
|
| 29 | +} |
|
| 30 | 30 | |
| 31 | - /** |
|
| 31 | +/** |
|
| 32 | 32 | * @databag('name' => 'user.name') |
| 33 | 33 | * @databag('name' => 'page.number') |
| 34 | 34 | */ |
| 35 | - public function withBags() |
|
| 36 | - { |
|
| 37 | - } |
|
| 35 | +public function withBags() |
|
| 36 | +{ |
|
| 37 | +} |
|
| 38 | 38 | |
| 39 | - /** |
|
| 39 | +/** |
|
| 40 | 40 | * @databag('mane' => 'user.name') |
| 41 | 41 | * @databag('mane' => 'page.number') |
| 42 | 42 | */ |
| 43 | - public function withBagsError() |
|
| 44 | - { |
|
| 45 | - } |
|
| 43 | +public function withBagsError() |
|
| 44 | +{ |
|
| 45 | +} |
|
| 46 | 46 | |
| 47 | - /** |
|
| 47 | +/** |
|
| 48 | 48 | * @upload('field' => 'user-files') |
| 49 | 49 | */ |
| 50 | - public function saveFiles() |
|
| 51 | - { |
|
| 52 | - } |
|
| 50 | +public function saveFiles() |
|
| 51 | +{ |
|
| 52 | +} |
|
| 53 | 53 | |
| 54 | - /** |
|
| 54 | +/** |
|
| 55 | 55 | * @upload('name' => 'user-files') |
| 56 | 56 | */ |
| 57 | - public function saveFilesWrongName() |
|
| 58 | - { |
|
| 59 | - } |
|
| 57 | +public function saveFilesWrongName() |
|
| 58 | +{ |
|
| 59 | +} |
|
| 60 | 60 | |
| 61 | - /** |
|
| 61 | +/** |
|
| 62 | 62 | * @upload('field' => 'user-file1') |
| 63 | 63 | * @upload('field' => 'user-file2') |
| 64 | 64 | */ |
| 65 | - public function saveFilesMultiple() |
|
| 66 | - { |
|
| 67 | - } |
|
| 65 | +public function saveFilesMultiple() |
|
| 66 | +{ |
|
| 67 | +} |
|
| 68 | 68 | |
| 69 | - /** |
|
| 69 | +/** |
|
| 70 | 70 | * @before('call' => 'funcBefore') |
| 71 | 71 | * @after('call' => 'funcAfter') |
| 72 | 72 | */ |
| 73 | - public function cbSingle() |
|
| 74 | - { |
|
| 75 | - } |
|
| 73 | +public function cbSingle() |
|
| 74 | +{ |
|
| 75 | +} |
|
| 76 | 76 | |
| 77 | - /** |
|
| 77 | +/** |
|
| 78 | 78 | * @before('call' => 'funcBefore1') |
| 79 | 79 | * @before('call' => 'funcBefore2') |
| 80 | 80 | * @after('call' => 'funcAfter1') |
| 81 | 81 | * @after('call' => 'funcAfter2') |
| 82 | 82 | * @after('call' => 'funcAfter3') |
| 83 | 83 | */ |
| 84 | - public function cbMultiple() |
|
| 85 | - { |
|
| 86 | - } |
|
| 84 | +public function cbMultiple() |
|
| 85 | +{ |
|
| 86 | +} |
|
| 87 | 87 | |
| 88 | - /** |
|
| 88 | +/** |
|
| 89 | 89 | * @before('call' => 'funcBefore1', 'with' => ['param1']) |
| 90 | 90 | * @before('call' => 'funcBefore2', 'with' => ['param1', 'param2']) |
| 91 | 91 | * @after('call' => 'funcAfter1', 'with' => ['param1', 'param2']) |
| 92 | 92 | */ |
| 93 | - public function cbParams() |
|
| 94 | - { |
|
| 95 | - } |
|
| 93 | +public function cbParams() |
|
| 94 | +{ |
|
| 95 | +} |
|
| 96 | 96 | |
| 97 | - /** |
|
| 97 | +/** |
|
| 98 | 98 | * @di('attr' => 'colorService', 'class' => 'ColorService') |
| 99 | 99 | * @di('attr' => 'fontService', 'class' => 'FontService') |
| 100 | 100 | */ |
| 101 | - public function di1() |
|
| 102 | - { |
|
| 103 | - } |
|
| 101 | +public function di1() |
|
| 102 | +{ |
|
| 103 | +} |
|
| 104 | 104 | |
| 105 | - /** |
|
| 105 | +/** |
|
| 106 | 106 | * @di('attr' => 'colorService', 'class' => 'ColorService') |
| 107 | 107 | * @di('attr' => 'textService', 'class' => '\Jaxon\Annotations\Tests\Service\TextService') |
| 108 | 108 | */ |
| 109 | - public function di2() |
|
| 110 | - { |
|
| 111 | - } |
|
| 109 | +public function di2() |
|
| 110 | +{ |
|
| 111 | +} |
|
| 112 | 112 | |
| 113 | - /** |
|
| 113 | +/** |
|
| 114 | 114 | * @before('name' => 'funcBefore', 'with' => ['param1']) |
| 115 | 115 | */ |
| 116 | - public function cbBeforeNoCall() |
|
| 117 | - { |
|
| 118 | - } |
|
| 116 | +public function cbBeforeNoCall() |
|
| 117 | +{ |
|
| 118 | +} |
|
| 119 | 119 | |
| 120 | - /** |
|
| 120 | +/** |
|
| 121 | 121 | * @before('call' => 'funcBefore', 'params' => ['param1']) |
| 122 | 122 | */ |
| 123 | - public function cbBeforeUnknownAttr() |
|
| 124 | - { |
|
| 125 | - } |
|
| 123 | +public function cbBeforeUnknownAttr() |
|
| 124 | +{ |
|
| 125 | +} |
|
| 126 | 126 | |
| 127 | - /** |
|
| 127 | +/** |
|
| 128 | 128 | * @before('call' => 'funcBefore', 'with' => 'param1') |
| 129 | 129 | */ |
| 130 | - public function cbBeforeWrongAttrType() |
|
| 131 | - { |
|
| 132 | - } |
|
| 130 | +public function cbBeforeWrongAttrType() |
|
| 131 | +{ |
|
| 132 | +} |
|
| 133 | 133 | |
| 134 | - /** |
|
| 134 | +/** |
|
| 135 | 135 | * @after('name' => 'funcAfter', 'with' => ['param1']) |
| 136 | 136 | */ |
| 137 | - public function cbAfterNoCall() |
|
| 138 | - { |
|
| 139 | - } |
|
| 137 | +public function cbAfterNoCall() |
|
| 138 | +{ |
|
| 139 | +} |
|
| 140 | 140 | |
| 141 | - /** |
|
| 141 | +/** |
|
| 142 | 142 | * @after('call' => 'funcAfter', 'params' => ['param1']) |
| 143 | 143 | */ |
| 144 | - public function cbAfterUnknownAttr() |
|
| 145 | - { |
|
| 146 | - } |
|
| 144 | +public function cbAfterUnknownAttr() |
|
| 145 | +{ |
|
| 146 | +} |
|
| 147 | 147 | |
| 148 | - /** |
|
| 148 | +/** |
|
| 149 | 149 | * @after('call' => 'funcAfter', 'with' => true) |
| 150 | 150 | */ |
| 151 | - public function cbAfterWrongAttrType() |
|
| 152 | - { |
|
| 153 | - } |
|
| 151 | +public function cbAfterWrongAttrType() |
|
| 152 | +{ |
|
| 153 | +} |
|
| 154 | 154 | |
| 155 | - /** |
|
| 155 | +/** |
|
| 156 | 156 | * @di('attr' => 'attr', 'params' => '') |
| 157 | 157 | */ |
| 158 | - public function diUnknownAttr() |
|
| 159 | - { |
|
| 160 | - } |
|
| 158 | +public function diUnknownAttr() |
|
| 159 | +{ |
|
| 160 | +} |
|
| 161 | 161 | |
| 162 | - /** |
|
| 162 | +/** |
|
| 163 | 163 | * @di('attr' => [], 'class' => 'ClassName') |
| 164 | 164 | */ |
| 165 | - public function diWrongAttrType() |
|
| 166 | - { |
|
| 167 | - } |
|
| 165 | +public function diWrongAttrType() |
|
| 166 | +{ |
|
| 167 | +} |
|
| 168 | 168 | |
| 169 | - /** |
|
| 169 | +/** |
|
| 170 | 170 | * @di('attr' => 'attr', 'class' => true) |
| 171 | 171 | */ |
| 172 | - public function diWrongClassType() |
|
| 173 | - { |
|
| 174 | - } |
|
| 172 | +public function diWrongClassType() |
|
| 173 | +{ |
|
| 174 | +} |
|
| 175 | 175 | |
| 176 | - /** |
|
| 176 | +/** |
|
| 177 | 177 | * @di('attr' => 'attr', 'class' => 'ClassName', 'name' => 'di') |
| 178 | 178 | */ |
| 179 | - public function diWrongVarCount() |
|
| 180 | - { |
|
| 181 | - } |
|
| 179 | +public function diWrongVarCount() |
|
| 180 | +{ |
|
| 181 | +} |
|
| 182 | 182 | } |
@@ -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 | } |