code: public function getRootDir()
      {
          if (!$this->rootDir) {
              $refl = new \ReflectionObject($this);
              $filename = $refl->getFileName();
              if (false !== ($pos = strrpos($filename, '/vendor/'))) {
                  $filename = substr($filename, 0, $pos);
              } else {
                  $filename = dirname($filename).'/..';
              }
  
              $this->rootDir = str_replace('\\', '/', $filename);
          }
  
          return $this->rootDir;
      }
docs: Gets the root directory.
  
  @return string