| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0263 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | 4 | public function addArgument($name, $type, $config = []) |
|
| 29 | { |
||
| 30 | 4 | if (!TypeMap::isInputType($type)) { |
|
| 31 | throw new ConfigurationException('Argument input type ' . $type . ' is not supported'); |
||
| 32 | } |
||
| 33 | |||
| 34 | 4 | $config['name'] = $name; |
|
| 35 | 4 | $config['type'] = is_string($type) ? TypeMap::getScalarTypeObject($type) : $type; |
|
| 36 | |||
| 37 | 4 | $this->arguments[$name] = new InputField($config); |
|
| 38 | |||
| 39 | 4 | return $this; |
|
| 40 | } |
||
| 41 | |||
| 71 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: