| Conditions | 6 |
| Paths | 12 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function run($request) |
||
| 40 | { |
||
| 41 | $addons = Addon::get(); |
||
| 42 | if ($request->getVar('addons')) { |
||
| 43 | $addons = $addons->filter('Name', explode(',', $request->getVar('addons'))); |
||
| 44 | } |
||
| 45 | foreach ($addons as $addon) { |
||
| 46 | if (!$addon->Name) { |
||
| 47 | $this->log(sprintf('Addon #%d as no name, skipping', $addon->ID)); |
||
| 48 | continue; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** @var Addon $addon */ |
||
| 52 | $this->log(sprintf('Building "%s" (#%d)', $addon->Name, $addon->ID)); |
||
|
|
|||
| 53 | try { |
||
| 54 | $this->builder->build($addon); |
||
| 55 | } catch (RuntimeException $e) { |
||
| 56 | $this->log('Error: ' . $e->getMessage()); |
||
| 57 | } |
||
| 58 | |||
| 59 | if ($addon->ID) { |
||
| 60 | $addon->BuildQueued = false; |
||
| 61 | $addon->write(); |
||
| 62 | } |
||
| 63 | } |
||
| 64 | } |
||
| 65 | |||
| 74 |
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.