IO/File and IO/Directory unexpected behaviour
When we work with IO/File
or IO/Directory
and our file or directory basename is 0
, We saw unexpected behavior in getPath()
method, it returns an empty string.
Because 0
threaded as false in the condition of the getPath
method.
See
https://git.jeyserver.com/jalno/base/-/blob/477fd76079734d86e82cfa2bf8ee7a7d22ac57d2/packages/base/libraries/io/directory.php#L24
And:
https://git.jeyserver.com/jalno/base/-/blob/477fd76079734d86e82cfa2bf8ee7a7d22ac57d2/packages/base/libraries/io/file.php#L22 \
Also, The condition in the construct IO/File
or IO/Directory
has the same behavior!\
See
https://git.jeyserver.com/jalno/base/-/blob/477fd76079734d86e82cfa2bf8ee7a7d22ac57d2/packages/base/libraries/io/directory.php#L7
And:
https://git.jeyserver.com/jalno/base/-/blob/477fd76079734d86e82cfa2bf8ee7a7d22ac57d2/packages/base/libraries/io/file.php#L7