@param string $extension

@return \Sven\ArtisanView\Config
324121
public function setExtension($extension)
    {
        if (! Str::startsWith($extension, '.')) {
            $extension = ".$extension";
        }

        $this->extension = $extension;

        return $this;
    }
94991
public function setTypeFromExtension($extension)
    {
        if ( ! $this->checkExtension($extension) ) {
            throw new InvalidFileExtensionException("Invalid File Extension [{$extension}].");
        }

        $this->setSelectedType($extension);

        return $this;
    }
1047713
public function setExtension($extension = '.png')
    {
        if (substr($extension, 0, 1) != '.') {
            $extension = '.' . $extension;
        }

        $this->extension = $extension;

        return $this;
    }
218326
public function getMimetypeFromExtension($extension)
    {
        $extension = strtolower($extension);

        return isset($this->mimetypes[$extension])
            ? $this->mimetypes[$extension]
            : parent::getMimetypeFromExtension($extension);
    }
487901
public function get($extension)
    {
        if (null !== $extension && array_key_exists($extension, $this->map)) {
            return $this->map[$extension];
        }

        return $this->defaultMimeType();
    }
187848
public function setExtension($extension = null)
    {
        if (!$extension) {
            $this->_path['extension'] = null;
        } else {
            $this->_path['extension'] = (string) trim($extension, '.');
        }

        return $this;
    }
742309
public static function GetByExtension( string $extension ) : string
   {

      $normalizedExtension = \strtolower( \ltrim( $extension, '.' ) );

      if ( isset( static::$mimeTypes[ $normalizedExtension ] ) )
      {
         return static::$mimeTypes[ $normalizedExtension ];
      }

      return 'application/octet-stream';

   }
562703
public function loadExtension(Extension $extension, array $options = [], $safe = false)
    {
        $this->fire('f.extension.load', $extension, $options, $safe);

        return $this;
    }
6833
public function setTemplateExtension($extension)
    {
        $extension = (string) $extension;
        $extension = trim($extension);
        if ('.' == $extension[0]) {
            $extension = substr($extension, 1);
        }

        $this->extension = $extension;
    }
914445
public function extension($idExtension): ExtensionInterface
    {
        if ($this->hasExtension($idExtension) !== true) {
            throw new \OutOfBoundsException(sprintf('Extension "%s" not found.', $idExtension));
        }

        return $this->extensions[$idExtension];
    }
97642
protected function resolveRenderer(string $extension): RendererInterface
	{
		if(!isset($this->rendererInstances[$extension]))
		{
			$this->rendererInstances[$extension] = $this->rendererFactory($this->renderers[$extension]);
		}

		return $this->rendererInstances[$extension];
	}
1269467
public function configure(Listener $listener, Fluent $extension)
    {
        if (!Extension::started($extension->get('name'))) {
            return $listener->abortWhenRequirementMismatched();
        }
        $this->presenter->setCategory($this->category);

        $memory = Foundation::memory();

        $activeConfig = (array) $memory->get("extensions.active.{$extension->get('name')}.config", []);
        $baseConfig   = (array) $memory->get("extension_{$extension->get('name')}", []);


        $eloquent = new Fluent(array_merge($activeConfig, $baseConfig));

        $form = $this->presenter->configure($eloquent, $extension->get('name'));

        Event::fire("antares.form: extension.{$extension->get('name')}", [$eloquent, $form]);

        return $listener->showConfigurationChanger(compact('eloquent', 'form', 'extension'));
    }
1015710
private function linkConfig(ResolvedExtension $extension)
    {
        $file = $this->app['filesystem']->getFile(strtolower("extensions_config://{$extension->getName()}.{$extension->getVendor()}.yml"));
        if ($file->exists()) {
            return $this->app['url_generator']->generate('fileedit', ['namespace' => $file->getMountPoint(), 'file' => $file->getPath()]);
        }

        return null;
    }
679295
public function addExtension(ExtensionInterface $extension)
    {
        if (!in_array($extension, $this->extensions)) {
            $this->extensions[] = $extension;
            $options = Phug::getExtensionsOptions([$extension]);
            foreach ([$this, $this->getCompiler()] as $instance) {
                $instance->setOptionsRecursive($options);
            }

            $this->initCompiler();
        }
    }
1014133
protected function setHandlerByExtension($extension)
    {
        if (!in_array($extension, $this->file->supportedExtensions())) {
            throw new RuntimeException($this->translation->text('Unsupported file extension'));
        }

        return $this->handler = $this->file->getHandler(".$extension");
    }
1234971
public function withAllowedExtensions(array $extensions) {
		if (\is_array($extensions) && !empty($extensions)) {
			$extensions = \array_map('trim', $extensions);
			$extensions = \array_map('strtolower', $extensions);

			$this->allowedExtensions = $extensions;
		}

		return $this;
	}
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;
    }