@@ -72,6 +72,38 @@ public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, S
72
72
return $ a ;
73
73
}
74
74
75
+ public static function castSplFileInfo (\SplFileInfo $ c , array $ a , Stub $ stub , $ isNested )
76
+ {
77
+ $ prefix = Caster::PREFIX_VIRTUAL ;
78
+
79
+ return $ a + array (
80
+ $ prefix .'path ' => $ c ->getPath (),
81
+ $ prefix .'filename ' => $ c ->getFilename (),
82
+ $ prefix .'extension ' => $ c ->getExtension (),
83
+ $ prefix .'basename ' => $ c ->getBasename (),
84
+ $ prefix .'pathname ' => $ c ->getPathname (),
85
+ $ prefix .'perms ' => $ c ->getPerms (),
86
+ $ prefix .'inode ' => $ c ->getInode (),
87
+ $ prefix .'size ' => $ c ->getSize (),
88
+ $ prefix .'owner ' => $ c ->getOwner (),
89
+ $ prefix .'group ' => $ c ->getGroup (),
90
+ $ prefix .'aTime ' => $ c ->getATime (),
91
+ $ prefix .'mTime ' => $ c ->getMTime (),
92
+ $ prefix .'cTime ' => $ c ->getCTime (),
93
+ $ prefix .'type ' => $ c ->getType (),
94
+ $ prefix .'writable ' => $ c ->isWritable (),
95
+ $ prefix .'readable ' => $ c ->isReadable (),
96
+ $ prefix .'executable ' => $ c ->isExecutable (),
97
+ $ prefix .'file ' => $ c ->isFile (),
98
+ $ prefix .'dir ' => $ c ->isDir (),
99
+ $ prefix .'link ' => $ c ->isLink (),
100
+ // $prefix.'linkTarget' => $c->getLinkTarget(), // Can throw a warning
101
+ $ prefix .'realPath ' => $ c ->getRealPath (),
102
+ // $prefix.'fileInfo' => $c->getFileInfo(), // Generate an infinite recursion loop
103
+ // $prefix.'pathInfo' => $c->getPathInfo(), // Generate an infinite recursion loop
104
+ );
105
+ }
106
+
75
107
public static function castFixedArray (\SplFixedArray $ c , array $ a , Stub $ stub , $ isNested )
76
108
{
77
109
$ a += array (
0 commit comments