BC break? possibly (changes behavior in nette/utils:4 to be compatible with behavior in nette/finder:2)
doc PR: not necessary
Bug Description
Finder (v2) did use isFile() or isDir() to determine type of SplFileInfo (link).
After migration to nette/utils, it uses SplFileInfo::getType() (link).
There is a slight difference between the two approaches regarding handling of symlinks - if SplFileInfo is a symlink to a file, isFile() returns true (although it is not documented - see comment), while getType() returns link (and thus fails === 'file' comparison).
This leads to change of behavior in nette/utils v4 when Finder only returns real files, not symlinks and there is no way to return to the previous behaviour.
Steps To Reproduce
create a symlink to file in a directory (mkdir ./test && touch ./file.txt && cd ./test && ln -s ../file.txt)
Bug Description
Finder (v2) did use
isFile()
orisDir()
to determine type ofSplFileInfo
(link).After migration to
nette/utils
, it usesSplFileInfo::getType()
(link).There is a slight difference between the two approaches regarding handling of symlinks - if
SplFileInfo
is a symlink to a file,isFile()
returnstrue
(although it is not documented - see comment), whilegetType()
returnslink
(and thus fails=== 'file'
comparison).This leads to change of behavior in nette/utils v4 when Finder only returns real files, not symlinks and there is no way to return to the previous behaviour.
Steps To Reproduce
mkdir ./test && touch ./file.txt && cd ./test && ln -s ../file.txt
)Finder::findFiles('*')->in('./test')
returns empty array