| Conditions | 7 |
| Paths | 17 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public static function parameterToSchema($parameter) |
||
| 28 | { |
||
| 29 | if ($parameter instanceof BodyParameter) { |
||
| 30 | return $parameter->schema; |
||
| 31 | } else { |
||
| 32 | /** @var BodyParameter|HeaderParameterSubSchema|FormDataParameterSubSchema|QueryParameterSubSchema|PathParameterSubSchema $schemaData */ |
||
| 33 | $schemaData = $parameter->export($parameter); |
||
| 34 | if (isset($schemaData->required) && !is_array($schemaData->required)) { |
||
| 35 | unset($schemaData->required); |
||
| 36 | } |
||
| 37 | if (isset($schemaData->in)) { |
||
| 38 | unset($schemaData->in); |
||
| 39 | } |
||
| 40 | if (isset($schemaData->name)) { |
||
| 41 | unset($schemaData->name); |
||
| 42 | } |
||
| 43 | if (isset($schemaData->collectionFormat)) { |
||
| 44 | unset($schemaData->collectionFormat); |
||
| 45 | } |
||
| 46 | |||
| 47 | |||
| 48 | return Schema::import($schemaData); |
||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 52 | } |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.