misc: Update interface doc.

This commit is contained in:
Pol Dellaiera 2022-03-08 15:47:33 +01:00
parent 6ddbf35a7b
commit b8992b8eeb
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
2 changed files with 31 additions and 4 deletions

View File

@ -14,7 +14,7 @@ namespace Chill\DocGeneratorBundle\Context;
use Chill\DocGeneratorBundle\Context\Exception\ContextNotFoundException;
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
class ContextManager
final class ContextManager implements ContextManagerInterface
{
/**
* @var DocGeneratorContextInterface[]|iterable
@ -26,9 +26,6 @@ class ContextManager
$this->contexts = $contexts;
}
/**
* @throw ContextNotFoundException when the context is not found
*/
public function getContextByDocGeneratorTemplate(DocGeneratorTemplate $docGeneratorTemplate): DocGeneratorContextInterface
{
foreach ($this->contexts as $key => $context) {

View File

@ -0,0 +1,30 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\DocGeneratorBundle\Context;
use Chill\DocGeneratorBundle\Context\Exception\ContextNotFoundException;
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
interface ContextManagerInterface
{
/**
* @throws ContextNotFoundException When the context is not found.
*/
public function getContextByDocGeneratorTemplate(DocGeneratorTemplate $docGeneratorTemplate): DocGeneratorContextInterface;
/**
* @throws ContextNotFoundException When the context is not found.
*/
public function getContextByKey(string $searchedKey): DocGeneratorContextInterface;
public function getContexts(): array;
}