Skip to content

AbstractList: fix array vs mixed difference - #48

Closed
TomasVotruba wants to merge 1 commit into
phpDocumentor:masterfrom
TomasVotruba:patch-1
Closed

AbstractList: fix array vs mixed difference#48
TomasVotruba wants to merge 1 commit into
phpDocumentor:masterfrom
TomasVotruba:patch-1

Conversation

@TomasVotruba

Copy link
Copy Markdown
Contributor
/** * @param mixed[] $value */publicfunction someMethod(array$value) ...

is interpretted incorretly like array. That matters, because here it is useful - we know there is mixed

/** * @param array */publicfunction someMethod(array$value) ...

But here not, because we forget to specify the type. And it could be more SomeType[], string[] etc.

```php
/**
* @PARAM mixed[] $value
*/
public function someMethod(array $value) ...
```
is interpretted incorretly like `array`. That matters, because here it is useful - we **know** there is mixed
```php
/**
* @PARAM array
*/
public function someMethod(array $value) ...
```
But here not, because we forget to specify the type. And it could be more `SomeType[]`, `string[]` etc.
@TomasVotruba

TomasVotruba commented Nov 29, 2017

Copy link
Copy Markdown
ContributorAuthor

Test would probably fail now. I fix them after feedback and more guidance where to solve this

@jaapio

Copy link
Copy Markdown
Member

Your assumption seems to be correct to me. What would you want to know to continue this PR?

@GrahamCampbell

Copy link
Copy Markdown
Contributor

And it could be more SomeType[], string[] etc.

Potentially, mixed[] could still be string[], but the typing is just too wide?

@TomasVotruba

Copy link
Copy Markdown
ContributorAuthor

Not relevant anymore, I migrated to https://github.com/phpstan/phpdoc-parser

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@TomasVotruba@jaapio@GrahamCampbell