Refactored code and implemented parts of AccessManagement

This commit is contained in:
Kevin Frantz
2019-04-13 20:12:32 +02:00
parent 67d753d9ef
commit 74aad46978
25 changed files with 412 additions and 372 deletions

View File

@@ -13,9 +13,9 @@ final class FormClassNameService implements FormClassNameServiceInterface
const ENTITY_BASE_PATH = 'Infinito\\Entity';
/**
* @var string Folder in which the forms are stored
* @var string Folder in which the forms for entities are stored
*/
const FORM_BASE_PATH = 'Infinito\\Form';
const FORM_ENTITY_BASE_PATH = 'Infinito\\Form\\Entity';
/**
* @var string Suffix to identifie form classes
@@ -29,7 +29,7 @@ final class FormClassNameService implements FormClassNameServiceInterface
*/
public function getClass(string $origineClass, string $type = ''): string
{
$replaced = str_replace(self::ENTITY_BASE_PATH, self::FORM_BASE_PATH, $origineClass);
$replaced = str_replace(self::ENTITY_BASE_PATH, self::FORM_ENTITY_BASE_PATH, $origineClass);
$withType = $replaced.ucfirst($type);
$withSuffix = $withType.self::SUFFIX;