@@ -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 | } |
@@ -19,13 +19,13 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | class ConfigReader |
| 21 | 21 | { |
| 22 | - /** |
|
| 22 | +/** |
|
| 23 | 23 | * @param ConfigSetter $xConfigSetter |
| 24 | 24 | */ |
| 25 | - public function __construct(private ConfigSetter $xConfigSetter) |
|
| 26 | - {} |
|
| 25 | +public function __construct(private ConfigSetter $xConfigSetter) |
|
| 26 | +{} |
|
| 27 | 27 | |
| 28 | - /** |
|
| 28 | +/** |
|
| 29 | 29 | * Read options from a config file to an array |
| 30 | 30 | * |
| 31 | 31 | * @param string $sConfigFile The full path to the config file |
@@ -36,29 +36,29 @@ discard block |
||
| 36 | 36 | * @throws Exception\FileContent |
| 37 | 37 | * @throws Exception\YamlExtension |
| 38 | 38 | */ |
| 39 | - public function read(string $sConfigFile): array |
|
| 40 | - { |
|
| 41 | - if(!($sConfigFile = trim($sConfigFile))) |
|
| 42 | - { |
|
| 43 | - return []; |
|
| 44 | - } |
|
| 39 | +public function read(string $sConfigFile): array |
|
| 40 | +{ |
|
| 41 | +if(!($sConfigFile = trim($sConfigFile))) |
|
| 42 | +{ |
|
| 43 | +return []; |
|
| 44 | +} |
|
| 45 | 45 | |
| 46 | - $sExt = pathinfo($sConfigFile, PATHINFO_EXTENSION); |
|
| 47 | - switch($sExt) |
|
| 48 | - { |
|
| 49 | - case 'php': |
|
| 50 | - $aConfigOptions = Reader\PhpReader::read($sConfigFile); |
|
| 51 | - break; |
|
| 52 | - case 'yaml': |
|
| 53 | - case 'yml': |
|
| 54 | - $aConfigOptions = Reader\YamlReader::read($sConfigFile); |
|
| 55 | - break; |
|
| 56 | - case 'json': |
|
| 57 | - $aConfigOptions = Reader\JsonReader::read($sConfigFile); |
|
| 58 | - break; |
|
| 59 | - default: |
|
| 60 | - throw new Exception\FileExtension($sConfigFile); |
|
| 61 | - } |
|
| 46 | +$sExt = pathinfo($sConfigFile, PATHINFO_EXTENSION); |
|
| 47 | +switch($sExt) |
|
| 48 | +{ |
|
| 49 | +case 'php': |
|
| 50 | +$aConfigOptions = Reader\PhpReader::read($sConfigFile); |
|
| 51 | +break; |
|
| 52 | +case 'yaml': |
|
| 53 | +case 'yml': |
|
| 54 | +$aConfigOptions = Reader\YamlReader::read($sConfigFile); |
|
| 55 | +break; |
|
| 56 | +case 'json': |
|
| 57 | +$aConfigOptions = Reader\JsonReader::read($sConfigFile); |
|
| 58 | +break; |
|
| 59 | +default: |
|
| 60 | +throw new Exception\FileExtension($sConfigFile); |
|
| 61 | +} |
|
| 62 | 62 | |
| 63 | 63 | return $aConfigOptions; |
| 64 | 64 | } |