Loading src/Options/ModuleOptions.php +2 −2 Original line number Diff line number Diff line Loading @@ -86,9 +86,9 @@ class ModuleOptions extends AbstractOptions $tableauxBord = []; foreach ($options as $tblName => $tblOptions) { $tableauBord = new TableauBord(); $tableauBord = new TableauBord($container); $tableauBord->setName($tblName); $tableauBord->loadOptions($tblOptions, $container); $tableauBord->loadOptions($tblOptions); $tableauxBord[$tableauBord->getName()] = $tableauBord; } Loading src/TableauBord.php +28 −12 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ class TableauBord protected int $order = 0; protected string $processName; protected ?ProcessInterface $process = null; private float $timingBegin = 0.0; Loading @@ -35,6 +37,15 @@ class TableauBord public function __construct( private readonly ContainerInterface $__container, ) { } public function getName(): ?string { return $this->name; Loading Loading @@ -72,6 +83,7 @@ class TableauBord } public function onAction(string $action, ?int $progress = null, ?int $total = null) { if (null !== $this->onAction) { Loading Loading @@ -105,6 +117,19 @@ class TableauBord public function getProcess(): ?ProcessInterface { if (!$this->process) { $processName = $this->processName; if (!$this->__container->has($processName)) { $processName = 'unicaen-tbl.process.' . $processName; } if (!$this->__containertainer->has($processName)) { throw new \Exception('Le process "' . $processName . '" n\'est pas un service reconnu ou accessible via le container'); } /** @var ProcessInterface $process */ $process = $this->__container->get($processName); $this->process = $process; } return $this->process; } Loading Loading @@ -146,7 +171,7 @@ class TableauBord public function loadOptions(array $options, ContainerInterface $container): self public function loadOptions(array $options): self { if (array_key_exists('name', $options)) { $this->setName($options['name']); Loading @@ -157,16 +182,7 @@ class TableauBord } if (array_key_exists('process', $options)) { $processName = $options['process'] ?? null; if (!$container->has($processName)) { $processName = 'unicaen-tbl.process.' . $processName; } if (!$container->has($processName)) { throw new \Exception('Le process "' . $processName . '" n\'est pas un service reconnu ou accessible via le container'); } /** @var ProcessInterface $process */ $process = $container->get($processName); $this->setProcess($process); $this->processName = $options['process'] ?? null; } $this->options = $options; Loading Loading
src/Options/ModuleOptions.php +2 −2 Original line number Diff line number Diff line Loading @@ -86,9 +86,9 @@ class ModuleOptions extends AbstractOptions $tableauxBord = []; foreach ($options as $tblName => $tblOptions) { $tableauBord = new TableauBord(); $tableauBord = new TableauBord($container); $tableauBord->setName($tblName); $tableauBord->loadOptions($tblOptions, $container); $tableauBord->loadOptions($tblOptions); $tableauxBord[$tableauBord->getName()] = $tableauBord; } Loading
src/TableauBord.php +28 −12 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ class TableauBord protected int $order = 0; protected string $processName; protected ?ProcessInterface $process = null; private float $timingBegin = 0.0; Loading @@ -35,6 +37,15 @@ class TableauBord public function __construct( private readonly ContainerInterface $__container, ) { } public function getName(): ?string { return $this->name; Loading Loading @@ -72,6 +83,7 @@ class TableauBord } public function onAction(string $action, ?int $progress = null, ?int $total = null) { if (null !== $this->onAction) { Loading Loading @@ -105,6 +117,19 @@ class TableauBord public function getProcess(): ?ProcessInterface { if (!$this->process) { $processName = $this->processName; if (!$this->__container->has($processName)) { $processName = 'unicaen-tbl.process.' . $processName; } if (!$this->__containertainer->has($processName)) { throw new \Exception('Le process "' . $processName . '" n\'est pas un service reconnu ou accessible via le container'); } /** @var ProcessInterface $process */ $process = $this->__container->get($processName); $this->process = $process; } return $this->process; } Loading Loading @@ -146,7 +171,7 @@ class TableauBord public function loadOptions(array $options, ContainerInterface $container): self public function loadOptions(array $options): self { if (array_key_exists('name', $options)) { $this->setName($options['name']); Loading @@ -157,16 +182,7 @@ class TableauBord } if (array_key_exists('process', $options)) { $processName = $options['process'] ?? null; if (!$container->has($processName)) { $processName = 'unicaen-tbl.process.' . $processName; } if (!$container->has($processName)) { throw new \Exception('Le process "' . $processName . '" n\'est pas un service reconnu ou accessible via le container'); } /** @var ProcessInterface $process */ $process = $container->get($processName); $this->setProcess($process); $this->processName = $options['process'] ?? null; } $this->options = $options; Loading