Skip to content

Nested shapes loses non-empty-string #16

@bendavies

Description

@bendavies

Hi,

The following works:

$payload = Type\shape([
  'repository' => Type\non_empty_string(),
])->coerce($payload);

PHPStan\dumpType($payload);

dumps

 Dumped type: array{repository: non-empty-string}

however, the non_empty_string is lost if nested:

$payload = Type\shape([
    'repository' => Type\non_empty_vec(
        Type\shape([
            'name' => Type\non_empty_string(),
        ]),
    ),
])->coerce($payload);

\PHPStan\dumpType($payload);

dumps

Dumped type: array{repository: non-empty-list<array{name: string}>}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions