Skip to content

Cassette Name Passed to substr May be Null #29

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

Closed
chrisguitarguy opened this issue Jul 2, 2018 · 2 comments
Closed

Cassette Name Passed to substr May be Null #29

chrisguitarguy opened this issue Jul 2, 2018 · 2 comments

Comments

@chrisguitarguy
Copy link
Contributor

chrisguitarguy commented Jul 2, 2018

if (substr($cassetteName, -5) === '.json') {
VCR::configure()->setStorage('json');
}

If, for instance, the test doesn't have a @vcr annotation, that value (from array_pop($parsed)) may be null. This causes a TypeError due to the strict_types declaration.

Probably could be fixed by moving the empty($cassetteName) check before the check for a .json extension.

if (empty($cassetteName)) {
return;
}

@renatomefi
Copy link
Member

Hello @chrisguitarguy thanks for the report and the findings!

Would you be willing to open a PR? We can check together the tests to ensure BC!

Thanks again

@chrisguitarguy
Copy link
Contributor Author

chrisguitarguy commented Jul 3, 2018

Done @renatomefi !

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

No branches or pull requests

2 participants