flow-development-collection icon indicating copy to clipboard operation
flow-development-collection copied to clipboard

BUG: Undefined array key "" in DependencyInjection/ProxyClassBuilder

Open robertlemke opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

Using Flow 9.0-dev and PHP 8.3, with a certain combination of object configuration and read-only properties, Flow fails during the compile step with a fatal error:

Warning: Undefined array key "" in /application/Packages/Framework/Neos.Flow/Classes/ObjectManagement/DependencyInjection/ProxyClassBuilder.php line 675

Expected Behavior

Flow should be able to compile those kind of proxy classes.

Steps To Reproduce

Define the following configuration in Objects.yaml:

Acme\SomeClass:
  arguments:
    1:
      object:
        factoryObjectName: Neos\Flow\Cache\CacheManager
        factoryMethodName: getCache
        arguments:
          1:
            value: Some_Cache

Then create a class similar to this:

#[Scope("singleton")]
final readonly class SomeClass
{
    public function __construct(protected FrontendInterface $cache)
    {
    }
}

Run ./flow and it should complile.

Now remove the #[Scope("singleton")] annotation, remove Data/Temporary/* and compile again. You should see the fatal error.

Environment

- Flow: 9.0-dev (a5cd6e3)
- PHP: 8.3.2

Anything else?

No response

robertlemke avatar Jan 26 '24 11:01 robertlemke