protected function ensureExt(string $path, string $ext): string
	{
		if ($ext)
		{
			$ext = '.' . $ext;

			if (substr($path, -strlen($ext)) !== $ext)
			{
				$path .= $ext;
			}
		}

		return $path;
	}
protected function ensureExt(string $path, string $ext): string
	{
		if ($ext)
		{
			$ext = '.' . $ext;

			if (substr($path, -strlen($ext)) !== $ext)
			{
				$path .= $ext;
			}
		}

		return $path;
	}
protected function ensureExt ( string $ path , string $ ext ) : string { if ( $ ext ) { $ ext = '.' . $ ext ; if ( substr ( $ path , - strlen ( $ ext ) ) !== $ ext ) { $ path .= $ ext ; } } return $ path ; }
Ensures a extension is at the end of a filename

@param string $path
@param string $ext

@return string
Ensures a extension is at the end of a filename