| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 4 | public function getEmbed() |
|
| 19 | { |
||
| 20 | 4 | $sourceClass = config("laravel-videoable.sources.{$this->source}"); |
|
|
|
|||
| 21 | |||
| 22 | 4 | if (class_exists($sourceClass) === false) { |
|
| 23 | 1 | throw new VideoPresenterNotFound($sourceClass); |
|
| 24 | } |
||
| 25 | |||
| 26 | 3 | return (new $sourceClass(get_object_vars($this)))->getEmbedCode(); |
|
| 27 | } |
||
| 28 | } |
||
| 29 |
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.