File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change 14
14
15
15
16
16
/**
17
- * Creates a representation based on reflection.
17
+ * Creates a representations based on reflection or source code .
18
18
*/
19
19
final class Factory
20
20
{
Original file line number Diff line number Diff line change @@ -49,12 +49,7 @@ public function getMethods(): array
49
49
50
50
public function getMethod (string $ name ): Method
51
51
{
52
- $ m = $ this ->methods [strtolower ($ name )] ?? null ;
53
- if (!$ m ) {
54
- throw new Nette \InvalidArgumentException ("Method ' $ name' not found. " );
55
- }
56
-
57
- return $ m ;
52
+ return $ this ->methods [strtolower ($ name )] ?? throw new Nette \InvalidArgumentException ("Method ' $ name' not found. " );
58
53
}
59
54
60
55
Original file line number Diff line number Diff line change @@ -44,11 +44,7 @@ public function getProperties(): array
44
44
45
45
public function getProperty (string $ name ): Property
46
46
{
47
- if (!isset ($ this ->properties [$ name ])) {
48
- throw new Nette \InvalidArgumentException ("Property ' $ name' not found. " );
49
- }
50
-
51
- return $ this ->properties [$ name ];
47
+ return $ this ->properties [$ name ] ?? throw new Nette \InvalidArgumentException ("Property ' $ name' not found. " );
52
48
}
53
49
54
50
You can’t perform that action at this time.
0 commit comments