Completed
Pull Request — master (#95)
by
unknown
05:41
created

MemoryWidgetFactory::createContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
3
namespace eXpansion\Bundle\Acme\Plugins\Gui;
4
5
use eXpansion\Framework\Core\Model\Gui\ManialinkInterface;
6
use eXpansion\Framework\Core\Model\Gui\Widget;
7
use eXpansion\Framework\Core\Plugins\Gui\WidgetFactory;
8
use eXpansion\Framework\Core\Plugins\Gui\WindowFactory as BaseWindowFactory;
9
use eXpansion\Framework\Gui\Components\uiButton;
10
use eXpansion\Framework\Gui\Components\uiCheckbox;
11
use eXpansion\Framework\Gui\Components\uiDropdown;
12
use eXpansion\Framework\Gui\Components\uiLabel;
13
use eXpansion\Framework\Gui\Components\uiLine;
14
use eXpansion\Framework\Gui\Components\uiTooltip;
15
use eXpansion\Framework\Gui\Layouts\layoutLine;
16
use eXpansion\Framework\Gui\Layouts\layoutRow;
17
use FML\Controls\Label;
18
use FML\Controls\Quad;
19
20
class MemoryWidgetFactory extends WidgetFactory
21
{
22
23
    protected $memoryMessage = "";
24
25
    protected function createContent(ManialinkInterface $manialink)
26
    {
27
        parent::createContent($manialink);
28
        $this->memoryMessage = new Label();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \FML\Controls\Label() of type object<FML\Controls\Label> is incompatible with the declared type string of property $memoryMessage.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
29
        $this->memoryMessage->setTextPrefix('$s')->setText("waiting data...");
30
31
        $manialink->getContentFrame()->setScale(0.8)->setPosition(160, -130);
32
        $manialink->addChild($this->memoryMessage);
33
34
    }
35
36
    public function setMemory($msg)
37
    {
38
        $this->memoryMessage->setText($msg);
0 ignored issues
show
Bug introduced by
The method setText cannot be called on $this->memoryMessage (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
39
    }
40
41
}
42