src/engines/class-twig-engine.php
public function add_extension( Twig_ExtensionInterface $extension ) {
		$env  = $this->instance();
		$exts = $env->getExtensions();

		if ( isset( $exts[$extension->getName()] ) ) {
			return;
		}

		try {
			$env->addExtension( $extension );
		} catch ( LogicException $e ) {
			return;
		}
	}
public function add_extension( Twig_ExtensionInterface $extension ) {
		$env  = $this->instance();
		$exts = $env->getExtensions();

		if ( isset( $exts[$extension->getName()] ) ) {
			return;
		}

		try {
			$env->addExtension( $extension );
		} catch ( LogicException $e ) {
			return;
		}
	}
public function add_extension ( Twig_ExtensionInterface $ extension ) { $ env = $ this -> instance ( ) ; $ exts = $ env -> getExtensions ( ) ; if ( isset ( $ exts [ $ extension -> getName ( ) ] ) ) { return ; } try { $ env -> addExtension ( $ extension ) ; } catch ( LogicException $ e ) { return ; } }
Add extension if it don't exists.

@param \Twig_ExtensionInterface $extension
Add extension if it don t exists .