Skip to content

Form::getValues(bool) broken #176

Description

@hubipe

Hello,
we're using older version of Nette, where method Container::getValues accepted only bool. The (pseudocode) signature of the method was:

/**
 * @return $asArray is true ? array<string, mixed> : ArrayHash
 */
Container::getValues(bool $asArray = false)

With the latest version, PHPStan thinks, that all the calls of Form::getValues(true) returns ArrayHash, but in reality, the array is returned:

Image

I think it is a bug introduced in this PR #175.

Either support for old version of Nette should be capped in composer.json or the code should align by the version of nette/forms installed.

Thanks for an awesome extension though! I'm always keen on working with PHPstan.

Activity

  1. hubipe commented on Sep 19, 2025

    @hubipe
    Author

    Plus I've noticed, that README.md still contains

    Nette\Forms\Container::getValues return type based on $asArray parameter.

  2. ondrejmirtes commented on Sep 19, 2025

    @ondrejmirtes
    Member

    Fixed aa6c413

  3. github-actions commented on Dec 16, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked as resolved and limited conversation to collaborators on Dec 16, 2025
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