Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function addAttachment($filePath, $preventOriginal = false) |
||
40 | { |
||
41 | $fileName = basename($filePath); |
||
42 | $media = $this->addMedia($filePath) |
||
43 | ->usingFileName('Transaction_'.$this->id.'_'.$fileName); |
||
44 | |||
45 | if ($preventOriginal) { |
||
46 | $media->preservingOriginal(); |
||
47 | } |
||
48 | |||
49 | $media->toCollection('attachments'); |
||
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@property
annotation 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.