Skip to content

Commit

Permalink
Remove native type hint from first argument to make attributes usable…
Browse files Browse the repository at this point in the history
… like annotations
  • Loading branch information
W0rma committed Oct 31, 2024
1 parent f04e0cc commit 9e8a232
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/Configuration/Annotation/Embedded.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ class Embedded
public $exclusion = null;

/**
* @param string|array $content
* @param array|string|null $values
* @param array|string|null $content
*/
public function __construct(array $values = [], $content = null, ?string $type = null, ?string $xmlElementName = null, ?Exclusion $exclusion = null)
public function __construct($values = [], $content = null, ?string $type = null, ?string $xmlElementName = null, ?Exclusion $exclusion = null)
{
$this->loadAnnotationParameters(get_defined_vars());
}
Expand Down
5 changes: 4 additions & 1 deletion src/Configuration/Annotation/Exclusion.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ final class Exclusion
*/
public $excludeIf = null;

public function __construct(array $values = [], ?array $groups = null, ?string $sinceVersion = null, ?string $untilVersion = null, ?int $maxDepth = null, ?string $excludeIf = null)
/**
* @param array|null $values
*/
public function __construct($values = [], ?array $groups = null, ?string $sinceVersion = null, ?string $untilVersion = null, ?int $maxDepth = null, ?string $excludeIf = null)
{
$this->loadAnnotationParameters(get_defined_vars());
}
Expand Down
3 changes: 2 additions & 1 deletion src/Configuration/Annotation/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ final class Relation
public $exclusion = null;

/**
* @param array|string|null $values
* @param string|Route $href
* @param string|Embedded $embedded
*/
public function __construct(array $values = [], ?string $name = null, $href = null, $embedded = null, array $attributes = [], ?Exclusion $exclusion = null)
public function __construct($values = [], ?string $name = null, $href = null, $embedded = null, array $attributes = [], ?Exclusion $exclusion = null)
{
$this->loadAnnotationParameters(get_defined_vars());
}
Expand Down
5 changes: 4 additions & 1 deletion src/Configuration/Annotation/RelationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ class RelationProvider
*/
public $name;

public function __construct(array $values = [], ?string $name = null)
/**
* @param array|string|null $values
*/
public function __construct($values = [], ?string $name = null)
{
$this->loadAnnotationParameters(get_defined_vars());
}
Expand Down
3 changes: 2 additions & 1 deletion src/Configuration/Annotation/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ class Route
public $generator = null;

/**
* @param array|string|null $values
* @param array|string $parameters
* @param bool|string $absolute
*/
public function __construct(array $values = [], ?string $name = null, $parameters = null, $absolute = false, ?string $generator = null)
public function __construct($values = [], ?string $name = null, $parameters = null, $absolute = false, ?string $generator = null)
{
$this->loadAnnotationParameters(get_defined_vars());
}
Expand Down

0 comments on commit 9e8a232

Please sign in to comment.