mirror of
https://github.com/archtechx/enums.git
synced 2025-12-12 21:54:04 +00:00
Fix code style (php-cs-fixer)
This commit is contained in:
parent
7b0871db00
commit
cf9926c8e3
4 changed files with 10 additions and 3 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace ArchTech\Enums\Meta;
|
namespace ArchTech\Enums\Meta;
|
||||||
|
|
||||||
use Attribute;
|
use Attribute;
|
||||||
|
|
@ -10,7 +12,8 @@ class Meta
|
||||||
/** @var MetaProperty[] */
|
/** @var MetaProperty[] */
|
||||||
public array $metaProperties;
|
public array $metaProperties;
|
||||||
|
|
||||||
public function __construct(array|string ...$metaProperties) {
|
public function __construct(array|string ...$metaProperties)
|
||||||
|
{
|
||||||
// When an array is passed, it'll be wrapped in an outer array due to the ...variadic parameter
|
// When an array is passed, it'll be wrapped in an outer array due to the ...variadic parameter
|
||||||
if (isset($metaProperties[0]) && is_array($metaProperties[0])) {
|
if (isset($metaProperties[0]) && is_array($metaProperties[0])) {
|
||||||
// Extract the inner array
|
// Extract the inner array
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace ArchTech\Enums\Meta;
|
namespace ArchTech\Enums\Meta;
|
||||||
|
|
||||||
abstract class MetaProperty
|
abstract class MetaProperty
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace ArchTech\Enums\Meta;
|
namespace ArchTech\Enums\Meta;
|
||||||
|
|
||||||
use ReflectionAttribute;
|
use ReflectionAttribute;
|
||||||
|
|
@ -34,9 +36,7 @@ class Reflection
|
||||||
/**
|
/**
|
||||||
* Get the value of a meta property on the provided enum.
|
* Get the value of a meta property on the provided enum.
|
||||||
*
|
*
|
||||||
* @param \class-string<MetaProperty> $property
|
|
||||||
* @param Enum $enum
|
* @param Enum $enum
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public static function metaValue(string $metaProperty, mixed $enum): mixed
|
public static function metaValue(string $metaProperty, mixed $enum): mixed
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace ArchTech\Enums;
|
namespace ArchTech\Enums;
|
||||||
|
|
||||||
use ArchTech\Enums\Meta\MetaProperty;
|
use ArchTech\Enums\Meta\MetaProperty;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue