[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

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

   1  <?php
   2  
   3  /*
   4  * @package   s9e\TextFormatter
   5  * @copyright Copyright (c) 2010-2019 The s9e Authors
   6  * @license   http://www.opensource.org/licenses/mit-license.php The MIT License
   7  */
   8  namespace s9e\TextFormatter\Configurator\JavaScript;
   9  class ConfigValue
  10  {
  11      protected $isDeduplicated = \false;
  12      protected $name;
  13      protected $useCount = 0;
  14      protected $value;
  15      protected $varName;
  16  	public function __construct($value, $varName)
  17      {
  18          $this->value   = $value;
  19          $this->varName = $varName;
  20      }
  21  	public function deduplicate()
  22      {
  23          if ($this->useCount > 1)
  24          {
  25              $this->isDeduplicated = \true;
  26              $this->decrementUseCount($this->useCount - 1);
  27          }
  28      }
  29  	public function getUseCount()
  30      {
  31          return $this->useCount;
  32      }
  33  	public function getValue()
  34      {
  35          return $this->value;
  36      }
  37  	public function getVarName()
  38      {
  39          return $this->varName;
  40      }
  41  	public function incrementUseCount()
  42      {
  43          ++$this->useCount;
  44      }
  45  	public function isDeduplicated()
  46      {
  47          return $this->isDeduplicated;
  48      }
  49  	protected function decrementUseCount($step = 1)
  50      {
  51          $this->useCount -= $step;
  52          foreach ($this->value as $value)
  53              if ($value instanceof ConfigValue)
  54                  $value->decrementUseCount($step);
  55      }
  56  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1