@param string $extension

@return string
5713
protected function createTempFilePath($extension)
    {
        $tempDirectory = $this->getTempDirectory();
        $uniqueId = uniqid('phantom-pdf-', true);

        $filePath = sprintf(
            '%s/%s.%s',
            $tempDirectory,
            $uniqueId,
            $extension
        );

        $this->tempFiles[] = $filePath;

        return $filePath;
    }
215343
protected function getFullClassToExtend($extend)
    {
        if (empty($extend)) {
            return '';
        }
        $appNamespace = Helpers::getAppNamespace();

        if (starts_with($extend, $appNamespace)) {
            $extend = str_replace($appNamespace, '', $extend);
        }

        return $appNamespace . trim($extend, '\\');
    }
324121
public function setExtension($extension)
    {
        if (! Str::startsWith($extension, '.')) {
            $extension = ".$extension";
        }

        $this->extension = $extension;

        return $this;
    }
85182
public function setExtension(string $extension) {
        if(!$this->setModified('extension', $extension)->isModified()) {
            return $this;
        }
		$this->extension = $extension;
		return $this;
    }
1136181
public function toMimeType($extension)
    {
        $extension = strtolower($extension);

        if (array_key_exists($extension, $this->dict)) {
            return $this->dict[$extension];
        }
    }
1074636
public function getTypeByExtension($extension)
    {
        if ($this->isValidExtension($extension)) {

            // We get back flipped copy
            $list = $this->getList(true);
            return $list[$extension];

        } else {

            // For all unknown extensions, the default Mime-Type is used
            return 'application/octet-stream';
        }
    }
856149
public static function includeFileExtension($fileName, $extension)
    {
        $fileExtension = self::getFileExtension($fileName, true);

        /*
         * File has given extension?
         * Nothing to do
         */
        if ($fileExtension === strtolower($extension)) {
            return $fileName;
        }

        return sprintf('%s.%s', $fileName, $extension);
    }
497023
public static function getExtension($file){

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

		if($extension == $file){

			return '';
		}
		else{

			return $extension;
		}
	}
1214724
public static function detectByFileExtension(string $extension): string
    {
        static $extToMimeTypeMap;

        if (! $extToMimeTypeMap) {
            $extToMimeTypeMap = static::getExtensionToMimeTypeMap();
        }

        if (isset($extToMimeTypeMap[$extension])) {
            return $extToMimeTypeMap[$extension];
        }

        return 'text/plain';
    }
106757
private function generateFilename($path, $extension)
    {
        $file = '';

        while (!$file || is_file($path.$file)) {
            $file = uniqid().'.'.$extension;
        }

        return $file;
    }
219128
public function getFilename($extension = '.php')
    {
        // If template is named,
        // return joined template names.
        if ($this->isNamed()) {
            return join('-', $this->file) . $extension;
        }

        // Use first template name, if template
        // file is an array, but is not named.
        if (is_array($this->file) && isset($this->file[0])) {
            return "{$this->file[0]}{$extension}";
        }

        return apply_filters('tonik/gin/template/filename', "{$this->file}{$extension}");
    }
465010
private function verifyExtension($extension)
    {
        $allowed = $this->config['allowed_extensions'];
        if (! empty($allowed) && ! in_array(strtolower($extension), $allowed)) {
            throw FileNotSupportedException::extensionRestricted(strtolower($extension), $allowed);
        }

        return $extension;
    }
1196593
protected function removeExtensionFromFilename($filename, $extension)
    {
        $extension = '.'.$extension;
        $extension_length = mb_strlen($filename) - mb_strlen($extension);
        if (mb_strrpos($filename, $extension) === $extension_length) {
            $filename = mb_substr($filename, 0, $extension_length);
        }

        return $filename;
    }
73402
public function getMimeTypes($extension)
    {
        if (!array_key_exists($extension, $this->extension_to_mime_types)) {
            return false;
        }

        return $this->extension_to_mime_types[$extension];
    }
872214
public function addExtension($extension = null)
    {
        if ($extension == null) {
            return $this->twigEnvironment->addExtension($this->twigDebug());
        }

        return $this->twigEnvironment->addExtension($extension);
    }
297389
public static function for_extensions($extensions)
    {
        foreach ($extensions as $extension) {
            if ($formatter = self::for_extension($extension)) {
                return $formatter;
            }
        }

        return false;
    }
213111
public static function detectByFileExtension($extension)
	{
		static $extensionToMimeTypeMap;

		if (!$extensionToMimeTypeMap)
		{
			$extensionToMimeTypeMap = static::getExtensionToMimeTypeMap();
		}

		if (isset($extensionToMimeTypeMap[$extension]))
		{
			return $extensionToMimeTypeMap[$extension];
		}
	}