graphaware / neo4j-bolt-php

PHP Driver for Neo4j's Binary Protocol : Bolt
MIT License
42 stars 38 forks source link

Undefined index in /vagrant/vendor/graphaware/neo4j-bolt/src/Record/RecordView.php line 94 #2

Closed Aeolun closed 8 years ago

Aeolun commented 8 years ago

Basically, since the if statement here isn't checking whether the array index exists, PHP spits a notice. Not really relevant unless you have something catch or display it, but it would be neat if it didn't generate any errors in the first place.

    public function nodeValue($key)
    {
        if ($this->values[$key] !== null && !$this->values[$key] instanceof NodeInterface) {
            throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, 'NODE'));
        }

        return $this->value($key);
    }
ikwattro commented 8 years ago

Thanks for the report. I will fix it today.

ikwattro commented 8 years ago

@Aeolun This has been fixed and 1.2.2 is released

Aeolun commented 8 years ago

@ikwattro Awesome :) I fixed it in my local copy, but that'd disappear if I updated. Now I don't have to worry. Thanks!