@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @return void |
13 | 13 | */ |
14 | - public function boot() |
|
14 | + public function boot () |
|
15 | 15 | { |
16 | 16 | // |
17 | 17 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @return void |
23 | 23 | */ |
24 | - public function register() |
|
24 | + public function register () |
|
25 | 25 | { |
26 | 26 | $arrClassName = [ |
27 | 27 | 'Rota', |
@@ -26,24 +26,24 @@ |
||
26 | 26 | */ |
27 | 27 | protected $alias; |
28 | 28 | |
29 | - public function getNome() |
|
29 | + public function getNome () |
|
30 | 30 | { |
31 | 31 | return $this->nome; |
32 | 32 | } |
33 | 33 | |
34 | - public function setNome($nome) |
|
34 | + public function setNome ($nome) |
|
35 | 35 | { |
36 | 36 | $this->nome = $nome; |
37 | 37 | |
38 | 38 | return $this; |
39 | 39 | } |
40 | 40 | |
41 | - public function getAlias() |
|
41 | + public function getAlias () |
|
42 | 42 | { |
43 | 43 | return $this->alias; |
44 | 44 | } |
45 | 45 | |
46 | - public function setAlias($alias) |
|
46 | + public function setAlias ($alias) |
|
47 | 47 | { |
48 | 48 | $this->alias = $alias; |
49 | 49 |
@@ -10,8 +10,7 @@ |
||
10 | 10 | * @ORM\Entity(repositoryClass="LaravelSeed\Repositories\RotaRepository") |
11 | 11 | * @ORM\Table(name="Rota") |
12 | 12 | */ |
13 | -class Rota extends BaseEntity |
|
14 | -{ |
|
13 | +class Rota extends BaseEntity { |
|
15 | 14 | /** |
16 | 15 | * @ORM\Column(type="string", name="nome") |
17 | 16 | * BdAnnotations\ToArray |
@@ -6,37 +6,37 @@ |
||
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 | |
41 | - public function toArray(array $options = []): array; |
|
41 | + public function toArray (array $options = [ ]): array; |
|
42 | 42 | } |
@@ -7,21 +7,21 @@ |
||
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 | } |
@@ -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 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | */ |
9 | 9 | class RulePersist |
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 RulePersist |
|
10 | -{ |
|
9 | +class RulePersist { |
|
11 | 10 | /** |
12 | 11 | * @Enum({"STORE", "UPDATE", "*"}) |
13 | 12 | */ |
@@ -6,7 +6,6 @@ |
||
6 | 6 | * @Annotation |
7 | 7 | * @Target({"PROPERTY"}) |
8 | 8 | */ |
9 | -class ToArray |
|
10 | -{ |
|
9 | +class ToArray { |
|
11 | 10 | |
12 | 11 | } |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function disableSoftDeleteableFilter() |
|
3 | +function disableSoftDeleteableFilter () |
|
4 | 4 | { |
5 | 5 | if (\EntityManager::getFilters()->isEnabled('soft-deleteable')) { |
6 | 6 | \EntityManager::getFilters()->disable('soft-deleteable'); |
7 | 7 | } |
8 | 8 | } |
9 | -function enableSoftDeleteableFilter() |
|
9 | +function enableSoftDeleteableFilter () |
|
10 | 10 | { |
11 | 11 | if (!\EntityManager::getFilters()->isEnabled('soft-deleteable')) { |
12 | 12 | \EntityManager::getFilters()->enable('soft-deleteable'); |
@@ -48,27 +48,27 @@ discard block |
||
48 | 48 | */ |
49 | 49 | protected $deletedAt; |
50 | 50 | |
51 | - public function getId() |
|
51 | + public function getId () |
|
52 | 52 | { |
53 | 53 | return $this->id; |
54 | 54 | } |
55 | 55 | |
56 | - public function getCreatedAt(): DateTime |
|
56 | + public function getCreatedAt (): DateTime |
|
57 | 57 | { |
58 | 58 | return $this->createdAt; |
59 | 59 | } |
60 | 60 | |
61 | - public function getUpdatedAt(): DateTime |
|
61 | + public function getUpdatedAt (): DateTime |
|
62 | 62 | { |
63 | 63 | return $this->createdAt; |
64 | 64 | } |
65 | 65 | |
66 | - public function getDeletedAt(): DateTime |
|
66 | + public function getDeletedAt (): DateTime |
|
67 | 67 | { |
68 | 68 | return $this->deletedAt; |
69 | 69 | } |
70 | 70 | |
71 | - public function getRepository(): RepositoryContract |
|
71 | + public function getRepository (): RepositoryContract |
|
72 | 72 | { |
73 | 73 | return EntityManager::getRepository(get_class($this)); |
74 | 74 | } |
@@ -76,53 +76,53 @@ discard block |
||
76 | 76 | /** |
77 | 77 | * @ORM\PreRemove |
78 | 78 | */ |
79 | - public function preRemove() |
|
79 | + public function preRemove () |
|
80 | 80 | { |
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | 84 | * @ORM\PostRemove |
85 | 85 | */ |
86 | - public function postRemove() |
|
86 | + public function postRemove () |
|
87 | 87 | { |
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | 91 | * @ORM\PrePersist |
92 | 92 | */ |
93 | - public function prePersist() |
|
93 | + public function prePersist () |
|
94 | 94 | { |
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
98 | 98 | * @ORM\PostPersist |
99 | 99 | */ |
100 | - public function postPersist() |
|
100 | + public function postPersist () |
|
101 | 101 | { |
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
105 | 105 | * @ORM\PreUpdate |
106 | 106 | */ |
107 | - public function preUpdate() |
|
107 | + public function preUpdate () |
|
108 | 108 | { |
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
112 | 112 | * @ORM\PostUpdate |
113 | 113 | */ |
114 | - public function postUpdate() |
|
114 | + public function postUpdate () |
|
115 | 115 | { |
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
119 | 119 | * @ORM\PreFlush |
120 | 120 | */ |
121 | - public function preFlush() |
|
121 | + public function preFlush () |
|
122 | 122 | { |
123 | 123 | } |
124 | 124 | |
125 | - public function persist(): EntityContract |
|
125 | + public function persist (): EntityContract |
|
126 | 126 | { |
127 | 127 | $this->getRepository() |
128 | 128 | ->em() |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | return $this; |
132 | 132 | } |
133 | 133 | |
134 | - public function flush(): EntityContract |
|
134 | + public function flush (): EntityContract |
|
135 | 135 | { |
136 | 136 | $this->getRepository() |
137 | 137 | ->em() |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | return $this; |
141 | 141 | } |
142 | 142 | |
143 | - public function remove(): EntityContract |
|
143 | + public function remove (): EntityContract |
|
144 | 144 | { |
145 | 145 | $this->getRepository() |
146 | 146 | ->em() |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | return $this; |
150 | 150 | } |
151 | 151 | |
152 | - public function undelete(): EntityContract |
|
152 | + public function undelete (): EntityContract |
|
153 | 153 | { |
154 | 154 | $this->deletedAt = null; |
155 | 155 |
@@ -16,8 +16,7 @@ |
||
16 | 16 | * @ORM\HasLifecycleCallbacks |
17 | 17 | * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false) |
18 | 18 | */ |
19 | -abstract class BaseEntity implements EntityContract |
|
20 | -{ |
|
19 | +abstract class BaseEntity implements EntityContract { |
|
21 | 20 | use ToArrayTrait; |
22 | 21 | |
23 | 22 | /** |
@@ -62,8 +62,8 @@ |
||
62 | 62 | public function findRemoved($id, bool $abort = true): EntityContract |
63 | 63 | { |
64 | 64 | $entity = $this->findAllRemoved() |
65 | - ->andWhere('id', '=', $id) |
|
66 | - ->getOneResult(); |
|
65 | + ->andWhere('id', '=', $id) |
|
66 | + ->getOneResult(); |
|
67 | 67 | |
68 | 68 | enableSoftDeleteableFilter(); |
69 | 69 |
@@ -11,27 +11,27 @@ discard block |
||
11 | 11 | |
12 | 12 | abstract class BaseRepository extends EntityRepository implements RepositoryContract |
13 | 13 | { |
14 | - public function getEntityManager(): EntityManager |
|
14 | + public function getEntityManager (): EntityManager |
|
15 | 15 | { |
16 | 16 | return parent::getEntityManager(); |
17 | 17 | } |
18 | 18 | |
19 | - public function getClassMetadata(): ClassMetadata |
|
19 | + public function getClassMetadata (): ClassMetadata |
|
20 | 20 | { |
21 | 21 | return parent::getClassMetadata(); |
22 | 22 | } |
23 | 23 | |
24 | - public function createQueryWorker(): QueryWorkerContract |
|
24 | + public function createQueryWorker (): QueryWorkerContract |
|
25 | 25 | { |
26 | 26 | return new QueryWorker($this); |
27 | 27 | } |
28 | 28 | |
29 | - public function findAll(): QueryWorkerContract |
|
29 | + public function findAll (): QueryWorkerContract |
|
30 | 30 | { |
31 | 31 | return $this->createQueryWorker(); |
32 | 32 | } |
33 | 33 | |
34 | - public function findOneBy(array $criteria, bool $abort = true): EntityContract |
|
34 | + public function findOneBy (array $criteria, bool $abort = true): EntityContract |
|
35 | 35 | { |
36 | 36 | $findAll = $this->findAll(); |
37 | 37 | |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | abort(404, 'Registro não encontrado'); |
47 | 47 | } |
48 | 48 | |
49 | - public function find($id, bool $abort = true): EntityContract |
|
49 | + public function find ($id, bool $abort = true): EntityContract |
|
50 | 50 | { |
51 | - return $this->findOneBy(['id' => $id], $abort); |
|
51 | + return $this->findOneBy([ 'id' => $id ], $abort); |
|
52 | 52 | } |
53 | 53 | |
54 | - public function findAllRemoved(): QueryWorkerContract |
|
54 | + public function findAllRemoved (): QueryWorkerContract |
|
55 | 55 | { |
56 | 56 | disableSoftDeleteableFilter(); |
57 | 57 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | ->andWhere('deletedAt', 'isnotnull'); |
60 | 60 | } |
61 | 61 | |
62 | - public function findRemoved($id, bool $abort = true): EntityContract |
|
62 | + public function findRemoved ($id, bool $abort = true): EntityContract |
|
63 | 63 | { |
64 | 64 | $entity = $this->findAllRemoved() |
65 | 65 | ->andWhere('id', '=', $id) |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | abort(404, 'Registro não encontrado'); |
75 | 75 | } |
76 | 76 | |
77 | - public function createEntity(): EntityContract |
|
77 | + public function createEntity (): EntityContract |
|
78 | 78 | { |
79 | 79 | $entityName = $this->getEntityName(); |
80 | 80 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | return $this->createQueryWorker(); |
32 | 32 | } |
33 | 33 | |
34 | - public function findOneBy(array $criteria, bool $abort = true): EntityContract |
|
34 | + public function findOneBy(array $criteria, bool $abort = TRUE): EntityContract |
|
35 | 35 | { |
36 | 36 | $findAll = $this->findAll(); |
37 | 37 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | abort(404, 'Registro não encontrado'); |
47 | 47 | } |
48 | 48 | |
49 | - public function find($id, bool $abort = true): EntityContract |
|
49 | + public function find($id, bool $abort = TRUE): EntityContract |
|
50 | 50 | { |
51 | 51 | return $this->findOneBy(['id' => $id], $abort); |
52 | 52 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | ->andWhere('deletedAt', 'isnotnull'); |
60 | 60 | } |
61 | 61 | |
62 | - public function findRemoved($id, bool $abort = true): EntityContract |
|
62 | + public function findRemoved($id, bool $abort = TRUE): EntityContract |
|
63 | 63 | { |
64 | 64 | $entity = $this->findAllRemoved() |
65 | 65 | ->andWhere('id', '=', $id) |