mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Implemented Source Namespace factory
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace App\Creator\Factory\Form\Source;
|
||||
|
||||
use App\Entity\SourceInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class SourceFormFactory
|
||||
{
|
||||
const FORM_NAMESPACE = 'App\Form\\';
|
||||
|
||||
/**
|
||||
* @var SourceInterface
|
||||
*/
|
||||
private $source;
|
||||
|
||||
public function __construct(SourceInterface $source){
|
||||
$this->source = $source;
|
||||
}
|
||||
|
||||
public function getNamespace():string{
|
||||
return self::FORM_NAMESPACE.$this->getName();
|
||||
}
|
||||
|
||||
protected function getName(): string
|
||||
{
|
||||
$reflectionClass = new \ReflectionClass($this->source);
|
||||
return $reflectionClass->getShortName().'Type';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user