@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | public function prePersist() |
| 83 | 83 | { |
| 84 | 84 | $this->getRepository() |
| 85 | - ->preSave($this) |
|
| 86 | - ->validate($this); |
|
| 85 | + ->preSave($this) |
|
| 86 | + ->validate($this); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | public function preUpdate() |
| 93 | 93 | { |
| 94 | 94 | $this->getRepository() |
| 95 | - ->preSave($this) |
|
| 96 | - ->validate($this); |
|
| 95 | + ->preSave($this) |
|
| 96 | + ->validate($this); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | public function getRepository() |
@@ -169,6 +169,9 @@ |
||
| 169 | 169 | return $this; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | + /** |
|
| 173 | + * @param string $key |
|
| 174 | + */ |
|
| 172 | 175 | final protected function checkOnyExceptInArray($key, array $options = null) |
| 173 | 176 | { |
| 174 | 177 | if ( |
@@ -4,11 +4,20 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface EntityTimestampInterface |
| 6 | 6 | { |
| 7 | + /** |
|
| 8 | + * @return \DateTime |
|
| 9 | + */ |
|
| 7 | 10 | public function getCreatedAt(); |
| 8 | 11 | |
| 12 | + /** |
|
| 13 | + * @return \DateTime |
|
| 14 | + */ |
|
| 9 | 15 | public function getUpdatedAt(); |
| 10 | 16 | |
| 11 | 17 | public function getDeletedAt(); |
| 12 | 18 | |
| 19 | + /** |
|
| 20 | + * @return void |
|
| 21 | + */ |
|
| 13 | 22 | public function setDeletedAt($date); |
| 14 | 23 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * @return Bludata\Lumen\Application\BaseApplication |
|
| 27 | + * @return BaseApplication |
|
| 28 | 28 | */ |
| 29 | 29 | public function resource($descriptionGroup, $prefix, $controller, array $except = [], Closure $routes = null) |
| 30 | 30 | { |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * |
| 57 | 57 | * @param string $token |
| 58 | 58 | * |
| 59 | - * @return Lcobucci\JWT\Token |
|
| 59 | + * @return Token|null |
|
| 60 | 60 | */ |
| 61 | 61 | public function decodeToken($token) |
| 62 | 62 | { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * Verify is validate token in signature. |
| 78 | 78 | * |
| 79 | - * @param Lcobucci\JWT\Token $token |
|
| 79 | + * @param Token $token |
|
| 80 | 80 | * |
| 81 | 81 | * @return bool |
| 82 | 82 | */ |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | return array_combine( |
| 19 | 19 | $attributes, |
| 20 | 20 | array_map( |
| 21 | - function ($attr) { |
|
| 21 | + function($attr) { |
|
| 22 | 22 | $getMethod = $this->getMethod($attr); |
| 23 | 23 | if (method_exists($this, $getMethod)) { |
| 24 | 24 | return $this->$getMethod(); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | public function toArray() |
| 107 | 107 | { |
| 108 | - return array_map(function ($attr) { |
|
| 108 | + return array_map(function($attr) { |
|
| 109 | 109 | if (method_exists($attr, 'toArray')) { |
| 110 | 110 | return $attr->toArray(); |
| 111 | 111 | } |
@@ -4,12 +4,18 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | interface BaseRepositoryInterface |
| 6 | 6 | { |
| 7 | + /** |
|
| 8 | + * @return boolean|null |
|
| 9 | + */ |
|
| 7 | 10 | public function validate(BaseEntityInterface $entity); |
| 8 | 11 | |
| 9 | 12 | public function getEntityName(); |
| 10 | 13 | |
| 11 | 14 | public function query(); |
| 12 | 15 | |
| 16 | + /** |
|
| 17 | + * @return \Bludata\Doctrine\ORM\Repositories\QueryWorker |
|
| 18 | + */ |
|
| 13 | 19 | public function findAll(); |
| 14 | 20 | |
| 15 | 21 | public function findOneBy(array $filters, $abort = true); |
@@ -32,7 +38,13 @@ discard block |
||
| 32 | 38 | |
| 33 | 39 | public function createEntity(); |
| 34 | 40 | |
| 41 | + /** |
|
| 42 | + * @return \Bludata\Doctrine\ORM\Repositories\QueryWorker |
|
| 43 | + */ |
|
| 35 | 44 | public function createQueryWorker(); |
| 36 | 45 | |
| 46 | + /** |
|
| 47 | + * @return string |
|
| 48 | + */ |
|
| 37 | 49 | public function getMessageNotFound(); |
| 38 | 50 | } |
@@ -12,6 +12,9 @@ discard block |
||
| 12 | 12 | { |
| 13 | 13 | abstract public function preSave(BaseEntityInterface $entity); |
| 14 | 14 | |
| 15 | + /** |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 15 | 18 | abstract public function getMessageNotFound(); |
| 16 | 19 | |
| 17 | 20 | public function validate(BaseEntityInterface $entity) |
@@ -40,6 +43,9 @@ discard block |
||
| 40 | 43 | return parent::getClassMetadata(); |
| 41 | 44 | } |
| 42 | 45 | |
| 46 | + /** |
|
| 47 | + * @return string|null |
|
| 48 | + */ |
|
| 43 | 49 | public function getEntityName() |
| 44 | 50 | { |
| 45 | 51 | return parent::getDocumentName(); |
@@ -137,7 +143,7 @@ discard block |
||
| 137 | 143 | } |
| 138 | 144 | |
| 139 | 145 | /** |
| 140 | - * @param Bludata\Entities\BaseEntityInterface $entity |
|
| 146 | + * @param BaseEntityInterface $entity |
|
| 141 | 147 | * |
| 142 | 148 | * @return Bludata\Repositories\QueryWorker |
| 143 | 149 | */ |
@@ -149,7 +155,7 @@ discard block |
||
| 149 | 155 | } |
| 150 | 156 | |
| 151 | 157 | /** |
| 152 | - * @param Bludata\Entities\BaseEntityInterface $entity |
|
| 158 | + * @param BaseEntityInterface $entity |
|
| 153 | 159 | * |
| 154 | 160 | * @return Bludata\Repositories\QueryWorker |
| 155 | 161 | */ |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker |
| 27 | 27 | * |
| 28 | - * @return void |
|
| 28 | + * @return string |
|
| 29 | 29 | */ |
| 30 | 30 | public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) |
| 31 | 31 | { |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | /** |
| 55 | 55 | * Busca a anotação Doctrine\ORM\Mapping\Column. |
| 56 | 56 | */ |
| 57 | - $column = array_filter($propertyAnnotations, function ($annotation) { |
|
| 57 | + $column = array_filter($propertyAnnotations, function($annotation) { |
|
| 58 | 58 | return $annotation instanceof Column; |
| 59 | 59 | }); |
| 60 | 60 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | /** |
| 66 | 66 | * Busca a anotação Bludata\Doctrine\Common\Annotations\ToObject. |
| 67 | 67 | */ |
| 68 | - $toObject = array_filter($propertyAnnotations, function ($annotation) { |
|
| 68 | + $toObject = array_filter($propertyAnnotations, function($annotation) { |
|
| 69 | 69 | return $annotation instanceof ToObject; |
| 70 | 70 | }); |
| 71 | 71 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * Busca pelas anotações Doctrine\ORM\Mapping\ManyToOne || Doctrine\ORM\Mapping\OneToMany || Doctrine\ORM\Mapping\ManyToMany. |
| 86 | 86 | */ |
| 87 | - $ormMapping = array_filter($propertyAnnotations, function ($annotation) { |
|
| 87 | + $ormMapping = array_filter($propertyAnnotations, function($annotation) { |
|
| 88 | 88 | return $annotation instanceof ManyToOne |
| 89 | 89 | || |
| 90 | 90 | $annotation instanceof OneToMany |