Fakerino\DataSource\File\File::getExtension PHP Метод

getExtension() публичный Метод

public getExtension ( ) : string
Результат string
    public function getExtension()
    {
        return pathinfo($this->getBasename(), PATHINFO_EXTENSION);
    }

Usage Example

 /**
  * Finds and returns the file if exists
  *
  * @return Fakerino\Configuration\ConfigurationInterface
  * @throws ConfNotSupportedException
  */
 public function load()
 {
     $file = new File($this->filePath);
     $fileExt = $file->getExtension();
     $fileConfClass = $this->getConfigFileClass($fileExt);
     if (class_exists($fileConfClass)) {
         $fileConf = new $fileConfClass($file);
         return $fileConf;
     }
     throw new ConfNotSupportedException($this->filePath);
 }