ArrayObject.php
1 month ago
AsArrayObject.php
1 month ago
AsCollection.php
1 month ago
AsEncryptedArrayObject.php
1 month ago
AsEncryptedCollection.php
1 month ago
AsEnumArrayObject.php
1 month ago
AsEnumCollection.php
1 month ago
AsStringable.php
1 month ago
Attribute.php
1 month ago
ArrayObject.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWPSCOPED\Illuminate\Database\Eloquent\Casts; |
| 4 | |
| 5 | use ArrayObject as BaseArrayObject; |
| 6 | use IAWPSCOPED\Illuminate\Contracts\Support\Arrayable; |
| 7 | use JsonSerializable; |
| 8 | /** |
| 9 | * @template TKey of array-key |
| 10 | * @template TItem |
| 11 | * |
| 12 | * @extends \ArrayObject<TKey, TItem> |
| 13 | * @internal |
| 14 | */ |
| 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 \IAWPSCOPED\collect($this->getArrayCopy()); |
| 25 | } |
| 26 | /** |
| 27 | * Get the instance as an array. |
| 28 | * |
| 29 | * @return array |
| 30 | */ |
| 31 | public function toArray() |
| 32 | { |
| 33 | return $this->getArrayCopy(); |
| 34 | } |
| 35 | /** |
| 36 | * Get the array that should be JSON serialized. |
| 37 | * |
| 38 | * @return array |
| 39 | */ |
| 40 | public function jsonSerialize() : array |
| 41 | { |
| 42 | return $this->getArrayCopy(); |
| 43 | } |
| 44 | } |
| 45 |