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;
    }
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;
    }
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 ; }
Tries to find existing file with supported extension

@param $filePath
@return null|string
Tries to find existing file with supported extension