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

ReflectionUnionType in PHP 8 #247

Closed
kozaktomas opened this issue Nov 3, 2020 · 0 comments
Closed

ReflectionUnionType in PHP 8 #247

kozaktomas opened this issue Nov 3, 2020 · 0 comments

Comments

@kozaktomas
Copy link

Version: nette/di master, PHP 8

Bug Description

There is an issue with ReflectionUnionType in PHP 8. When a function uses union type for return && the function is used in config file => it doesn't work as expected because nette counts with ReflectionNamedType, but ReflectionUnionType is returned. Unfortunately ReflectionUnionType doesn't have getName() method

See screenshot with error and call stack:

image

Steps To Reproduce

Just create simple TestClass and put these lines to neon config

parameters:
    test: ::getenv("TEST") # reflection for getenv returns ReflectionUnionType

services:
	router: App\Router\RouterFactory::createRouter
	- App\Model\TestClass(%test%)

Possible Solution

  1. Check for reflection type. BC break? ¯_(ツ)_/¯
  2. Maybe it's PHP bug. But I couldn't find any bug report.
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

1 participant