[ Index ]

PHP Cross Reference of phpBB-3.3.3-deutsch

title

Body

[close]

/vendor/s9e/text-formatter/src/Configurator/Traits/ -> CollectionProxy.php (source)

   1  <?php
   2  
   3  /**
   4  * @package   s9e\TextFormatter
   5  * @copyright Copyright (c) 2010-2020 The s9e authors
   6  * @license   http://www.opensource.org/licenses/mit-license.php The MIT License
   7  */
   8  namespace s9e\TextFormatter\Configurator\Traits;
   9  
  10  /**
  11  * Allows an object to act as a proxy for a NormalizedCollection stored in $this->collection
  12  *
  13  * @property \s9e\TextFormatter\Collections\NormalizedCollection $collection
  14  *
  15  * @method mixed   add(string $key, mixed $value)
  16  * @method array   asConfig()
  17  * @method bool    contains(mixed $value)
  18  * @method void    delete(string $key)
  19  * @method bool    exists(string $key)
  20  * @method mixed   get(string $key)
  21  * @method mixed   indexOf(mixed $value)
  22  * @method string  normalizeKey(string $key)
  23  * @method mixed   normalizeValue(mixed $value)
  24  * @method string  onDuplicate(string $action)
  25  * @method mixed   set(string $key, mixed $value)
  26  */
  27  trait CollectionProxy
  28  {
  29      /**
  30      * Forward all unknown method calls to $this->collection
  31      *
  32      * @param  string $methodName
  33      * @param  array  $args
  34      * @return mixed
  35      */
  36  	public function __call($methodName, $args)
  37      {
  38          return call_user_func_array([$this->collection, $methodName], $args);
  39      }
  40  
  41      //==========================================================================
  42      // ArrayAccess
  43      //==========================================================================
  44  
  45      /**
  46      * @param  string|integer $offset
  47      * @return bool
  48      */
  49  	public function offsetExists($offset)
  50      {
  51          return isset($this->collection[$offset]);
  52      }
  53  
  54      /**
  55      * @param  string|integer $offset
  56      * @return mixed
  57      */
  58  	public function offsetGet($offset)
  59      {
  60          return $this->collection[$offset];
  61      }
  62  
  63      /**
  64      * @param  string|integer $offset
  65      * @param  mixed          $value
  66      * @return void
  67      */
  68  	public function offsetSet($offset, $value)
  69      {
  70          $this->collection[$offset] = $value;
  71      }
  72  
  73      /**
  74      * @param  string|integer $offset
  75      * @return void
  76      */
  77  	public function offsetUnset($offset)
  78      {
  79          unset($this->collection[$offset]);
  80      }
  81  
  82      //==========================================================================
  83      // Countable
  84      //==========================================================================
  85  
  86      /**
  87      * @return integer
  88      */
  89  	public function count()
  90      {
  91          return count($this->collection);
  92      }
  93  
  94      //==========================================================================
  95      // Iterator
  96      //==========================================================================
  97  
  98      /**
  99      * @return mixed
 100      */
 101  	public function current()
 102      {
 103          return $this->collection->current();
 104      }
 105  
 106      /**
 107      * @return string|integer
 108      */
 109  	public function key()
 110      {
 111          return $this->collection->key();
 112      }
 113  
 114      /**
 115      * @return mixed
 116      */
 117  	public function next()
 118      {
 119          return $this->collection->next();
 120      }
 121  
 122      /**
 123      * @return void
 124      */
 125  	public function rewind()
 126      {
 127          $this->collection->rewind();
 128      }
 129  
 130      /**
 131      * @return boolean
 132      */
 133  	public function valid()
 134      {
 135          return $this->collection->valid();
 136      }
 137  }


Generated: Sun Feb 14 20:08:31 2021 Cross-referenced by PHPXref 0.7.1