@@ -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 | } |
@@ -20,45 +20,45 @@ |
||
| 20 | 20 | |
| 21 | 21 | interface UploadHandlerInterface |
| 22 | 22 | { |
| 23 | - /** |
|
| 23 | +/** |
|
| 24 | 24 | * Set the uploaded file name sanitizer |
| 25 | 25 | * |
| 26 | 26 | * @param Closure $cSanitizer The closure |
| 27 | 27 | * |
| 28 | 28 | * @return void |
| 29 | 29 | */ |
| 30 | - public function sanitizer(Closure $cSanitizer); |
|
| 30 | +public function sanitizer(Closure $cSanitizer); |
|
| 31 | 31 | |
| 32 | - /** |
|
| 32 | +/** |
|
| 33 | 33 | * Get the uploaded files |
| 34 | 34 | * |
| 35 | 35 | * @return FileInterface[] |
| 36 | 36 | */ |
| 37 | - public function files(): array; |
|
| 37 | +public function files(): array; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 39 | +/** |
|
| 40 | 40 | * Check if the current request contains uploaded files |
| 41 | 41 | * |
| 42 | 42 | * @param ServerRequestInterface $xRequest |
| 43 | 43 | * |
| 44 | 44 | * @return bool |
| 45 | 45 | */ |
| 46 | - public function canProcessRequest(ServerRequestInterface $xRequest): bool; |
|
| 46 | +public function canProcessRequest(ServerRequestInterface $xRequest): bool; |
|
| 47 | 47 | |
| 48 | - /** |
|
| 48 | +/** |
|
| 49 | 49 | * Process the uploaded files in the HTTP request |
| 50 | 50 | * |
| 51 | 51 | * @param ServerRequestInterface $xRequest |
| 52 | 52 | * |
| 53 | 53 | * @return bool |
| 54 | 54 | */ |
| 55 | - public function processRequest(ServerRequestInterface $xRequest): bool; |
|
| 55 | +public function processRequest(ServerRequestInterface $xRequest): bool; |
|
| 56 | 56 | |
| 57 | - /** |
|
| 57 | +/** |
|
| 58 | 58 | * @param string $sStorage |
| 59 | 59 | * @param Closure $cFactory |
| 60 | 60 | * |
| 61 | 61 | * @return void |
| 62 | 62 | */ |
| 63 | - public function registerStorageAdapter(string $sStorage, Closure $cFactory); |
|
| 63 | +public function registerStorageAdapter(string $sStorage, Closure $cFactory); |
|
| 64 | 64 | } |