Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 399 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Database\Eloquent\Casts;
4
 
5
use ArrayObject as BaseArrayObject;
6
use Illuminate\Contracts\Support\Arrayable;
7
use JsonSerializable;
8
 
399 lars 9
/**
10
 * @template TKey of array-key
11
 * @template TItem
991 lars 12
 *
399 lars 13
 * @extends  \ArrayObject<TKey, TItem>
14
 */
148 lars 15
class ArrayObject extends BaseArrayObject implements Arrayable, JsonSerializable
16
{
17
    /**
18
     * Get a collection containing the underlying array.
19
     *
20
     * @return \Illuminate\Support\Collection
21
     */
22
    public function collect()
23
    {
24
        return collect($this->getArrayCopy());
25
    }
26
 
27
    /**
28
     * Get the instance as an array.
29
     *
30
     * @return array
31
     */
32
    public function toArray()
33
    {
34
        return $this->getArrayCopy();
35
    }
36
 
37
    /**
38
     * Get the array that should be JSON serialized.
39
     *
40
     * @return array
41
     */
42
    public function jsonSerialize(): array
43
    {
44
        return $this->getArrayCopy();
45
    }
46
}