This repository has been archived by the owner on Aug 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update Wizard to use StageContainer instead of full container and use…
… autowiring and autoconfiguration. Also remove dependencies script
- Loading branch information
Showing
8 changed files
with
139 additions
and
1,762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Zikula package. | ||
* | ||
* Copyright Zikula Foundation - https://ziku.la/ | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Zikula\Component\Wizard; | ||
|
||
abstract class AbstractStageContainer implements StageContainerInterface | ||
{ | ||
private $stages; | ||
|
||
/** | ||
* @param StageInterface[] $stages | ||
*/ | ||
public function __construct(iterable $stages = []) | ||
{ | ||
$this->stages = []; | ||
foreach ($stages as $stage) { | ||
$this->add($stage); | ||
} | ||
} | ||
|
||
public function add(StageInterface $stage): void | ||
{ | ||
$this->stages[get_class($stage)] = $stage; | ||
} | ||
|
||
public function get(string $id): ?StageInterface | ||
{ | ||
return $this->stages[$id] ?? null; | ||
} | ||
|
||
public function has(string $id): bool | ||
{ | ||
return isset($this->stages[$id]); | ||
} | ||
|
||
public function all(): array | ||
{ | ||
return $this->stages; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Zikula package. | ||
* | ||
* Copyright Zikula Foundation - https://ziku.la/ | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Zikula\Component\Wizard; | ||
|
||
interface StageContainerInterface | ||
{ | ||
/** | ||
* @param StageInterface[] $stages | ||
*/ | ||
public function __construct(iterable $stages = []); | ||
|
||
public function add(StageInterface $stage): void; | ||
|
||
public function get(string $id): ?StageInterface; | ||
|
||
public function has(string $id): bool; | ||
|
||
public function all(): array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.