public static function addExtension(string $file, string $extension)
    {
        if (substr($file, strlen($extension) * -1) !== $extension) {
            $file .= $extension;
        }
        return $file;
    }
public static function addExtension(string $file, string $extension)
    {
        if (substr($file, strlen($extension) * -1) !== $extension) {
            $file .= $extension;
        }
        return $file;
    }
public static function addExtension ( string $ file , string $ extension ) { if ( substr ( $ file , strlen ( $ extension ) * - 1 ) !== $ extension ) { $ file .= $ extension ; } return $ file ; }
Checks if there is an extension and adds it if does not

@param string $file      File name
@param string $extension Extension (dot included)

@return string
Checks if there is an extension and adds it if does not