-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from lepidus/stable-3_3_0
Feature/added work exists validation (OMP 3.3.0)
- Loading branch information
Showing
96 changed files
with
1,746 additions
and
4,671 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
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
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
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
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,45 @@ | ||
<?php | ||
|
||
/** | ||
* @file plugins/generic/thoth/tests/classes/container/Container.inc.php | ||
* | ||
* Copyright (c) 2025 Lepidus Tecnologia | ||
* Copyright (c) 2025 Thoth | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class Container | ||
* @ingroup plugins_generic_thoth | ||
* | ||
* @brief Simple dependency injection container implementation | ||
*/ | ||
|
||
class Container | ||
{ | ||
private $bindings = []; | ||
|
||
public function set($id, $factory) | ||
{ | ||
$this->bindings[$id] = $factory; | ||
} | ||
|
||
public function get($id) | ||
{ | ||
if (!isset($this->bindings[$id])) { | ||
throw new Exception("Target binding \"$id\" does not exist."); | ||
} | ||
|
||
$factory = $this->bindings[$id]; | ||
|
||
return $factory($this); | ||
} | ||
|
||
public function backup($id) | ||
{ | ||
return $this->bindings[$id]; | ||
} | ||
|
||
public function register($containerProvider) | ||
{ | ||
$containerProvider->register($this); | ||
} | ||
} |
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,19 @@ | ||
<?php | ||
|
||
/** | ||
* @file plugins/generic/thoth/tests/classes/container/ContainerProvider.inc.php | ||
* | ||
* Copyright (c) 2025 Lepidus Tecnologia | ||
* Copyright (c) 2025 Thoth | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class ContainerProvider | ||
* @ingroup plugins_generic_thoth | ||
* | ||
* @brief Interface to package container bindings | ||
*/ | ||
|
||
interface ContainerProvider | ||
{ | ||
public function register($container); | ||
} |
Oops, something went wrong.