Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undefined index #298

Merged
merged 1 commit into from
Sep 5, 2021
Merged

Fix undefined index #298

merged 1 commit into from
Sep 5, 2021

Conversation

villfa
Copy link
Contributor

@villfa villfa commented Sep 4, 2021

When I run the unit tests of the BetterReflection project I get this error:

1) Roave\BetterReflectionTest\TypesFinder\FindReturnTypeTest::testFindReturnTypeForMethod with data set #2 ('@return array{foo: string|int}', array())
Undefined index: args

/code/BetterReflection/src/TypesFinder/FindReturnType.php:48
/code/BetterReflection/test/unit/TypesFinder/FindReturnTypeTest.php:85

When the error happens $call contains the following array:

array(3) {
  ["file"]=>
  string(41) "/code/BetterReflection/vendor/bin/phpunit"
  ["line"]=>
  int(21)
  ["function"]=>
  string(4) "eval"
}

This modification fixes the problem.

@mvriel mvriel merged commit 44e31d1 into phpDocumentor:master Sep 5, 2021
@mvriel
Copy link
Member

mvriel commented Sep 5, 2021

Thanks for the PR; looking good :) Would it be possible to write a test that can confirm this as a follow up PR?

@villfa villfa deleted the patch-1 branch September 5, 2021 18:59
@villfa
Copy link
Contributor Author

villfa commented Sep 5, 2021

@mvriel here: #299

jaapio added a commit that referenced this pull request Sep 17, 2021
Tests: add a case to cover issue #298
@yannickl88
Copy link

just ran into this issue while upgrading phpunit. When will there be a release that includes this fix?

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.

None yet

3 participants