File tree Expand file tree Collapse file tree 7 files changed +10
-19
lines changed Expand file tree Collapse file tree 7 files changed +10
-19
lines changed Original file line number Diff line number Diff line change 3
3
4
4
namespace Selami \Entity ;
5
5
6
+ use Selami \Entity \Exception \InvalidArgumentException ;
6
7
use stdClass ;
7
8
use Selami \Entity \Interfaces \EntityInterface ;
8
- use Selami \Entity \Exception \UnexpectedValueException ;
9
9
10
10
trait EntityTrait
11
11
{
@@ -37,7 +37,7 @@ public function __unset($name)
37
37
public static function createFromJsonFile (string $ filePath , string $ id ) : EntityInterface
38
38
{
39
39
if (!file_exists ($ filePath )) {
40
- throw new UnexpectedValueException (sprintf ('Model definition file (%s) does not exist! ' , $ filePath ));
40
+ throw new InvalidArgumentException (sprintf ('Model definition file (%s) does not exist! ' , $ filePath ));
41
41
}
42
42
$ json = file_get_contents ($ filePath );
43
43
return static ::createFromJson ($ json , $ id );
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 5
5
6
6
use stdClass ;
7
7
use Opis \JsonSchema \Schema ;
8
- use Selami \Entity \Exception \UnexpectedValueException ;
8
+ use Selami \Entity \Exception \InvalidArgumentException ;
9
9
10
10
final class Model
11
11
{
@@ -41,7 +41,7 @@ public function getSchema(?stdClass $model = null) : Schema
41
41
public static function createFromJsonFile (string $ filePath ) : Model
42
42
{
43
43
if (!file_exists ($ filePath )) {
44
- throw new UnexpectedValueException (sprintf ('Model definition file (%s) does not exist! ' , $ filePath ));
44
+ throw new InvalidArgumentException (sprintf ('Model definition file (%s) does not exist! ' , $ filePath ));
45
45
}
46
46
return new static (file_get_contents ($ filePath ));
47
47
}
Original file line number Diff line number Diff line change 4
4
namespace Selami \Entity ;
5
5
6
6
use stdClass ;
7
- use Selami \Entity \Exception \UnexpectedValueException ;
7
+ use Selami \Entity \Exception \InvalidArgumentException ;
8
8
use Selami \Entity \Exception \BadMethodCallException ;
9
9
use Selami \Entity \Interfaces \ValueObjectInterface ;
10
10
@@ -32,7 +32,7 @@ final public function __unset($name)
32
32
public static function createFromJsonFile (string $ filePath , stdClass $ data ) : ValueObjectInterface
33
33
{
34
34
if (!file_exists ($ filePath )) {
35
- throw new UnexpectedValueException (sprintf ('Model definition file (%s) does not exist! ' , $ filePath ));
35
+ throw new InvalidArgumentException (sprintf ('Model definition file (%s) does not exist! ' , $ filePath ));
36
36
}
37
37
$ json = file_get_contents ($ filePath );
38
38
return static ::createFromJson ($ json , $ data );
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ public function shouldFailForRequiredInput() : void
111
111
112
112
/**
113
113
* @test
114
- * @expectedException \Selami\Entity\Exception\UnexpectedValueException
114
+ * @expectedException \Selami\Entity\Exception\InvalidArgumentException
115
115
*/
116
116
public function shouldFailForAModelFileDoesNotExist () : void
117
117
{
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
use Selami \Entity \Model ;
4
- use Selami \Entity \Exception \UnexpectedValueException ;
4
+ use Selami \Entity \Exception \InvalidArgumentException ;
5
5
6
6
class ModelTest extends \Codeception \Test \Unit
7
7
{
@@ -40,7 +40,7 @@ public function shouldReturnModelObjectSuccessfully() : void
40
40
41
41
/**
42
42
* @test
43
- * @expectedException UnexpectedValueException
43
+ * @expectedException InvalidArgumentException
44
44
*/
45
45
public function shouldFailForAFileThatDoesNotExist () : void
46
46
{
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ public function shouldFailForRequiredInput() : void
135
135
136
136
/**
137
137
* @test
138
- * @expectedException \Selami\Entity\Exception\UnexpectedValueException
138
+ * @expectedException \Selami\Entity\Exception\InvalidArgumentException
139
139
*/
140
140
public function shouldFailForAModelFileDoesNotExist () : void
141
141
{
You can’t perform that action at this time.
0 commit comments