ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
RenamingDIC.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
28 class RenamingDIC implements \ArrayAccess
29 {
30  protected int $counter = 0;
31 
32  public function __construct(
33  protected \ArrayAccess $wrapped
34  ) {
35  }
36 
37  public function offsetSet($id, $value): void
38  {
39  $id = "{$id}_{$this->counter}";
40  $this->counter++;
41  $this->wrapped->offsetSet($id, $value);
42  }
43 
44  public function offsetGet($id): mixed
45  {
46  return $this->wrapped->offsetGet($id);
47  }
48 
49  public function offsetExists($id): bool
50  {
51  return $this->wrapped->offsetExists($id);
52  }
53 
54  public function offsetUnset($id): void
55  {
56  $this->wrapped->offsetUnset($id);
57  }
58 }
__construct(protected \ArrayAccess $wrapped)
Definition: RenamingDIC.php:32
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
A wrapper around another DIC that superficially adds a _# and passes them to an underlying DIC...
Definition: RenamingDIC.php:28