php-hal-client icon indicating copy to clipboard operation
php-hal-client copied to clipboard

Fix Resource::hasProperty()

Open komex opened this issue 10 years ago • 3 comments

It is incorrect to check property by isset(), because it may be property with null value. The better way is replace line 183 with this code:

return array_key_exists($name, $this->properties);

komex avatar Jul 01 '15 13:07 komex

Can you create a PR ?

rande avatar Jul 01 '15 13:07 rande

For performance :

return isset($this->properties[$name]) || array_key_exists($name, $this->properties);

pokap avatar Jul 01 '15 13:07 pokap

@rande may be leter.

@pokap your syntax is harder to read and there is no high performance improvement.

komex avatar Jul 01 '15 14:07 komex