Shouldn't this be `if ($this->allowEmptyItems) { return null' }` ?