code: public static function createFromSplFileInfo(\SplFileInfo $info)
      {
          $realpath = $info->getRealPath();
          if ($info->isFile()) {
              return new fs\entity\FileEntity($realpath);
          }
          return new fs\entity\DirEntity($realpath);
      }
docs: Create an entity from an instance of \SplFileInfo
  
  @param \SplFileInfo $info
  @return \sndsgd\fs\entity\EntityInterface