Skip to content

Make the lib compatible with PHPStan #65

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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