Skip to content

Commit

Permalink
Use imported types for return type of getValueOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Jan 14, 2024
1 parent d8dd89f commit cb29c8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Form/Element/ObjectMultiCheckbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use function array_map;
use function is_array;

/** @psalm-import-type ValueOptionSpec from MultiCheckbox */
class ObjectMultiCheckbox extends MultiCheckbox
{
use GetProxy;
Expand Down Expand Up @@ -54,7 +55,7 @@ public function setValue($value)
/**
* {@inheritDoc}
*
* @return array<int<0, max>|string, array{attributes?: array<string, scalar|null>, disabled?: bool, label: non-empty-string, label_attributes?: array<string, scalar|null>, selected?: bool, value: non-empty-string}|string>
* @return ValueOptionSpec
*/
public function getValueOptions(): array
{
Expand Down
4 changes: 3 additions & 1 deletion src/Form/Element/ObjectRadio.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

namespace DoctrineModule\Form\Element;

use Laminas\Form\Element\MultiCheckbox;
use Laminas\Form\Element\Radio as RadioElement;

/** @psalm-import-type ValueOptionSpec from MultiCheckbox */
class ObjectRadio extends RadioElement
{
use GetProxy;
Expand Down Expand Up @@ -41,7 +43,7 @@ public function setValue($value)
/**
* {@inheritDoc}
*
* @return array<int<0, max>|string, array{attributes?: array<string, scalar|null>, disabled?: bool, label: non-empty-string, label_attributes?: array<string, scalar|null>, selected?: bool, value: non-empty-string}|string>
* @return ValueOptionSpec
*/
public function getValueOptions(): array
{
Expand Down

0 comments on commit cb29c8b

Please sign in to comment.