Skip to content

Make the lib compatible with PHPStan #65

@cybemos

Description

@cybemos

What problem does your feature request address?

I use PHPStan to detect errors on static types.
No types are currently present in Models.

Usage example

private function logCustomer(Customer $customer): void
    {
        Log::info('logging customer', [
            'id' => $customer->id,
            'country' => $customer->unknownField, // here, PHPStan should be able to know that the field is unknown
        ]);
    }

Describe the desired solution

Here is an example of how to make it compatible with PHPStan.

/**
* @property string $id
* @property string|null $email
* ...
*/
class Customer extends Model
{
    //....
}

Alternatives considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions