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 1414
1515
1616/**
17- * Creates a representation based on reflection.
17+ * Creates a representations based on reflection or source code .
1818 */
1919final class Factory
2020{
Original file line number Diff line number Diff line change @@ -49,12 +49,7 @@ public function getMethods(): array
4949
5050 public function getMethod (string $ name ): Method
5151 {
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. " );
5853 }
5954
6055
Original file line number Diff line number Diff line change @@ -44,11 +44,7 @@ public function getProperties(): array
4444
4545 public function getProperty (string $ name ): Property
4646 {
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. " );
5248 }
5349
5450
You can’t perform that action at this time.
0 commit comments