Skip to content

Commit 9aafe88

Browse files
committed
Remove "originals" from toArray Result
1 parent 5ada853 commit 9aafe88

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

stubs/Models/PHP7.0/Entity/Entity.stub

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ abstract class Entity implements JsonSerializable, Arrayable
7676
*/
7777
public function toArray(): array
7878
{
79-
return get_object_vars($this);
79+
$attributes = get_object_vars($this);
80+
81+
unset($attributes['originals']);
82+
83+
return $attributes;
8084
}
8185

8286
/**

stubs/Models/PHP7.4/Entity/Entity.stub

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ abstract class Entity implements JsonSerializable, Arrayable
7575
*/
7676
public function toArray(): array
7777
{
78-
return get_object_vars($this);
78+
$attributes = get_object_vars($this);
79+
80+
unset($attributes['originals']);
81+
82+
return $attributes;
7983
}
8084

8185
/**

stubs/Models/PHP8.0/Entity/Entity.stub

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ abstract class Entity implements JsonSerializable, Arrayable
7575
*/
7676
public function toArray(): array
7777
{
78-
return get_object_vars($this);
78+
$attributes = get_object_vars($this);
79+
80+
unset($attributes['originals']);
81+
82+
return $attributes;
7983
}
8084

8185
/**

0 commit comments

Comments
 (0)