Skip to content

Selection::getPreviousAccessedColumns invalid return annotation #160

Description

@hranicka
  • bug report? yes
  • feature request? no
  • version: v2.4.2/v3.0.0-alpha

Description

\Nette\Database\Table\SqlBuilder::buildSelectQuery accepts array only or nullable since 14506d0/v2.4.2/v3.0.0-alpha [blame].

It's called internally and gets a value returned e.g. from \Nette\Database\Table\Selection::getPreviousAccessedColumns [link]. And this method returns array (it's OK) but can return bool too (and it's not OK then). See @return annotation of that function.

It seems the annotation is wrong because default (and the one) implementation will return always an array.

I have a problem when I use an overridden \Nette\Database\Table\Selection.

It was OK prior to 14506d0/v2.4.2/v3.0.0-alpha. Since those versions I get Argument 1 passed to Nette\Database\Table\SqlBuilder::buildSelectQuery() must be of the type array, boolean given.

Solution

Fix annotation for v2.x, array return typehint for v3.x in \Nette\Database\Table\Selection::getPreviousAccessedColumns

It should always return an array. As of the default implementation.

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