Skip to content


Fix Index construction #386

merged 1 commit into from

3 participants

Doctrine member

This PR fixes an uncommon but possible use case where an Index is constructed with an empty columns array. Following calls to Index::getColumns() lead to a PHP warning array_keys() expects parameter 1 to be array, null given as the $_columns property is not properly initialized.



thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

We use Jira to track the state of pull requests and the versions they got
included in.

@guilhermeblanco guilhermeblanco merged commit a619261 into doctrine:master

1 check passed

Details default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 9, 2013
  1. @deeky666

    fix index construction

    deeky666 committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Doctrine/DBAL/Schema/Index.php
2 lib/Doctrine/DBAL/Schema/Index.php
@@ -29,7 +29,7 @@ class Index extends AbstractAsset implements Constraint
* @var Identifier[]
- protected $_columns;
+ protected $_columns = array();
* @var boolean
Something went wrong with that request. Please try again.