code: public function getList($asStrings = false)
      {
          $list = scandir($this->path);
          if ($asStrings === true) {
              return array_diff($list, [".", ".."]);
          }
  
          $ret = [];
          foreach ($list as $name) {
              if ($name === "." || $name === "..") {
                  continue;
              }
              $path = $this->path.DIRECTORY_SEPARATOR.$name;
              $ret[] = (is_dir($path)) ? new static($path) : new FileEntity($path);
          }
          return $ret;
      }
docs: get a list of the directory children
  
  @param boolean $asStrings Only return the child entity names
  @return array<string>|boolean