Skip to content

Call to static method Webmozart\Assert\Assert::allCount() with array and 2 will always evaluate to true. #130

Closed
@VincentLanglet

Description

@VincentLanglet

I bumped from 1.0.9 to 1.1.2 ;
I assume it's related to 56d7b27 @herndlm

class Foo
{
    /** @var array<int, array{id: string, num_order: string}> */
    protected array $orders = [];

    public function setOrders(array $orders): self
    {
        Assert::allCount($orders, 2);
        Assert::allKeyExists($orders, 'id');
        Assert::allKeyExists($orders, 'num_order');

        $this->orders = $orders;

        return $this;
    }
}

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