File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ class Category
49
49
public function __construct (array $ data )
50
50
{
51
51
if (empty ($ data )) {
52
- return ;
52
+ throw new \ InvalidArgumentException ( ' You must provide an array with data. ' ) ;
53
53
}
54
54
55
55
$ this ->id = $ data ['id ' ];
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ class Media
28
28
29
29
public function __construct (array $ data = [])
30
30
{
31
- if (empty ($ data )) {
32
- return ;
31
+ if (empty ($ data ) || empty ( $ data [ ' source_url ' ]) ) {
32
+ throw new \ InvalidArgumentException ( ' You must provide an array with data. ' ) ;
33
33
}
34
34
35
35
$ this ->id = $ data ['id ' ];
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class MenuItem
24
24
public function __construct (array $ data = [])
25
25
{
26
26
if (empty ($ data )) {
27
- return ;
27
+ throw new \ InvalidArgumentException ( ' You must provide an array with data. ' ) ;
28
28
}
29
29
30
30
$ this ->id = (int ) $ data ['id ' ];
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ class Page
52
52
public function __construct (array $ data = [])
53
53
{
54
54
if (empty ($ data )) {
55
- return ;
55
+ throw new \ InvalidArgumentException ( ' You must provide an array with data. ' ) ;
56
56
}
57
57
58
58
// Set dates
You can’t perform that action at this time.
0 commit comments