| Total Complexity | 3 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class ResourceConsumptionTable extends Widget |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var Server |
||
| 16 | */ |
||
| 17 | public $model; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var QuantityFormatterFactoryInterface|QuantityFormatterFactory |
||
| 21 | */ |
||
| 22 | private $quantityFormatterFactory; |
||
| 23 | |||
| 24 | public function __construct(QuantityFormatterFactoryInterface $quantityFormatterFactory, array $config = []) |
||
| 25 | { |
||
| 26 | parent::__construct($config); |
||
| 27 | $this->quantityFormatterFactory = $quantityFormatterFactory; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function run(): string |
||
| 31 | { |
||
| 32 | return $this->render('ResourceConsumptionTable', [ |
||
| 33 | 'model' => $this->model, |
||
| 34 | ]); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function getFormatted(Consumption $model, ?string $currentQuantity): string |
||
| 65 | } |
||
| 66 | } |
||
| 67 | |||
| 68 |