Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ abstract class Property extends Node
/**
* List of parameters.
*
* @var array
* @var Parameter[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should go one step further:

Suggested change
* @var Parameter[]
* @var array<string, Parameter>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that as well, yet I'm not sure how "official" that phpdoc syntax is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its kind of proprietary syntax which is used in psalm, phpstan and most static analysis tooling.

we could also use a more tool targetting syntax, so we don't kill the "offical form":

Suggested change
* @var Parameter[]
* @phpstan-var array<string, Parameter>
* @var Parameter[]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you prefer this then I can add it

*/
public $parameters = [];

Expand All @@ -64,7 +64,7 @@ abstract class Property extends Node
* @param Component $root The root document
* @param string $name
* @param string|array|null $value
* @param array $parameters List of parameters
* @param array $parameters List of parameter values
* @param string $group The vcard property group
*/
public function __construct(Component $root, $name, $value = null, array $parameters = [], $group = null)
Expand Down Expand Up @@ -178,7 +178,7 @@ public function add($name, $value = null)
/**
* Returns an iterable list of children.
*
* @return array
* @return Parameter[]
*/
public function parameters()
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Property/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getValueType()
/**
* Returns an iterable list of children.
*
* @return array
* @return Parameter[]
*/
public function parameters()
{
Expand Down