From e6c3f0e41134eda4c4b0a800e54d1116dd34be6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20M=C3=AD=C5=A1ek?= Date: Sun, 31 Mar 2019 19:52:53 +0200 Subject: [PATCH] SplFileInfo::getSize() --- src/Peachpie.Library/Spl/SplFileInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Peachpie.Library/Spl/SplFileInfo.cs b/src/Peachpie.Library/Spl/SplFileInfo.cs index a7bbbcf920..5a39c8a628 100644 --- a/src/Peachpie.Library/Spl/SplFileInfo.cs +++ b/src/Peachpie.Library/Spl/SplFileInfo.cs @@ -104,10 +104,10 @@ public virtual string getExtension() public virtual string getPathname() => _fullpath; public virtual long getPerms() { throw new NotImplementedException(); } - [return:CastToFalse] + [return: CastToFalse] public virtual string getRealPath(Context ctx) => ResolvedInfo.FullName; - public virtual long getSize() { throw new NotImplementedException(); } + public virtual long getSize() => (ResolvedInfo is FileInfo finfo) ? finfo.Length : 0; public virtual string getType() { throw new NotImplementedException(); } public virtual bool isDir() => ResolvedInfo.Exists && ResolvedInfo is DirectoryInfo; public virtual bool isExecutable() { throw new NotImplementedException(); }