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
 */
public function someMethod(array $value) ...

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

/**
 * @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.

```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
Contributor Author

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

@jaapio

jaapio commented Dec 10, 2017

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
Contributor Author

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

Sign up for free to 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