Skip to content

Cannot assign null to property Packagist\Api\Result\Package::$type of type string #88

@garak

Description

@garak

Method fromArray of class AbstractResult is not checking for values when assigning them to properties.
As a result, any non-nullable property of a child class can raise a TypeError (like the one mentioned in the subject for Package class)

A possible solution could be making all properties nullable. A better solution could be adding a check inside fromArray method, checking that the value is not null before assigning it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions