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()
|
$finder = Finder::create()
|
||||||
->in('src')
|
->in('src')
|
||||||
->notName('Kernel.php')
|
->notName('Kernel.php')
|
||||||
|
->notPath('Module/Core/_compat_user_alias.php')
|
||||||
;
|
;
|
||||||
|
|
||||||
$rules = [
|
$rules = [
|
||||||
|
|||||||
+4
-1
@@ -55,7 +55,10 @@
|
|||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"App\\": "src/"
|
"App\\": "src/"
|
||||||
}
|
},
|
||||||
|
"files": [
|
||||||
|
"src/Module/Core/_compat_user_alias.php"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ doctrine:
|
|||||||
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
|
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
|
||||||
auto_mapping: true
|
auto_mapping: true
|
||||||
resolve_target_entities:
|
resolve_target_entities:
|
||||||
App\Shared\Domain\Contract\UserInterface: App\Entity\User
|
App\Shared\Domain\Contract\UserInterface: App\Module\Core\Domain\Entity\User
|
||||||
mappings:
|
mappings:
|
||||||
App:
|
App:
|
||||||
type: attribute
|
type: attribute
|
||||||
@@ -22,6 +22,11 @@ doctrine:
|
|||||||
dir: '%kernel.project_dir%/src/Entity'
|
dir: '%kernel.project_dir%/src/Entity'
|
||||||
prefix: 'App\Entity'
|
prefix: 'App\Entity'
|
||||||
alias: App
|
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:
|
controller_resolver:
|
||||||
auto_mapping: false
|
auto_mapping: false
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ security:
|
|||||||
providers:
|
providers:
|
||||||
app_user_provider:
|
app_user_provider:
|
||||||
entity:
|
entity:
|
||||||
class: App\Entity\User
|
class: App\Module\Core\Domain\Entity\User
|
||||||
property: username
|
property: username
|
||||||
|
|
||||||
firewalls:
|
firewalls:
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ services:
|
|||||||
# this creates a service per class whose id is the fully-qualified class name
|
# this creates a service per class whose id is the fully-qualified class name
|
||||||
App\:
|
App\:
|
||||||
resource: '../src/'
|
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
|
# add more service definitions when explicit configuration is needed
|
||||||
# please note that last definitions always *replace* previous ones
|
# please note that last definitions always *replace* previous ones
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Entity;
|
namespace App\Module\Core\Domain\Entity;
|
||||||
|
|
||||||
use ApiPlatform\Metadata\ApiProperty;
|
use ApiPlatform\Metadata\ApiProperty;
|
||||||
use ApiPlatform\Metadata\ApiResource;
|
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