You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phan 5.4.2
php-ast version 1.1.0
PHP version used to run Phan: 8.2.7
On this code:
class FooData extends Spatie\LaravelData\Data {
public function __construct(
#[WithTransformer(DateTimeInterfaceTransformer::class)]
public Carbon $birth_date
) {
}
I get the message:
PhanAttributeWrongTarget Saw use of attribute \Spatie\LaravelData\Attributes\WithTransformer declared at vendor/spatie/laravel-data/src/Attributes/WithTransformer.php:10 which supports being declared on \Attribute::TARGET_CLASS|\Attribute::TARGET_PROPERTY but it was declared on public \Carbon\Carbon $birth_date which requires an attribute declared to support \Attribute::TARGET_PARAMETER
In PHP 8, this is functionally equivalent to
class FooData extends Spatie\LaravelData\Data {
#[WithTransformer(DateTimeInterfaceTransformer::class)]
public Carbon $birth_date;
public function __construct(
Carbon $birth_date
) {
$this->birth_date = $birth_date;
}
which does not report the error.
The text was updated successfully, but these errors were encountered:
On this code:
I get the message:
In PHP 8, this is functionally equivalent to
which does not report the error.
The text was updated successfully, but these errors were encountered: