@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | class LaravelServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | - public function register() |
|
9 | + public function register () |
|
10 | 10 | { |
11 | 11 | $this->app->register(\Bludata\Doctrine\ORM\Providers\ORMServiceProvider::class); |
12 | 12 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Support\ServiceProvider; |
6 | 6 | |
7 | -class LaravelServiceProvider extends ServiceProvider |
|
8 | -{ |
|
7 | +class LaravelServiceProvider extends ServiceProvider { |
|
9 | 8 | public function register() |
10 | 9 | { |
11 | 10 | $this->app->register(\Bludata\Doctrine\ORM\Providers\ORMServiceProvider::class); |
@@ -6,12 +6,12 @@ discard block |
||
6 | 6 | * @param string $repository |
7 | 7 | * @param string $entity |
8 | 8 | */ |
9 | - function bind_repository(string $repositoryInterface, string $repository, string $entity) |
|
9 | + function bind_repository (string $repositoryInterface, string $repository, string $entity) |
|
10 | 10 | { |
11 | 11 | app()->bind($repositoryInterface, function ($app) use ($repository, $entity) { |
12 | 12 | return new $repository( |
13 | - $app['em'], |
|
14 | - $app['em']->getClassMetaData($entity) |
|
13 | + $app[ 'em' ], |
|
14 | + $app[ 'em' ]->getClassMetaData($entity) |
|
15 | 15 | ); |
16 | 16 | }); |
17 | 17 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * @param string $className |
23 | 23 | */ |
24 | - function bdEntityName(string $className) |
|
24 | + function bdEntityName (string $className) |
|
25 | 25 | { |
26 | 26 | return config('bludata.generator.namespace.root').config('bludata.generator.namespace.entities').$className; |
27 | 27 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | /** |
32 | 32 | * @param string $className |
33 | 33 | */ |
34 | - function bdEntity(string $className) |
|
34 | + function bdEntity (string $className) |
|
35 | 35 | { |
36 | 36 | return app(bdEntityName($className)); |
37 | 37 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * @param string $className |
43 | 43 | */ |
44 | - function bdContractRepositoryName(string $className) |
|
44 | + function bdContractRepositoryName (string $className) |
|
45 | 45 | { |
46 | 46 | return config('bludata.generator.namespace.root').config('bludata.generator.namespace.contracts.repositories').$className.'ContractRepository'; |
47 | 47 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | /** |
52 | 52 | * @param string $className |
53 | 53 | */ |
54 | - function bdRepositoryName(string $className) |
|
54 | + function bdRepositoryName (string $className) |
|
55 | 55 | { |
56 | 56 | return config('bludata.generator.namespace.root').config('bludata.generator.namespace.repositories').$className.'Repository'; |
57 | 57 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | /** |
62 | 62 | * @param string $className |
63 | 63 | */ |
64 | - function bdRepository(string $className) |
|
64 | + function bdRepository (string $className) |
|
65 | 65 | { |
66 | 66 | return app(bdContractRepositoryName($className)); |
67 | 67 | } |
@@ -7,23 +7,23 @@ |
||
7 | 7 | |
8 | 8 | interface RepositoryContract |
9 | 9 | { |
10 | - public function getEntityManager(): EntityManager; |
|
10 | + public function getEntityManager (): EntityManager; |
|
11 | 11 | |
12 | - public function getClassMetadata(): ClassMetadata; |
|
12 | + public function getClassMetadata (): ClassMetadata; |
|
13 | 13 | |
14 | - public function createQueryWorker(): QueryWorkerContract; |
|
14 | + public function createQueryWorker (): QueryWorkerContract; |
|
15 | 15 | |
16 | - public function findAll(): QueryWorkerContract; |
|
16 | + public function findAll (): QueryWorkerContract; |
|
17 | 17 | |
18 | - public function findOneBy(array $criteria, bool $abort = true): ?EntityContract; |
|
18 | + public function findOneBy (array $criteria, bool $abort = true): ?EntityContract; |
|
19 | 19 | |
20 | - public function find($id, bool $abort = true): ?EntityContract; |
|
20 | + public function find ($id, bool $abort = true): ?EntityContract; |
|
21 | 21 | |
22 | - public function findAllRemoved(): QueryWorkerContract; |
|
22 | + public function findAllRemoved (): QueryWorkerContract; |
|
23 | 23 | |
24 | - public function findRemoved($id, bool $abort = true): ?EntityContract; |
|
24 | + public function findRemoved ($id, bool $abort = true): ?EntityContract; |
|
25 | 25 | |
26 | - public function createEntity(): EntityContract; |
|
26 | + public function createEntity (): EntityContract; |
|
27 | 27 | |
28 | - public function remove(EntityContract $entity): EntityContract; |
|
28 | + public function remove (EntityContract $entity): EntityContract; |
|
29 | 29 | } |
@@ -15,13 +15,13 @@ |
||
15 | 15 | |
16 | 16 | public function findAll(): QueryWorkerContract; |
17 | 17 | |
18 | - public function findOneBy(array $criteria, bool $abort = true): ?EntityContract; |
|
18 | + public function findOneBy(array $criteria, bool $abort = TRUE): ?EntityContract; |
|
19 | 19 | |
20 | - public function find($id, bool $abort = true): ?EntityContract; |
|
20 | + public function find($id, bool $abort = TRUE): ?EntityContract; |
|
21 | 21 | |
22 | 22 | public function findAllRemoved(): QueryWorkerContract; |
23 | 23 | |
24 | - public function findRemoved($id, bool $abort = true): ?EntityContract; |
|
24 | + public function findRemoved($id, bool $abort = TRUE): ?EntityContract; |
|
25 | 25 | |
26 | 26 | public function createEntity(): EntityContract; |
27 | 27 |
@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | interface ToArrayContract |
6 | 6 | { |
7 | - public function toArray(array $options = []): array; |
|
7 | + public function toArray (array $options = [ ]): array; |
|
8 | 8 | } |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Bludata\Doctrine\Common\Contracts; |
4 | 4 | |
5 | -interface ToArrayContract |
|
6 | -{ |
|
5 | +interface ToArrayContract { |
|
7 | 6 | public function toArray(array $options = []): array; |
8 | 7 | } |
@@ -6,9 +6,9 @@ |
||
6 | 6 | |
7 | 7 | interface QueryWorkerContract |
8 | 8 | { |
9 | - public function __construct(RepositoryContract $repository); |
|
9 | + public function __construct (RepositoryContract $repository); |
|
10 | 10 | |
11 | - public function getResult(): ArrayCollection; |
|
11 | + public function getResult (): ArrayCollection; |
|
12 | 12 | |
13 | - public function getOneResult(): ?EntityContract; |
|
13 | + public function getOneResult (): ?EntityContract; |
|
14 | 14 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Doctrine\Common\Collections\ArrayCollection; |
6 | 6 | |
7 | -interface QueryWorkerContract |
|
8 | -{ |
|
7 | +interface QueryWorkerContract { |
|
9 | 8 | public function __construct(RepositoryContract $repository); |
10 | 9 | |
11 | 10 | public function getResult(): ArrayCollection; |
@@ -6,35 +6,35 @@ |
||
6 | 6 | |
7 | 7 | interface EntityContract |
8 | 8 | { |
9 | - public function getId(); |
|
9 | + public function getId (); |
|
10 | 10 | |
11 | - public function getCreatedAt(): ?DateTime; |
|
11 | + public function getCreatedAt (): ?DateTime; |
|
12 | 12 | |
13 | - public function getUpdatedAt(): ?DateTime; |
|
13 | + public function getUpdatedAt (): ?DateTime; |
|
14 | 14 | |
15 | - public function getDeletedAt(): ?DateTime; |
|
15 | + public function getDeletedAt (): ?DateTime; |
|
16 | 16 | |
17 | - public function getRepository(): RepositoryContract; |
|
17 | + public function getRepository (): RepositoryContract; |
|
18 | 18 | |
19 | - public function preRemove(); |
|
19 | + public function preRemove (); |
|
20 | 20 | |
21 | - public function postRemove(); |
|
21 | + public function postRemove (); |
|
22 | 22 | |
23 | - public function prePersist(); |
|
23 | + public function prePersist (); |
|
24 | 24 | |
25 | - public function postPersist(); |
|
25 | + public function postPersist (); |
|
26 | 26 | |
27 | - public function preUpdate(); |
|
27 | + public function preUpdate (); |
|
28 | 28 | |
29 | - public function postUpdate(); |
|
29 | + public function postUpdate (); |
|
30 | 30 | |
31 | - public function preFlush(); |
|
31 | + public function preFlush (); |
|
32 | 32 | |
33 | - public function persist(): EntityContract; |
|
33 | + public function persist (): EntityContract; |
|
34 | 34 | |
35 | - public function flush(): EntityContract; |
|
35 | + public function flush (): EntityContract; |
|
36 | 36 | |
37 | - public function remove(): EntityContract; |
|
37 | + public function remove (): EntityContract; |
|
38 | 38 | |
39 | - public function undelete(): EntityContract; |
|
39 | + public function undelete (): EntityContract; |
|
40 | 40 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use DateTime; |
6 | 6 | |
7 | -interface EntityContract |
|
8 | -{ |
|
7 | +interface EntityContract { |
|
9 | 8 | public function getId(); |
10 | 9 | |
11 | 10 | public function getCreatedAt(): ?DateTime; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | */ |
9 | 9 | class Rule |
10 | 10 | { |
11 | - /** |
|
11 | + /** |
|
12 | 12 | * @Enum({"STORE", "UPDATE", "*"}) |
13 | 13 | */ |
14 | 14 | public $value = '*'; |
@@ -6,8 +6,7 @@ |
||
6 | 6 | * @Annotation |
7 | 7 | * @Target({"PROPERTY"}) |
8 | 8 | */ |
9 | -class Rule |
|
10 | -{ |
|
9 | +class Rule { |
|
11 | 10 | /** |
12 | 11 | * @Enum({"STORE", "UPDATE", "*"}) |
13 | 12 | */ |
@@ -6,7 +6,6 @@ |
||
6 | 6 | * @Annotation |
7 | 7 | * @Target({"PROPERTY"}) |
8 | 8 | */ |
9 | -class Fillable |
|
10 | -{ |
|
9 | +class Fillable { |
|
11 | 10 | |
12 | 11 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | class CommonServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | - public function register() |
|
9 | + public function register () |
|
10 | 10 | { |
11 | 11 | register_annotation_dir(__DIR__.'/../Annotations'); |
12 | 12 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Support\ServiceProvider; |
6 | 6 | |
7 | -class CommonServiceProvider extends ServiceProvider |
|
8 | -{ |
|
7 | +class CommonServiceProvider extends ServiceProvider { |
|
9 | 8 | public function register() |
10 | 9 | { |
11 | 10 | register_annotation_dir(__DIR__.'/../Annotations'); |