mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2024-12-04 23:17:19 +01:00
Optimized class
This commit is contained in:
parent
64be819f51
commit
65e2fc03d0
@ -2,12 +2,10 @@
|
||||
|
||||
namespace Infinito\Domain\ParameterManagement;
|
||||
|
||||
use Infinito\Domain\ParameterManagement\Parameter\ParameterInterface;
|
||||
use HaydenPierce\ClassFinder\ClassFinder;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use PhpCollection\CollectionInterface;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Infinito\Domain\ParameterManagement\Parameter\AbstractParameter;
|
||||
use HaydenPierce\ClassFinder\ClassFinder;
|
||||
use Infinito\Domain\ParameterManagement\Parameter\ParameterInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@ -20,17 +18,19 @@ final class ParameterFactory implements ParameterFactoryInterface
|
||||
const PARAMETER_NAMESPACE = 'Infinito\Domain\ParameterManagement\Parameter';
|
||||
|
||||
/**
|
||||
* @var ArrayCollection|CollectionInterface|ParameterInterface[]
|
||||
* @var ArrayCollection|Collection|ParameterInterface[]
|
||||
*/
|
||||
private $parameters;
|
||||
|
||||
private function initPossible(string $class)
|
||||
/**
|
||||
* @param string $class
|
||||
*
|
||||
* @return bool True if an initialisation of the class is possible
|
||||
*/
|
||||
private function initPossible(string $class): bool
|
||||
{
|
||||
if (AbstractParameter::class === $class) {
|
||||
return false;
|
||||
}
|
||||
$reflectionClass = new \ReflectionClass($class);
|
||||
if ($reflectionClass->isInterface()) {
|
||||
if ($reflectionClass->isAbstract() || $reflectionClass->isInterface()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user