If no exists extension in file,
find file with the your extension

@param string $file
@param string $folder
@return bool|string With address url of the file
193621
public static function fileNoExtension($file, $folder) {
        
        if( is_array($file) )
            return false;
        
        $exts = new Extensions();
        
        //case has extension
        if( strstr($file, '.') && $exts->check($file) )
            return false;
            
        $files = self::fileAll($folder);
        
        foreach($files as $v){
            
            $exp        = explode( DIRECTORY_SEPARATOR, $v );
            $file_sch   = explode('.',end($exp));
            $ky         = count($file_sch) -1;
            $file_ext   = $file_sch[$ky];
            
            unset($file_sch[$ky]);
            
            if(implode('.', $file_sch) == $file)
                return $folder . DIRECTORY_SEPARATOR . $file.'.'.$file_ext;
            
        }
        
        return false;
        
    }
558508
protected function getFileFinder($file) {
    return new class($file) implements ClassFinderInterface {

      protected $file;

      public function __construct($file) {
        $this->file = $file;
      }

      public function findFile($class) {
        return $this->file;
      }
    };
  }
205593
private function searchExtensions($path)
    {
        foreach ($this->fileExtensions as $ext) {
            if (file_exists($path . $ext)) {
                return $path . $ext;
            }
        }

        return false;
    }
608513
public function filesFrom($folder, $extension)
    {

        $all_files  = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($folder));
        $files = new \RegexIterator($all_files, '/\.'.$extension.'$/');
        $fileList = array();
        foreach ($files as $file) {
            $fileList[$file->getPathName()]['path'] = $file->getPathName();
            $fileList[$file->getPathName()]['name'] = $file->getFileName();
        }
        return $fileList;
    }
313762
protected function filesExist($dir, $file)
    {
        if (!file_exists($dir)) {
            return false;
        }

        $full_path = rtrim($dir, DS) . DS . ltrim($file, DS);

        try {
            $files = glob($full_path);

            $files_found = ! empty($files);
        } catch (\Exception $ex) {
            Tlog::getInstance()->addError($ex->getMessage());

            $files_found = false;
        }

        return $files_found;
    }
271073
public static String getExtension(String file)
    {
        Check.notNull(file);

        String ext = Constant.EMPTY_STRING;
        final int i = file.lastIndexOf(Constant.DOT);
        if (i >= 0 && i < file.length() - 1)
        {
            ext = file.substring(i + 1).toLowerCase(Locale.ENGLISH);
        }
        return ext;
    }
131027
public function findFallbackAsset($asset, $Folder = null)
    {
        $folderEmpty = empty($Folder);
        $folderAllowFallback = ! empty($Folder) && $Folder->getFallback();

        if ($folderEmpty || $folderAllowFallback) {
            $fallbackPath = $this->engine->getDirectory();

            $fallbackPath = $this->removeViewFromPath($fallbackPath);
            if (file_exists($fallbackPath . DS . $asset)) {
                $this->createSymlink($fallbackPath);

                return '/' . $this->assetDir . '/' . $this->asset['asset'];
            }
        }

        return false;
    }
729988
public static function existsFolder(String $file) : Bool
    {
        $file = self::rpath($file);

        if( is_dir($file) )
        {
            return true;
        }

        return false;
    }
616419
public static function get(
        $file
    ) {
        if (is_string($file)) {
            $file = new \SplFileInfo($file);
        }

        $extension = mb_strtolower($file->getExtension());
        if ('' === $extension) {
            return static::MIME_TYPE_IF_UNKNOWN;
        }

        if (array_key_exists($extension, static::$mimeTypes)) {
            return static::$mimeTypes[$extension];
        }

        if (function_exists('finfo_open') && $file->isFile()) {
            $path = $file->getPath();

            $fileInfo = finfo_open(FILEINFO_MIME);
            $mimeType = finfo_file($fileInfo, $path);
            finfo_close($fileInfo);

            return $mimeType;
        }

        return static::MIME_TYPE_IF_UNKNOWN;
    }
574267
private function getExtension(string $file): ?string
    {
        $explodedFile = \explode('.', $file);
        $format       = $explodedFile[\count($explodedFile) - 1];
        $cleanFormat  = \explode('?', $format);

        return $cleanFormat[0];
    }
1374348
public static function addExtension(string $file, string $extension)
    {
        if (substr($file, strlen($extension) * -1) !== $extension) {
            $file .= $extension;
        }
        return $file;
    }
497023
public static function getExtension($file){

		$file = trim($file);
		$extension = strtolower(substr(strrchr($file, '.'), 1));

		if($extension == $file){

			return '';
		}
		else{

			return $extension;
		}
	}
710732
public static function extension($file, $separator = self::SEPARATOR_BOTH){
        return self::validate($file, $separator) ? substr($file, strrpos($file, '.') + 1) : false;
    }
791686
protected static function _getExtension($file) {
		$pieces = explode('.', $file);
		$ext = strtolower(array_pop($pieces));
		return $ext;
	}
1066152
protected function getImageSizeByExtension($file, $extension)
	{
		$extension = strtolower($extension);
		$this->loadExtension($extension);
		if (isset($this->classMap[$extension]))
		{
			$this->classMap[$extension]->getSize($file);
		}
	}
756515
public function findFile($filePath)
    {
        if (file_exists($filePath)) {
            return $filePath;
        }
        foreach ($this->supportedExtensions as $extension)
        {
            $extendedFilePath = $filePath.'.'.$extension;
            if (file_exists($extendedFilePath)) {
                return $extendedFilePath;
            }
            $extendedFilePath = $filePath.'.'.strtoupper($extension);
            if (file_exists($extendedFilePath)) {
                return $extendedFilePath;
            }
            $extendedFilePath = $filePath.'.'.ucfirst($extension);
            if (file_exists($extendedFilePath)) {
                return $extendedFilePath;
            }
        }
        return null;
    }
1306358
protected function hasExtension(SplFileInfo $file): bool
    {
        if ($this->extension === null) {
            return true;
        }

        return strtolower($file->getExtension()) === strtolower($this->extension);
    }