@@ -26,41 +26,41 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | class ExportAnnotation extends AbstractAnnotation |
| 28 | 28 | { |
| 29 | - /** |
|
| 29 | +/** |
|
| 30 | 30 | * @var array |
| 31 | 31 | */ |
| 32 | - private $aMethods = []; |
|
| 32 | +private $aMethods = []; |
|
| 33 | 33 | |
| 34 | - /** |
|
| 34 | +/** |
|
| 35 | 35 | * @inheritDoc |
| 36 | 36 | */ |
| 37 | - public static function parseAnnotation($value) |
|
| 38 | - { |
|
| 39 | - $aParams = json_decode($value, true); |
|
| 40 | - return is_array($aParams) ? $aParams : []; |
|
| 41 | - } |
|
| 37 | +public static function parseAnnotation($value) |
|
| 38 | +{ |
|
| 39 | +$aParams = json_decode($value, true); |
|
| 40 | +return is_array($aParams) ? $aParams : []; |
|
| 41 | +} |
|
| 42 | 42 | |
| 43 | - /** |
|
| 43 | +/** |
|
| 44 | 44 | * @inheritDoc |
| 45 | 45 | * @throws AnnotationException |
| 46 | 46 | */ |
| 47 | - public function initAnnotation(array $properties) |
|
| 48 | - { |
|
| 49 | - foreach(['base', 'only', 'except'] as $key) |
|
| 50 | - { |
|
| 51 | - if(isset($properties[$key]) && is_array($properties[$key]) && |
|
| 52 | - count($properties[$key]) > 0) |
|
| 53 | - { |
|
| 54 | - $this->aMethods[$key] = $properties[$key]; |
|
| 55 | - } |
|
| 56 | - } |
|
| 57 | - } |
|
| 47 | +public function initAnnotation(array $properties) |
|
| 48 | +{ |
|
| 49 | +foreach(['base', 'only', 'except'] as $key) |
|
| 50 | +{ |
|
| 51 | +if(isset($properties[$key]) && is_array($properties[$key]) && |
|
| 52 | + count($properties[$key]) > 0) |
|
| 53 | +{ |
|
| 54 | + $this->aMethods[$key] = $properties[$key]; |
|
| 55 | +} |
|
| 56 | +} |
|
| 57 | +} |
|
| 58 | 58 | |
| 59 | - /** |
|
| 59 | +/** |
|
| 60 | 60 | * @inheritDoc |
| 61 | 61 | */ |
| 62 | - public function saveValue(Metadata $xMetadata, string $sMethod = '*'): void |
|
| 63 | - { |
|
| 64 | - $xMetadata->export($sMethod)->setMethods($this->aMethods); |
|
| 65 | - } |
|
| 62 | +public function saveValue(Metadata $xMetadata, string $sMethod = '*'): void |
|
| 63 | +{ |
|
| 64 | +$xMetadata->export($sMethod)->setMethods($this->aMethods); |
|
| 65 | +} |
|
| 66 | 66 | } |
@@ -46,9 +46,9 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | public function initAnnotation(array $properties) |
| 48 | 48 | { |
| 49 | - foreach(['base', 'only', 'except'] as $key) |
|
| 49 | + foreach (['base', 'only', 'except'] as $key) |
|
| 50 | 50 | { |
| 51 | - if(isset($properties[$key]) && is_array($properties[$key]) && |
|
| 51 | + if (isset($properties[$key]) && is_array($properties[$key]) && |
|
| 52 | 52 | count($properties[$key]) > 0) |
| 53 | 53 | { |
| 54 | 54 | $this->aMethods[$key] = $properties[$key]; |
@@ -14,346 +14,346 @@ |
||
| 14 | 14 | |
| 15 | 15 | class ExtendAnnotationTest extends TestCase |
| 16 | 16 | { |
| 17 | - use AnnotationTrait; |
|
| 17 | +use AnnotationTrait; |
|
| 18 | 18 | |
| 19 | - /** |
|
| 19 | +/** |
|
| 20 | 20 | * @var string |
| 21 | 21 | */ |
| 22 | - protected $sCacheDir; |
|
| 22 | +protected $sCacheDir; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 24 | +/** |
|
| 25 | 25 | * @throws SetupException |
| 26 | 26 | */ |
| 27 | - public function setUp(): void |
|
| 28 | - { |
|
| 29 | - $this->sCacheDir = __DIR__ . '/../tmp'; |
|
| 30 | - @mkdir($this->sCacheDir); |
|
| 27 | +public function setUp(): void |
|
| 28 | +{ |
|
| 29 | +$this->sCacheDir = __DIR__ . '/../tmp'; |
|
| 30 | +@mkdir($this->sCacheDir); |
|
| 31 | 31 | |
| 32 | - jaxon()->di()->getPluginManager()->registerPlugins(); |
|
| 33 | - _register(); |
|
| 32 | +jaxon()->di()->getPluginManager()->registerPlugins(); |
|
| 33 | +_register(); |
|
| 34 | 34 | |
| 35 | - jaxon()->di()->val('jaxon_annotations_cache_dir', $this->sCacheDir); |
|
| 36 | - } |
|
| 35 | +jaxon()->di()->val('jaxon_annotations_cache_dir', $this->sCacheDir); |
|
| 36 | +} |
|
| 37 | 37 | |
| 38 | - /** |
|
| 38 | +/** |
|
| 39 | 39 | * @throws SetupException |
| 40 | 40 | */ |
| 41 | - public function tearDown(): void |
|
| 42 | - { |
|
| 43 | - jaxon()->reset(); |
|
| 44 | - parent::tearDown(); |
|
| 45 | - |
|
| 46 | - // Delete the temp dir and all its content |
|
| 47 | - $aFiles = scandir($this->sCacheDir); |
|
| 48 | - foreach ($aFiles as $sFile) |
|
| 49 | - { |
|
| 50 | - if($sFile !== '.' && $sFile !== '..') |
|
| 51 | - { |
|
| 52 | - @unlink($this->sCacheDir . DIRECTORY_SEPARATOR . $sFile); |
|
| 53 | - } |
|
| 54 | - } |
|
| 55 | - @rmdir($this->sCacheDir); |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - /** |
|
| 41 | +public function tearDown(): void |
|
| 42 | +{ |
|
| 43 | +jaxon()->reset(); |
|
| 44 | +parent::tearDown(); |
|
| 45 | + |
|
| 46 | +// Delete the temp dir and all its content |
|
| 47 | +$aFiles = scandir($this->sCacheDir); |
|
| 48 | +foreach ($aFiles as $sFile) |
|
| 49 | +{ |
|
| 50 | +if($sFile !== '.' && $sFile !== '..') |
|
| 51 | +{ |
|
| 52 | + @unlink($this->sCacheDir . DIRECTORY_SEPARATOR . $sFile); |
|
| 53 | +} |
|
| 54 | +} |
|
| 55 | +@rmdir($this->sCacheDir); |
|
| 56 | +} |
|
| 57 | + |
|
| 58 | +/** |
|
| 59 | 59 | * @throws SetupException |
| 60 | 60 | */ |
| 61 | - public function testUploadAndExcludeAnnotation() |
|
| 62 | - { |
|
| 63 | - $xMetadata = $this->getAttributes(ExtendAnnotated::class, ['saveFiles', 'doNot']); |
|
| 64 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 65 | - $aProperties = $xMetadata->getProperties(); |
|
| 66 | - $aProtected = $xMetadata->getProtectedMethods(); |
|
| 61 | +public function testUploadAndExcludeAnnotation() |
|
| 62 | +{ |
|
| 63 | +$xMetadata = $this->getAttributes(ExtendAnnotated::class, ['saveFiles', 'doNot']); |
|
| 64 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 65 | +$aProperties = $xMetadata->getProperties(); |
|
| 66 | +$aProtected = $xMetadata->getProtectedMethods(); |
|
| 67 | 67 | |
| 68 | - $this->assertFalse($bExcluded); |
|
| 68 | +$this->assertFalse($bExcluded); |
|
| 69 | 69 | |
| 70 | - $this->assertCount(1, $aProperties); |
|
| 71 | - $this->assertArrayHasKey('saveFiles', $aProperties); |
|
| 72 | - $this->assertCount(1, $aProperties['saveFiles']); |
|
| 73 | - $this->assertEquals("'user-files'", $aProperties['saveFiles']['upload']); |
|
| 70 | +$this->assertCount(1, $aProperties); |
|
| 71 | +$this->assertArrayHasKey('saveFiles', $aProperties); |
|
| 72 | +$this->assertCount(1, $aProperties['saveFiles']); |
|
| 73 | +$this->assertEquals("'user-files'", $aProperties['saveFiles']['upload']); |
|
| 74 | 74 | |
| 75 | - $this->assertCount(1, $aProtected); |
|
| 76 | - $this->assertEquals('doNot', $aProtected[0]); |
|
| 77 | - } |
|
| 75 | +$this->assertCount(1, $aProtected); |
|
| 76 | +$this->assertEquals('doNot', $aProtected[0]); |
|
| 77 | +} |
|
| 78 | 78 | |
| 79 | - /** |
|
| 79 | +/** |
|
| 80 | 80 | * @throws SetupException |
| 81 | 81 | */ |
| 82 | - public function testDatabagAnnotation() |
|
| 83 | - { |
|
| 84 | - $xMetadata = $this->getAttributes(ExtendAnnotated::class, ['withBags']); |
|
| 85 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 86 | - $aProperties = $xMetadata->getProperties(); |
|
| 87 | - |
|
| 88 | - $this->assertFalse($bExcluded); |
|
| 89 | - |
|
| 90 | - $this->assertCount(1, $aProperties); |
|
| 91 | - $this->assertArrayHasKey('withBags', $aProperties); |
|
| 92 | - $this->assertCount(1, $aProperties['withBags']); |
|
| 93 | - $this->assertCount(2, $aProperties['withBags']['bags']); |
|
| 94 | - $this->assertEquals('user.name', $aProperties['withBags']['bags'][0]); |
|
| 95 | - $this->assertEquals('page.number', $aProperties['withBags']['bags'][1]); |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - /** |
|
| 82 | +public function testDatabagAnnotation() |
|
| 83 | +{ |
|
| 84 | +$xMetadata = $this->getAttributes(ExtendAnnotated::class, ['withBags']); |
|
| 85 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 86 | +$aProperties = $xMetadata->getProperties(); |
|
| 87 | + |
|
| 88 | +$this->assertFalse($bExcluded); |
|
| 89 | + |
|
| 90 | +$this->assertCount(1, $aProperties); |
|
| 91 | +$this->assertArrayHasKey('withBags', $aProperties); |
|
| 92 | +$this->assertCount(1, $aProperties['withBags']); |
|
| 93 | +$this->assertCount(2, $aProperties['withBags']['bags']); |
|
| 94 | +$this->assertEquals('user.name', $aProperties['withBags']['bags'][0]); |
|
| 95 | +$this->assertEquals('page.number', $aProperties['withBags']['bags'][1]); |
|
| 96 | +} |
|
| 97 | + |
|
| 98 | +/** |
|
| 99 | 99 | * @throws SetupException |
| 100 | 100 | */ |
| 101 | - public function testServerCallbacksAnnotation() |
|
| 102 | - { |
|
| 103 | - $xMetadata = $this->getAttributes(ExtendAnnotated::class, |
|
| 104 | - ['cbSingle', 'cbMultiple', 'cbParams']); |
|
| 105 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 106 | - $aProperties = $xMetadata->getProperties(); |
|
| 107 | - |
|
| 108 | - $this->assertFalse($bExcluded); |
|
| 109 | - |
|
| 110 | - $this->assertCount(3, $aProperties); |
|
| 111 | - $this->assertArrayHasKey('cbSingle', $aProperties); |
|
| 112 | - $this->assertArrayHasKey('cbMultiple', $aProperties); |
|
| 113 | - $this->assertArrayHasKey('cbParams', $aProperties); |
|
| 114 | - |
|
| 115 | - $this->assertCount(1, $aProperties['cbSingle']['__before']); |
|
| 116 | - $this->assertCount(2, $aProperties['cbMultiple']['__before']); |
|
| 117 | - $this->assertCount(2, $aProperties['cbParams']['__before']); |
|
| 118 | - $this->assertArrayHasKey('funcBefore', $aProperties['cbSingle']['__before']); |
|
| 119 | - $this->assertArrayHasKey('funcBefore1', $aProperties['cbMultiple']['__before']); |
|
| 120 | - $this->assertArrayHasKey('funcBefore2', $aProperties['cbMultiple']['__before']); |
|
| 121 | - $this->assertArrayHasKey('funcBefore1', $aProperties['cbParams']['__before']); |
|
| 122 | - $this->assertArrayHasKey('funcBefore2', $aProperties['cbParams']['__before']); |
|
| 123 | - $this->assertIsArray($aProperties['cbSingle']['__before']['funcBefore']); |
|
| 124 | - $this->assertIsArray($aProperties['cbMultiple']['__before']['funcBefore1']); |
|
| 125 | - $this->assertIsArray($aProperties['cbMultiple']['__before']['funcBefore2']); |
|
| 126 | - $this->assertIsArray($aProperties['cbParams']['__before']['funcBefore1']); |
|
| 127 | - $this->assertIsArray($aProperties['cbParams']['__before']['funcBefore2']); |
|
| 128 | - |
|
| 129 | - $this->assertCount(1, $aProperties['cbSingle']['__after']); |
|
| 130 | - $this->assertCount(3, $aProperties['cbMultiple']['__after']); |
|
| 131 | - $this->assertCount(1, $aProperties['cbParams']['__after']); |
|
| 132 | - $this->assertArrayHasKey('funcAfter', $aProperties['cbSingle']['__after']); |
|
| 133 | - $this->assertArrayHasKey('funcAfter1', $aProperties['cbMultiple']['__after']); |
|
| 134 | - $this->assertArrayHasKey('funcAfter2', $aProperties['cbMultiple']['__after']); |
|
| 135 | - $this->assertArrayHasKey('funcAfter3', $aProperties['cbMultiple']['__after']); |
|
| 136 | - $this->assertArrayHasKey('funcAfter1', $aProperties['cbParams']['__after']); |
|
| 137 | - $this->assertIsArray($aProperties['cbSingle']['__after']['funcAfter']); |
|
| 138 | - $this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter1']); |
|
| 139 | - $this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter2']); |
|
| 140 | - $this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter3']); |
|
| 141 | - $this->assertIsArray($aProperties['cbParams']['__after']['funcAfter1']); |
|
| 142 | - } |
|
| 143 | - |
|
| 144 | - /** |
|
| 101 | +public function testServerCallbacksAnnotation() |
|
| 102 | +{ |
|
| 103 | +$xMetadata = $this->getAttributes(ExtendAnnotated::class, |
|
| 104 | +['cbSingle', 'cbMultiple', 'cbParams']); |
|
| 105 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 106 | +$aProperties = $xMetadata->getProperties(); |
|
| 107 | + |
|
| 108 | +$this->assertFalse($bExcluded); |
|
| 109 | + |
|
| 110 | +$this->assertCount(3, $aProperties); |
|
| 111 | +$this->assertArrayHasKey('cbSingle', $aProperties); |
|
| 112 | +$this->assertArrayHasKey('cbMultiple', $aProperties); |
|
| 113 | +$this->assertArrayHasKey('cbParams', $aProperties); |
|
| 114 | + |
|
| 115 | +$this->assertCount(1, $aProperties['cbSingle']['__before']); |
|
| 116 | +$this->assertCount(2, $aProperties['cbMultiple']['__before']); |
|
| 117 | +$this->assertCount(2, $aProperties['cbParams']['__before']); |
|
| 118 | +$this->assertArrayHasKey('funcBefore', $aProperties['cbSingle']['__before']); |
|
| 119 | +$this->assertArrayHasKey('funcBefore1', $aProperties['cbMultiple']['__before']); |
|
| 120 | +$this->assertArrayHasKey('funcBefore2', $aProperties['cbMultiple']['__before']); |
|
| 121 | +$this->assertArrayHasKey('funcBefore1', $aProperties['cbParams']['__before']); |
|
| 122 | +$this->assertArrayHasKey('funcBefore2', $aProperties['cbParams']['__before']); |
|
| 123 | +$this->assertIsArray($aProperties['cbSingle']['__before']['funcBefore']); |
|
| 124 | +$this->assertIsArray($aProperties['cbMultiple']['__before']['funcBefore1']); |
|
| 125 | +$this->assertIsArray($aProperties['cbMultiple']['__before']['funcBefore2']); |
|
| 126 | +$this->assertIsArray($aProperties['cbParams']['__before']['funcBefore1']); |
|
| 127 | +$this->assertIsArray($aProperties['cbParams']['__before']['funcBefore2']); |
|
| 128 | + |
|
| 129 | +$this->assertCount(1, $aProperties['cbSingle']['__after']); |
|
| 130 | +$this->assertCount(3, $aProperties['cbMultiple']['__after']); |
|
| 131 | +$this->assertCount(1, $aProperties['cbParams']['__after']); |
|
| 132 | +$this->assertArrayHasKey('funcAfter', $aProperties['cbSingle']['__after']); |
|
| 133 | +$this->assertArrayHasKey('funcAfter1', $aProperties['cbMultiple']['__after']); |
|
| 134 | +$this->assertArrayHasKey('funcAfter2', $aProperties['cbMultiple']['__after']); |
|
| 135 | +$this->assertArrayHasKey('funcAfter3', $aProperties['cbMultiple']['__after']); |
|
| 136 | +$this->assertArrayHasKey('funcAfter1', $aProperties['cbParams']['__after']); |
|
| 137 | +$this->assertIsArray($aProperties['cbSingle']['__after']['funcAfter']); |
|
| 138 | +$this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter1']); |
|
| 139 | +$this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter2']); |
|
| 140 | +$this->assertIsArray($aProperties['cbMultiple']['__after']['funcAfter3']); |
|
| 141 | +$this->assertIsArray($aProperties['cbParams']['__after']['funcAfter1']); |
|
| 142 | +} |
|
| 143 | + |
|
| 144 | +/** |
|
| 145 | 145 | * @throws SetupException |
| 146 | 146 | */ |
| 147 | - public function testContainerAnnotation() |
|
| 148 | - { |
|
| 149 | - $xMetadata = $this->getAttributes(ExtendAnnotated::class, ['di1', 'di2']); |
|
| 150 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 151 | - $aProperties = $xMetadata->getProperties(); |
|
| 152 | - |
|
| 153 | - $this->assertFalse($bExcluded); |
|
| 154 | - |
|
| 155 | - $this->assertCount(2, $aProperties); |
|
| 156 | - $this->assertArrayHasKey('di1', $aProperties); |
|
| 157 | - $this->assertArrayHasKey('di2', $aProperties); |
|
| 158 | - $this->assertCount(2, $aProperties['di1']['__di']); |
|
| 159 | - $this->assertCount(2, $aProperties['di2']['__di']); |
|
| 160 | - $this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['di1']['__di']['colorService']); |
|
| 161 | - $this->assertEquals('Jaxon\Annotations\Tests\App\Ajax\FontService', $aProperties['di1']['__di']['fontService']); |
|
| 162 | - $this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['di2']['__di']['colorService']); |
|
| 163 | - $this->assertEquals('Jaxon\Annotations\Tests\Service\TextService', $aProperties['di2']['__di']['textService']); |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - /** |
|
| 147 | +public function testContainerAnnotation() |
|
| 148 | +{ |
|
| 149 | +$xMetadata = $this->getAttributes(ExtendAnnotated::class, ['di1', 'di2']); |
|
| 150 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 151 | +$aProperties = $xMetadata->getProperties(); |
|
| 152 | + |
|
| 153 | +$this->assertFalse($bExcluded); |
|
| 154 | + |
|
| 155 | +$this->assertCount(2, $aProperties); |
|
| 156 | +$this->assertArrayHasKey('di1', $aProperties); |
|
| 157 | +$this->assertArrayHasKey('di2', $aProperties); |
|
| 158 | +$this->assertCount(2, $aProperties['di1']['__di']); |
|
| 159 | +$this->assertCount(2, $aProperties['di2']['__di']); |
|
| 160 | +$this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['di1']['__di']['colorService']); |
|
| 161 | +$this->assertEquals('Jaxon\Annotations\Tests\App\Ajax\FontService', $aProperties['di1']['__di']['fontService']); |
|
| 162 | +$this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['di2']['__di']['colorService']); |
|
| 163 | +$this->assertEquals('Jaxon\Annotations\Tests\Service\TextService', $aProperties['di2']['__di']['textService']); |
|
| 164 | +} |
|
| 165 | + |
|
| 166 | +/** |
|
| 167 | 167 | * @throws SetupException |
| 168 | 168 | */ |
| 169 | - public function testClassAnnotation() |
|
| 170 | - { |
|
| 171 | - $xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 172 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 173 | - $aProperties = $xMetadata->getProperties(); |
|
| 174 | - |
|
| 175 | - $this->assertFalse($bExcluded); |
|
| 176 | - |
|
| 177 | - $this->assertCount(1, $aProperties); |
|
| 178 | - $this->assertArrayHasKey('*', $aProperties); |
|
| 179 | - $this->assertCount(5, $aProperties['*']); |
|
| 180 | - $this->assertArrayHasKey('bags', $aProperties['*']); |
|
| 181 | - $this->assertArrayHasKey('callback', $aProperties['*']); |
|
| 182 | - $this->assertArrayHasKey('__before', $aProperties['*']); |
|
| 183 | - $this->assertArrayHasKey('__after', $aProperties['*']); |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - /** |
|
| 169 | +public function testClassAnnotation() |
|
| 170 | +{ |
|
| 171 | +$xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 172 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 173 | +$aProperties = $xMetadata->getProperties(); |
|
| 174 | + |
|
| 175 | +$this->assertFalse($bExcluded); |
|
| 176 | + |
|
| 177 | +$this->assertCount(1, $aProperties); |
|
| 178 | +$this->assertArrayHasKey('*', $aProperties); |
|
| 179 | +$this->assertCount(5, $aProperties['*']); |
|
| 180 | +$this->assertArrayHasKey('bags', $aProperties['*']); |
|
| 181 | +$this->assertArrayHasKey('callback', $aProperties['*']); |
|
| 182 | +$this->assertArrayHasKey('__before', $aProperties['*']); |
|
| 183 | +$this->assertArrayHasKey('__after', $aProperties['*']); |
|
| 184 | +} |
|
| 185 | + |
|
| 186 | +/** |
|
| 187 | 187 | * @throws SetupException |
| 188 | 188 | */ |
| 189 | - public function testClassBagsAnnotation() |
|
| 190 | - { |
|
| 191 | - $xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 192 | - $aProperties = $xMetadata->getProperties(); |
|
| 189 | +public function testClassBagsAnnotation() |
|
| 190 | +{ |
|
| 191 | +$xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 192 | +$aProperties = $xMetadata->getProperties(); |
|
| 193 | 193 | |
| 194 | - $this->assertCount(2, $aProperties['*']['bags']); |
|
| 195 | - $this->assertEquals('user.name', $aProperties['*']['bags'][0]); |
|
| 196 | - $this->assertEquals('page.number', $aProperties['*']['bags'][1]); |
|
| 197 | - } |
|
| 194 | +$this->assertCount(2, $aProperties['*']['bags']); |
|
| 195 | +$this->assertEquals('user.name', $aProperties['*']['bags'][0]); |
|
| 196 | +$this->assertEquals('page.number', $aProperties['*']['bags'][1]); |
|
| 197 | +} |
|
| 198 | 198 | |
| 199 | - /** |
|
| 199 | +/** |
|
| 200 | 200 | * @throws SetupException |
| 201 | 201 | */ |
| 202 | - public function testClassCallbackAnnotation() |
|
| 203 | - { |
|
| 204 | - $xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 205 | - $aProperties = $xMetadata->getProperties(); |
|
| 202 | +public function testClassCallbackAnnotation() |
|
| 203 | +{ |
|
| 204 | +$xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 205 | +$aProperties = $xMetadata->getProperties(); |
|
| 206 | 206 | |
| 207 | - $this->assertIsArray($aProperties['*']['callback']); |
|
| 208 | - $this->assertEquals('jaxon.callback.global', $aProperties['*']['callback'][0]); |
|
| 209 | - } |
|
| 207 | +$this->assertIsArray($aProperties['*']['callback']); |
|
| 208 | +$this->assertEquals('jaxon.callback.global', $aProperties['*']['callback'][0]); |
|
| 209 | +} |
|
| 210 | 210 | |
| 211 | - /** |
|
| 211 | +/** |
|
| 212 | 212 | * @throws SetupException |
| 213 | 213 | */ |
| 214 | - public function testClassBeforeAnnotation() |
|
| 215 | - { |
|
| 216 | - $xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 217 | - $aProperties = $xMetadata->getProperties(); |
|
| 218 | - |
|
| 219 | - $this->assertCount(2, $aProperties['*']['__before']); |
|
| 220 | - $this->assertArrayHasKey('funcBefore1', $aProperties['*']['__before']); |
|
| 221 | - $this->assertArrayHasKey('funcBefore2', $aProperties['*']['__before']); |
|
| 222 | - $this->assertIsArray($aProperties['*']['__before']['funcBefore1']); |
|
| 223 | - $this->assertIsArray($aProperties['*']['__before']['funcBefore2']); |
|
| 224 | - } |
|
| 225 | - |
|
| 226 | - /** |
|
| 214 | +public function testClassBeforeAnnotation() |
|
| 215 | +{ |
|
| 216 | +$xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 217 | +$aProperties = $xMetadata->getProperties(); |
|
| 218 | + |
|
| 219 | +$this->assertCount(2, $aProperties['*']['__before']); |
|
| 220 | +$this->assertArrayHasKey('funcBefore1', $aProperties['*']['__before']); |
|
| 221 | +$this->assertArrayHasKey('funcBefore2', $aProperties['*']['__before']); |
|
| 222 | +$this->assertIsArray($aProperties['*']['__before']['funcBefore1']); |
|
| 223 | +$this->assertIsArray($aProperties['*']['__before']['funcBefore2']); |
|
| 224 | +} |
|
| 225 | + |
|
| 226 | +/** |
|
| 227 | 227 | * @throws SetupException |
| 228 | 228 | */ |
| 229 | - public function testClassAfterAnnotation() |
|
| 230 | - { |
|
| 231 | - $xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 232 | - $aProperties = $xMetadata->getProperties(); |
|
| 233 | - |
|
| 234 | - $this->assertCount(3, $aProperties['*']['__after']); |
|
| 235 | - $this->assertArrayHasKey('funcAfter1', $aProperties['*']['__after']); |
|
| 236 | - $this->assertArrayHasKey('funcAfter2', $aProperties['*']['__after']); |
|
| 237 | - $this->assertArrayHasKey('funcAfter3', $aProperties['*']['__after']); |
|
| 238 | - $this->assertIsArray($aProperties['*']['__after']['funcAfter1']); |
|
| 239 | - $this->assertIsArray($aProperties['*']['__after']['funcAfter2']); |
|
| 240 | - $this->assertIsArray($aProperties['*']['__after']['funcAfter3']); |
|
| 241 | - } |
|
| 242 | - |
|
| 243 | - /** |
|
| 229 | +public function testClassAfterAnnotation() |
|
| 230 | +{ |
|
| 231 | +$xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 232 | +$aProperties = $xMetadata->getProperties(); |
|
| 233 | + |
|
| 234 | +$this->assertCount(3, $aProperties['*']['__after']); |
|
| 235 | +$this->assertArrayHasKey('funcAfter1', $aProperties['*']['__after']); |
|
| 236 | +$this->assertArrayHasKey('funcAfter2', $aProperties['*']['__after']); |
|
| 237 | +$this->assertArrayHasKey('funcAfter3', $aProperties['*']['__after']); |
|
| 238 | +$this->assertIsArray($aProperties['*']['__after']['funcAfter1']); |
|
| 239 | +$this->assertIsArray($aProperties['*']['__after']['funcAfter2']); |
|
| 240 | +$this->assertIsArray($aProperties['*']['__after']['funcAfter3']); |
|
| 241 | +} |
|
| 242 | + |
|
| 243 | +/** |
|
| 244 | 244 | * @throws SetupException |
| 245 | 245 | */ |
| 246 | - public function testClassDiAnnotation() |
|
| 247 | - { |
|
| 248 | - $xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 249 | - $aProperties = $xMetadata->getProperties(); |
|
| 250 | - |
|
| 251 | - $this->assertCount(3, $aProperties['*']['__di']); |
|
| 252 | - $this->assertArrayHasKey('colorService', $aProperties['*']['__di']); |
|
| 253 | - $this->assertArrayHasKey('textService', $aProperties['*']['__di']); |
|
| 254 | - $this->assertArrayHasKey('fontService', $aProperties['*']['__di']); |
|
| 255 | - $this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['*']['__di']['colorService']); |
|
| 256 | - $this->assertEquals('Jaxon\Annotations\Tests\Service\TextService', $aProperties['*']['__di']['textService']); |
|
| 257 | - $this->assertEquals('Jaxon\Annotations\Tests\App\Ajax\FontService', $aProperties['*']['__di']['fontService']); |
|
| 258 | - } |
|
| 259 | - |
|
| 260 | - /** |
|
| 246 | +public function testClassDiAnnotation() |
|
| 247 | +{ |
|
| 248 | +$xMetadata = $this->getAttributes(ExtendClassAnnotated::class, []); |
|
| 249 | +$aProperties = $xMetadata->getProperties(); |
|
| 250 | + |
|
| 251 | +$this->assertCount(3, $aProperties['*']['__di']); |
|
| 252 | +$this->assertArrayHasKey('colorService', $aProperties['*']['__di']); |
|
| 253 | +$this->assertArrayHasKey('textService', $aProperties['*']['__di']); |
|
| 254 | +$this->assertArrayHasKey('fontService', $aProperties['*']['__di']); |
|
| 255 | +$this->assertEquals('Jaxon\Annotations\Tests\Service\ColorService', $aProperties['*']['__di']['colorService']); |
|
| 256 | +$this->assertEquals('Jaxon\Annotations\Tests\Service\TextService', $aProperties['*']['__di']['textService']); |
|
| 257 | +$this->assertEquals('Jaxon\Annotations\Tests\App\Ajax\FontService', $aProperties['*']['__di']['fontService']); |
|
| 258 | +} |
|
| 259 | + |
|
| 260 | +/** |
|
| 261 | 261 | * @throws SetupException |
| 262 | 262 | */ |
| 263 | - public function testClassExcludeAnnotation() |
|
| 264 | - { |
|
| 265 | - $xMetadata = $this->getAttributes(ClassExcluded::class, |
|
| 266 | - ['doNot', 'withBags', 'cbSingle']); |
|
| 267 | - $bExcluded = $xMetadata->isExcluded(); |
|
| 268 | - $aProperties = $xMetadata->getProperties(); |
|
| 269 | - $aProtected = $xMetadata->getProtectedMethods(); |
|
| 270 | - |
|
| 271 | - $this->assertTrue($bExcluded); |
|
| 272 | - $this->assertEmpty($aProperties); |
|
| 273 | - $this->assertEmpty($aProtected); |
|
| 274 | - } |
|
| 275 | - |
|
| 276 | - public function testExcludeAnnotationError() |
|
| 277 | - { |
|
| 278 | - $this->expectException(SetupException::class); |
|
| 279 | - $this->getAttributes(ExtendAnnotated::class, ['doNotError']); |
|
| 280 | - } |
|
| 281 | - |
|
| 282 | - public function testDatabagAnnotationError() |
|
| 283 | - { |
|
| 284 | - $this->expectException(SetupException::class); |
|
| 285 | - $this->getAttributes(ExtendAnnotated::class, ['withBagsError']); |
|
| 286 | - } |
|
| 287 | - |
|
| 288 | - public function testUploadAnnotationWrongName() |
|
| 289 | - { |
|
| 290 | - $this->expectException(SetupException::class); |
|
| 291 | - $this->getAttributes(ExtendAnnotated::class, ['saveFilesWrongName']); |
|
| 292 | - } |
|
| 293 | - |
|
| 294 | - public function testUploadAnnotationMultiple() |
|
| 295 | - { |
|
| 296 | - $this->expectException(SetupException::class); |
|
| 297 | - $this->getAttributes(ExtendAnnotated::class, ['saveFilesMultiple']); |
|
| 298 | - } |
|
| 299 | - |
|
| 300 | - public function testCallbacksBeforeAnnotationNoCall() |
|
| 301 | - { |
|
| 302 | - $this->expectException(SetupException::class); |
|
| 303 | - $this->getAttributes(ExtendAnnotated::class, ['cbBeforeNoCall']); |
|
| 304 | - } |
|
| 305 | - |
|
| 306 | - public function testCallbacksBeforeAnnotationUnknownAttr() |
|
| 307 | - { |
|
| 308 | - $this->expectException(SetupException::class); |
|
| 309 | - $this->getAttributes(ExtendAnnotated::class, ['cbBeforeUnknownAttr']); |
|
| 310 | - } |
|
| 311 | - |
|
| 312 | - public function testCallbacksBeforeAnnotationWrongAttrType() |
|
| 313 | - { |
|
| 314 | - $this->expectException(SetupException::class); |
|
| 315 | - $this->getAttributes(ExtendAnnotated::class, ['cbBeforeWrongAttrType']); |
|
| 316 | - } |
|
| 317 | - |
|
| 318 | - public function testCallbacksAfterAnnotationNoCall() |
|
| 319 | - { |
|
| 320 | - $this->expectException(SetupException::class); |
|
| 321 | - $this->getAttributes(ExtendAnnotated::class, ['cbAfterNoCall']); |
|
| 322 | - } |
|
| 323 | - |
|
| 324 | - public function testCallbacksAfterAnnotationUnknownAttr() |
|
| 325 | - { |
|
| 326 | - $this->expectException(SetupException::class); |
|
| 327 | - $this->getAttributes(ExtendAnnotated::class, ['cbAfterUnknownAttr']); |
|
| 328 | - } |
|
| 329 | - |
|
| 330 | - public function testCallbacksAfterAnnotationWrongAttrType() |
|
| 331 | - { |
|
| 332 | - $this->expectException(SetupException::class); |
|
| 333 | - $this->getAttributes(ExtendAnnotated::class, ['cbAfterWrongAttrType']); |
|
| 334 | - } |
|
| 335 | - |
|
| 336 | - public function testContainerAnnotationUnknownAttr() |
|
| 337 | - { |
|
| 338 | - $this->expectException(SetupException::class); |
|
| 339 | - $this->getAttributes(ExtendAnnotated::class, ['diUnknownAttr']); |
|
| 340 | - } |
|
| 341 | - |
|
| 342 | - public function testContainerAnnotationWrongAttrType() |
|
| 343 | - { |
|
| 344 | - $this->expectException(SetupException::class); |
|
| 345 | - $this->getAttributes(ExtendAnnotated::class, ['diWrongAttrType']); |
|
| 346 | - } |
|
| 347 | - |
|
| 348 | - public function testContainerAnnotationWrongClassType() |
|
| 349 | - { |
|
| 350 | - $this->expectException(SetupException::class); |
|
| 351 | - $this->getAttributes(ExtendAnnotated::class, ['diWrongClassType']); |
|
| 352 | - } |
|
| 353 | - |
|
| 354 | - public function testContainerAnnotationWrongVarCount() |
|
| 355 | - { |
|
| 356 | - $this->expectException(SetupException::class); |
|
| 357 | - $this->getAttributes(ExtendAnnotated::class, ['diWrongVarCount']); |
|
| 358 | - } |
|
| 263 | +public function testClassExcludeAnnotation() |
|
| 264 | +{ |
|
| 265 | +$xMetadata = $this->getAttributes(ClassExcluded::class, |
|
| 266 | +['doNot', 'withBags', 'cbSingle']); |
|
| 267 | +$bExcluded = $xMetadata->isExcluded(); |
|
| 268 | +$aProperties = $xMetadata->getProperties(); |
|
| 269 | +$aProtected = $xMetadata->getProtectedMethods(); |
|
| 270 | + |
|
| 271 | +$this->assertTrue($bExcluded); |
|
| 272 | +$this->assertEmpty($aProperties); |
|
| 273 | +$this->assertEmpty($aProtected); |
|
| 274 | +} |
|
| 275 | + |
|
| 276 | +public function testExcludeAnnotationError() |
|
| 277 | +{ |
|
| 278 | +$this->expectException(SetupException::class); |
|
| 279 | +$this->getAttributes(ExtendAnnotated::class, ['doNotError']); |
|
| 280 | +} |
|
| 281 | + |
|
| 282 | +public function testDatabagAnnotationError() |
|
| 283 | +{ |
|
| 284 | +$this->expectException(SetupException::class); |
|
| 285 | +$this->getAttributes(ExtendAnnotated::class, ['withBagsError']); |
|
| 286 | +} |
|
| 287 | + |
|
| 288 | +public function testUploadAnnotationWrongName() |
|
| 289 | +{ |
|
| 290 | +$this->expectException(SetupException::class); |
|
| 291 | +$this->getAttributes(ExtendAnnotated::class, ['saveFilesWrongName']); |
|
| 292 | +} |
|
| 293 | + |
|
| 294 | +public function testUploadAnnotationMultiple() |
|
| 295 | +{ |
|
| 296 | +$this->expectException(SetupException::class); |
|
| 297 | +$this->getAttributes(ExtendAnnotated::class, ['saveFilesMultiple']); |
|
| 298 | +} |
|
| 299 | + |
|
| 300 | +public function testCallbacksBeforeAnnotationNoCall() |
|
| 301 | +{ |
|
| 302 | +$this->expectException(SetupException::class); |
|
| 303 | +$this->getAttributes(ExtendAnnotated::class, ['cbBeforeNoCall']); |
|
| 304 | +} |
|
| 305 | + |
|
| 306 | +public function testCallbacksBeforeAnnotationUnknownAttr() |
|
| 307 | +{ |
|
| 308 | +$this->expectException(SetupException::class); |
|
| 309 | +$this->getAttributes(ExtendAnnotated::class, ['cbBeforeUnknownAttr']); |
|
| 310 | +} |
|
| 311 | + |
|
| 312 | +public function testCallbacksBeforeAnnotationWrongAttrType() |
|
| 313 | +{ |
|
| 314 | +$this->expectException(SetupException::class); |
|
| 315 | +$this->getAttributes(ExtendAnnotated::class, ['cbBeforeWrongAttrType']); |
|
| 316 | +} |
|
| 317 | + |
|
| 318 | +public function testCallbacksAfterAnnotationNoCall() |
|
| 319 | +{ |
|
| 320 | +$this->expectException(SetupException::class); |
|
| 321 | +$this->getAttributes(ExtendAnnotated::class, ['cbAfterNoCall']); |
|
| 322 | +} |
|
| 323 | + |
|
| 324 | +public function testCallbacksAfterAnnotationUnknownAttr() |
|
| 325 | +{ |
|
| 326 | +$this->expectException(SetupException::class); |
|
| 327 | +$this->getAttributes(ExtendAnnotated::class, ['cbAfterUnknownAttr']); |
|
| 328 | +} |
|
| 329 | + |
|
| 330 | +public function testCallbacksAfterAnnotationWrongAttrType() |
|
| 331 | +{ |
|
| 332 | +$this->expectException(SetupException::class); |
|
| 333 | +$this->getAttributes(ExtendAnnotated::class, ['cbAfterWrongAttrType']); |
|
| 334 | +} |
|
| 335 | + |
|
| 336 | +public function testContainerAnnotationUnknownAttr() |
|
| 337 | +{ |
|
| 338 | +$this->expectException(SetupException::class); |
|
| 339 | +$this->getAttributes(ExtendAnnotated::class, ['diUnknownAttr']); |
|
| 340 | +} |
|
| 341 | + |
|
| 342 | +public function testContainerAnnotationWrongAttrType() |
|
| 343 | +{ |
|
| 344 | +$this->expectException(SetupException::class); |
|
| 345 | +$this->getAttributes(ExtendAnnotated::class, ['diWrongAttrType']); |
|
| 346 | +} |
|
| 347 | + |
|
| 348 | +public function testContainerAnnotationWrongClassType() |
|
| 349 | +{ |
|
| 350 | +$this->expectException(SetupException::class); |
|
| 351 | +$this->getAttributes(ExtendAnnotated::class, ['diWrongClassType']); |
|
| 352 | +} |
|
| 353 | + |
|
| 354 | +public function testContainerAnnotationWrongVarCount() |
|
| 355 | +{ |
|
| 356 | +$this->expectException(SetupException::class); |
|
| 357 | +$this->getAttributes(ExtendAnnotated::class, ['diWrongVarCount']); |
|
| 358 | +} |
|
| 359 | 359 | } |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $aFiles = scandir($this->sCacheDir); |
| 46 | 46 | foreach ($aFiles as $sFile) |
| 47 | 47 | { |
| 48 | - if($sFile !== '.' && $sFile !== '..') |
|
| 48 | + if ($sFile !== '.' && $sFile !== '..') |
|
| 49 | 49 | { |
| 50 | 50 | @unlink($this->sCacheDir . DIRECTORY_SEPARATOR . $sFile); |
| 51 | 51 | } |
@@ -7,176 +7,176 @@ |
||
| 7 | 7 | |
| 8 | 8 | class ExtendAnnotated 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 | } |
@@ -21,18 +21,18 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class ExtendClassAnnotated 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 | } |