[ Index ]

PHP Cross Reference of phpBB-3.3.7-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-2021 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): bool
  50      {
  51          return isset($this->collection[$offset]);
  52      }
  53  
  54      /**
  55      * @param  string|integer $offset
  56      * @return mixed
  57      */
  58      #[\ReturnTypeWillChange]
  59  	public function offsetGet($offset)
  60      {
  61          return $this->collection[$offset];
  62      }
  63  
  64      /**
  65      * @param  string|integer $offset
  66      * @param  mixed          $value
  67      * @return void
  68      */
  69  	public function offsetSet($offset, $value): void
  70      {
  71          $this->collection[$offset] = $value;
  72      }
  73  
  74      /**
  75      * @param  string|integer $offset
  76      * @return void
  77      */
  78  	public function offsetUnset($offset): void
  79      {
  80          unset($this->collection[$offset]);
  81      }
  82  
  83      //==========================================================================
  84      // Countable
  85      //==========================================================================
  86  
  87      /**
  88      * @return integer
  89      */
  90  	public function count(): int
  91      {
  92          return count($this->collection);
  93      }
  94  
  95      //==========================================================================
  96      // Iterator
  97      //==========================================================================
  98  
  99      /**
 100      * @return mixed
 101      */
 102      #[\ReturnTypeWillChange]
 103  	public function current()
 104      {
 105          return $this->collection->current();
 106      }
 107  
 108      /**
 109      * @return string|integer
 110      */
 111      #[\ReturnTypeWillChange]
 112  	public function key()
 113      {
 114          return $this->collection->key();
 115      }
 116  
 117      /**
 118      * @return mixed
 119      */
 120      #[\ReturnTypeWillChange]
 121  	public function next()
 122      {
 123          return $this->collection->next();
 124      }
 125  
 126      /**
 127      * @return void
 128      */
 129  	public function rewind(): void
 130      {
 131          $this->collection->rewind();
 132      }
 133  
 134      /**
 135      * @return boolean
 136      */
 137  	public function valid(): bool
 138      {
 139          return $this->collection->valid();
 140      }
 141  }


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