[TASK] Re-work/simplify copyright header in PHP files - Part 8
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Reflection / Fixture / ArrayAccessClass.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 /**
17 * ArrayAccess class for the Reflection tests
18 *
19 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
20 */
21 class ArrayAccessClass implements \ArrayAccess {
22
23 protected $array = array();
24
25 /**
26 * @param array $array
27 */
28 public function __construct(array $array) {
29 $this->array = $array;
30 }
31
32 /**
33 * @param mixed $offset
34 * @return boolean
35 */
36 public function offsetExists($offset) {
37 return array_key_exists($offset, $this->array);
38 }
39
40 /**
41 * @param mixed $offset
42 * @return mixed
43 */
44 public function offsetGet($offset) {
45 return $this->array[$offset];
46 }
47
48 /**
49 * @param mixed $offset
50 * @param mixed $value
51 */
52 public function offsetSet($offset, $value) {
53 $this->array[$offset] = $value;
54 }
55
56 /**
57 * @param mixed $offset
58 */
59 public function offsetUnset($offset) {
60 unset($this->array[$offset]);
61 }
62 }