vendor/pimcore/pimcore/lib/Templating/HelperBroker/TemplatingHelper.php line 41

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Enterprise License (PEL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  * @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  * @license    http://www.pimcore.org/license     GPLv3 and PEL
  13.  */
  14. namespace Pimcore\Templating\HelperBroker;
  15. use Pimcore\Templating\PhpEngine;
  16. /**
  17.  * @deprecated
  18.  */
  19. class TemplatingHelper implements HelperBrokerInterface
  20. {
  21.     /**
  22.      * @inheritDoc
  23.      */
  24.     public function supports(PhpEngine $engine$method)
  25.     {
  26.         if ($engine->has($method)) {
  27.             return true;
  28.         }
  29.         return false;
  30.     }
  31.     /**
  32.      * Run or return a native view helper
  33.      *
  34.      * @inheritDoc
  35.      */
  36.     public function helper(PhpEngine $engine$method, array $arguments)
  37.     {
  38.         $helper $engine->get($method);
  39.         // helper implements __invoke -> run it directly
  40.         if (is_callable($helper)) {
  41.             return call_user_func_array($helper$arguments);
  42.         }
  43.         return $helper;
  44.     }
  45. }