[ Index ]

PHP Cross Reference of phpBB-3.3.7-deutsch

title

Body

[close]

/vendor/s9e/text-formatter/src/Configurator/JavaScript/ -> Code.php (source)

   1  <?php
   2  
   3  /**
   4  * @package   s9e\TextFormatter
   5  * @copyright Copyright (c) 2010-2021 The s9e authors
   6  * @license   http://www.opensource.org/licenses/mit-license.php The MIT License
   7  */
   8  namespace s9e\TextFormatter\Configurator\JavaScript;
   9  
  10  use s9e\TextFormatter\Configurator\FilterableConfigValue;
  11  
  12  /**
  13  * Wrapper used to identify strings that should be treated as JavaScript source code
  14  */
  15  class Code implements FilterableConfigValue
  16  {
  17      /**
  18      * @var string JavaScript source code
  19      */
  20      public $code;
  21  
  22      /**
  23      * Constructor
  24      *
  25      * @param  string $code JavaScript source code
  26      */
  27  	public function __construct($code)
  28      {
  29          $this->code = $code;
  30      }
  31  
  32      /**
  33      * Return this source code
  34      *
  35      * @return string
  36      */
  37  	public function __toString()
  38      {
  39          return (string) $this->code;
  40      }
  41  
  42      /**
  43      * {@inheritdoc}
  44      */
  45  	public function filterConfig($target)
  46      {
  47          return ($target === 'JS') ? $this : null;
  48      }
  49  }


Generated: Thu Mar 24 21:31:15 2022 Cross-referenced by PHPXref 0.7.1