-
-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
Description
As of PHP 8.1, it's possible to use new
syntax as default value to functions params (rfc). However this doesn't seem to be supported in nette/di
yet.
For example with lcobucci/jwt
configuration.
Method annotation
public static function forSymmetricSigner(
Signer $signer,
Key $key,
Encoder $encoder = new JoseEncoder(), // optional argument
Decoder $decoder = new JoseEncoder(), // optional argument
): self {
// ...
}
DI config
- Configuration::forSymmetricSigner(
signer: [instance of Signer]
key: [instance of Key]
# no $encoder or $decoder param passed
)
Output
Service of type Encoder required by $encoder in Configuration::forSymmetricSigner not found
When I pass JoseEncoder
explicitly, it works.
Note: I removed FQNs for better readability.
Metadata
Metadata
Assignees
Labels
No labels