feat(core) : move user entity into core module and repoint security/doctrine (temp legacy alias)
This commit is contained in:
@@ -8,6 +8,7 @@ use PhpCsFixer\Finder;
|
||||
$finder = Finder::create()
|
||||
->in('src')
|
||||
->notName('Kernel.php')
|
||||
->notPath('Module/Core/_compat_user_alias.php')
|
||||
;
|
||||
|
||||
$rules = [
|
||||
|
||||
+4
-1
@@ -55,7 +55,10 @@
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "src/"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"src/Module/Core/_compat_user_alias.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -14,7 +14,7 @@ doctrine:
|
||||
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
|
||||
auto_mapping: true
|
||||
resolve_target_entities:
|
||||
App\Shared\Domain\Contract\UserInterface: App\Entity\User
|
||||
App\Shared\Domain\Contract\UserInterface: App\Module\Core\Domain\Entity\User
|
||||
mappings:
|
||||
App:
|
||||
type: attribute
|
||||
@@ -22,6 +22,11 @@ doctrine:
|
||||
dir: '%kernel.project_dir%/src/Entity'
|
||||
prefix: 'App\Entity'
|
||||
alias: App
|
||||
Core:
|
||||
type: attribute
|
||||
is_bundle: false
|
||||
dir: '%kernel.project_dir%/src/Module/Core/Domain/Entity'
|
||||
prefix: 'App\Module\Core\Domain\Entity'
|
||||
controller_resolver:
|
||||
auto_mapping: false
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ security:
|
||||
providers:
|
||||
app_user_provider:
|
||||
entity:
|
||||
class: App\Entity\User
|
||||
class: App\Module\Core\Domain\Entity\User
|
||||
property: username
|
||||
|
||||
firewalls:
|
||||
|
||||
@@ -27,6 +27,9 @@ services:
|
||||
# this creates a service per class whose id is the fully-qualified class name
|
||||
App\:
|
||||
resource: '../src/'
|
||||
# Temporary legacy class_alias bootstrap file (no service): excluded from autowiring scan.
|
||||
exclude:
|
||||
- '../src/Module/Core/_compat_user_alias.php'
|
||||
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Entity;
|
||||
namespace App\Module\Core\Domain\Entity;
|
||||
|
||||
use ApiPlatform\Metadata\ApiProperty;
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
use App\Entity\User;
|
||||
|
||||
if (!class_exists(User::class, false)) {
|
||||
class_alias(App\Module\Core\Domain\Entity\User::class, User::class);
|
||||
}
|
||||
Reference in New Issue
Block a user