Skip to content

Serialization of Closure is not allowed Exception thrown when using new in constructor (PHP 8.1 feature) #273

@patrickkusebauch

Description

@patrickkusebauch

Version: 3.0.11

Bug Description

Serialization of Closure is not allowed Exception thrown when using new in constructor (PHP 8.1 feature).

Caused by return md5(serialize($hash)); from DependencyChecker.php:165

Screenshot from 2021-12-09 21-55-55

Steps To Reproduce

Write and register class with constructor like this:

    public function __construct(
        $clientCredentials,
        ?SignatureInterface $signature = null,
        private GuzzleHttpClient $httpClient = new GuzzleHttpClient()
    ) {}

Expected Behavior

Successfully compile DI container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions