10quality / wpmvc-commands

Ayuco commands for Wordpress MVC,
MIT License
2 stars 4 forks source link

Update check on set parameter to empty check. #85

Closed garretthyder closed 4 years ago

garretthyder commented 4 years ago

Update not-isset to empty on the second parameter check, fixing #84

garretthyder commented 4 years ago

Sounds good, if you'd like we can chain it with an array_key_exists but it shouldn't be needed as empty will return false if the index doesn't exist. "No warning is generated if the variable does not exist. That means empty() is essentially the concise equivalent to !isset($var) || $var == false." Reference: https://www.php.net/manual/en/function.empty.php

Testing the following all produce the correct message; php ayuco set version php ayuco set version: php ayuco set version: 1.0.0 *Previously with the isset method the 2nd & 3rd would reset the version to an empty string as $object[1] was set but empty.