Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection::getPreviousAccessedColumns invalid return annotation #160

Open
hranicka opened this issue Feb 2, 2017 · 0 comments · May be fixed by #161
Open

Selection::getPreviousAccessedColumns invalid return annotation #160

hranicka opened this issue Feb 2, 2017 · 0 comments · May be fixed by #161

Comments

@hranicka
Copy link
Contributor

hranicka commented Feb 2, 2017

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant