diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-04 17:50:34 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-04 17:50:34 +0200 |
commit | 46b77928f746a4231d064774b5b67fd892c7ce86 (patch) | |
tree | e3ea690b3f0def1744ddae758923cf92171ef985 /vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php | |
parent | 68abd9c71b1d2f7bb2e9d21819584d1d15005b25 (diff) | |
download | wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.gz wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.zst wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.zip |
rm vendor
Diffstat (limited to 'vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php')
-rw-r--r-- | vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php deleted file mode 100644 index 950f677f..00000000 --- a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Form\Tests\Fixtures; | ||
13 | |||
14 | /** | ||
15 | * This class is a hand written simplified version of PHP native `ArrayObject` | ||
16 | * class, to show that it behaves differently than the PHP native implementation. | ||
17 | */ | ||
18 | class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable | ||
19 | { | ||
20 | private $array; | ||
21 | |||
22 | public function __construct(array $array = null) | ||
23 | { | ||
24 | $this->array = $array ?: array(); | ||
25 | } | ||
26 | |||
27 | public function offsetExists($offset) | ||
28 | { | ||
29 | return array_key_exists($offset, $this->array); | ||
30 | } | ||
31 | |||
32 | public function offsetGet($offset) | ||
33 | { | ||
34 | return $this->array[$offset]; | ||
35 | } | ||
36 | |||
37 | public function offsetSet($offset, $value) | ||
38 | { | ||
39 | if (null === $offset) { | ||
40 | $this->array[] = $value; | ||
41 | } else { | ||
42 | $this->array[$offset] = $value; | ||
43 | } | ||
44 | } | ||
45 | |||
46 | public function offsetUnset($offset) | ||
47 | { | ||
48 | unset($this->array[$offset]); | ||
49 | } | ||
50 | |||
51 | public function getIterator() | ||
52 | { | ||
53 | return new \ArrayIterator($this->array); | ||
54 | } | ||
55 | |||
56 | public function count() | ||
57 | { | ||
58 | return count($this->array); | ||
59 | } | ||
60 | |||
61 | public function serialize() | ||
62 | { | ||
63 | return serialize($this->array); | ||
64 | } | ||
65 | |||
66 | public function unserialize($serialized) | ||
67 | { | ||
68 | $this->array = (array) unserialize((string) $serialized); | ||
69 | } | ||
70 | } | ||