Textpattern PHP Cross Reference Content Management Systems

Source: /textpattern/vendors/Textpattern/Filter/FilterCallable.php - 55 lines - 1364 bytes - Summary - Text - Print

   1  <?php
   2  
   3  /*
   4   * Textpattern Content Management System
   5   * https://textpattern.com/
   6   *
   7   * Copyright (C) 2020 The Textpattern Development Team
   8   *
   9   * This file is part of Textpattern.
  10   *
  11   * Textpattern is free software; you can redistribute it and/or
  12   * modify it under the terms of the GNU General Public License
  13   * as published by the Free Software Foundation, version 2.
  14   *
  15   * Textpattern is distributed in the hope that it will be useful,
  16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18   * GNU General Public License for more details.
  19   *
  20   * You should have received a copy of the GNU General Public License
  21   * along with Textpattern. If not, see <https://www.gnu.org/licenses/>.
  22   */
  23  
  24  namespace Textpattern\Filter;
  25  
  26  /**
  27   * Callable filter.
  28   *
  29   * <code>
  30   * try {
  31   *     Txp::get('\Textpattern\Filter\FilterCallable', 'fn');
  32   * } catch (Textpattern\Filter\Exception $e) {
  33   *     echo $e->getMessage();
  34   * }
  35   * </code>
  36   *
  37   * @since   4.6.0
  38   * @package Filter
  39   */
  40  
  41  class FilterCallable extends \Textpattern\Type\TypeCallable
  42  {
  43      /**
  44       * {@inheritdoc}
  45       */
  46  
  47      public function __construct($callable)
  48      {
  49          if (!is_callable($callable)) {
  50              throw new \Textpattern\Filter\Exception(gTxt('assert_callable'));
  51          }
  52  
  53          parent::__construct($callable);
  54      }
  55  }

title

Description

title

Description

title

Description

title

title

Body