Cannot apply #[AllowDynamicProperties] to interface %s

Description

The attribute AllowDynamicProperties has no meaning when used with a interface, even as interface can define properties. Apply it to any class that implements the interface.

Example

<?php

#[AllowDynamicProperties]
interface I {}

?>

Literal Examples

  • Cannot apply #[AllowDynamicProperties] to interface i

Solutions

  • Use the attribute on the class that implements the interface.