@@ -18,10 +18,10 @@ |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $response = $this->curlHelper |
| 21 | - ->setPosFixUrl('/'.$flushedMockArray['id']) |
|
| 22 | - ->put($flushedMockArray) |
|
| 23 | - ->send() |
|
| 24 | - ->getResponse(); |
|
| 21 | + ->setPosFixUrl('/'.$flushedMockArray['id']) |
|
| 22 | + ->put($flushedMockArray) |
|
| 23 | + ->send() |
|
| 24 | + ->getResponse(); |
|
| 25 | 25 | |
| 26 | 26 | $this->assertEquals(200, $response['code']); |
| 27 | 27 | |
@@ -7,11 +7,11 @@ |
||
| 7 | 7 | public function testStore() |
| 8 | 8 | { |
| 9 | 9 | $response = $this->curlHelper |
| 10 | - ->post( |
|
| 10 | + ->post( |
|
| 11 | 11 | $this->getServiceTest()->getRepositoryTest()->getMockArray() |
| 12 | - ) |
|
| 13 | - ->send() |
|
| 14 | - ->getResponse(); |
|
| 12 | + ) |
|
| 13 | + ->send() |
|
| 14 | + ->getResponse(); |
|
| 15 | 15 | |
| 16 | 16 | $this->assertEquals(200, $response['code']); |
| 17 | 17 | |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | return response()->json( |
| 15 | 15 | $this->mainService |
| 16 | - ->findAll($this->translateFilters($request)) |
|
| 17 | - ->toArray($this->optionsToArrayIndex) |
|
| 16 | + ->findAll($this->translateFilters($request)) |
|
| 17 | + ->toArray($this->optionsToArrayIndex) |
|
| 18 | 18 | ); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | return response()->json( |
| 24 | 24 | $this->mainService |
| 25 | - ->find($id) |
|
| 26 | - ->toArray($this->optionsToArrayShow) |
|
| 25 | + ->find($id) |
|
| 26 | + ->toArray($this->optionsToArrayShow) |
|
| 27 | 27 | ); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -9,8 +9,8 @@ |
||
| 9 | 9 | public function destroy($id) |
| 10 | 10 | { |
| 11 | 11 | $entity = $this->mainService |
| 12 | - ->remove($id) |
|
| 13 | - ->flush(); |
|
| 12 | + ->remove($id) |
|
| 13 | + ->flush(); |
|
| 14 | 14 | |
| 15 | 15 | return response()->json($entity->toArray($this->optionsToArrayDestroy)); |
| 16 | 16 | } |
@@ -11,17 +11,17 @@ |
||
| 11 | 11 | public function update(Request $request, $id) |
| 12 | 12 | { |
| 13 | 13 | $entity = $this->mainService |
| 14 | - ->update( |
|
| 14 | + ->update( |
|
| 15 | 15 | $id, |
| 16 | 16 | $this->filterRequest( |
| 17 | 17 | $request->json()->all(), |
| 18 | 18 | $this->mainService |
| 19 | - ->getMainRepository() |
|
| 20 | - ->createEntity() |
|
| 21 | - ->getOnlyUpdate() |
|
| 19 | + ->getMainRepository() |
|
| 20 | + ->createEntity() |
|
| 21 | + ->getOnlyUpdate() |
|
| 22 | 22 | ) |
| 23 | - ) |
|
| 24 | - ->flush(); |
|
| 23 | + ) |
|
| 24 | + ->flush(); |
|
| 25 | 25 | |
| 26 | 26 | return response()->json($entity->toArray($this->optionsToArrayUpdate)); |
| 27 | 27 | } |
@@ -11,16 +11,16 @@ |
||
| 11 | 11 | public function store(Request $request) |
| 12 | 12 | { |
| 13 | 13 | $entity = $this->mainService |
| 14 | - ->store( |
|
| 15 | - $this->filterRequest( |
|
| 16 | - $request->json()->all(), |
|
| 14 | + ->store( |
|
| 15 | + $this->filterRequest( |
|
| 16 | + $request->json()->all(), |
|
| 17 | 17 | $this->mainService |
| 18 | - ->getMainRepository() |
|
| 19 | - ->createEntity() |
|
| 20 | - ->getOnlyStore() |
|
| 18 | + ->getMainRepository() |
|
| 19 | + ->createEntity() |
|
| 20 | + ->getOnlyStore() |
|
| 21 | 21 | ) |
| 22 | - ) |
|
| 23 | - ->flush(); |
|
| 22 | + ) |
|
| 23 | + ->flush(); |
|
| 24 | 24 | |
| 25 | 25 | return response()->json($entity->toArray($this->optionsToArrayStore)); |
| 26 | 26 | } |
@@ -186,6 +186,9 @@ |
||
| 186 | 186 | return $this->getOnlyStore(); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | + /** |
|
| 190 | + * @param string $key |
|
| 191 | + */ |
|
| 189 | 192 | final protected function checkOnyExceptInArray($key, array $options = null) |
| 190 | 193 | { |
| 191 | 194 | if ( |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | public function prePersist() |
| 96 | 96 | { |
| 97 | 97 | $this->getRepository() |
| 98 | - ->preSave($this) |
|
| 99 | - ->validate($this); |
|
| 98 | + ->preSave($this) |
|
| 99 | + ->validate($this); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | public function postPersist() |
| 106 | 106 | { |
| 107 | 107 | $this->getRepository() |
| 108 | - ->postSave($this); |
|
| 108 | + ->postSave($this); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | public function preUpdate() |
| 115 | 115 | { |
| 116 | 116 | $this->getRepository() |
| 117 | - ->preSave($this) |
|
| 118 | - ->validate($this); |
|
| 117 | + ->preSave($this) |
|
| 118 | + ->validate($this); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | public function postUpdate() |
| 125 | 125 | { |
| 126 | 126 | $this->getRepository() |
| 127 | - ->postSave($this); |
|
| 127 | + ->postSave($this); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | public function preFlush() |
| 134 | 134 | { |
| 135 | 135 | $this->getRepository() |
| 136 | - ->preFlush($this); |
|
| 136 | + ->preFlush($this); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | public function getRepository() |
@@ -25,14 +25,14 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @param string $token |
| 27 | 27 | * |
| 28 | - * @return Lcobucci\JWT\Token |
|
| 28 | + * @return Token|null |
|
| 29 | 29 | */ |
| 30 | 30 | public function decodeToken($token); |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * Verify is validate token in signature. |
| 34 | 34 | * |
| 35 | - * @param Lcobucci\JWT\Token $token |
|
| 35 | + * @param Token $token |
|
| 36 | 36 | * |
| 37 | 37 | * @return bool |
| 38 | 38 | */ |
@@ -26,6 +26,9 @@ discard block |
||
| 26 | 26 | return $this; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @return string |
|
| 31 | + */ |
|
| 29 | 32 | abstract public function getMessageNotFound(); |
| 30 | 33 | |
| 31 | 34 | public function validate(BaseEntityInterface $entity) |
@@ -54,6 +57,9 @@ discard block |
||
| 54 | 57 | return parent::getClassMetadata(); |
| 55 | 58 | } |
| 56 | 59 | |
| 60 | + /** |
|
| 61 | + * @return string|null |
|
| 62 | + */ |
|
| 57 | 63 | public function getEntityName() |
| 58 | 64 | { |
| 59 | 65 | return parent::getDocumentName(); |
@@ -151,7 +157,7 @@ discard block |
||
| 151 | 157 | } |
| 152 | 158 | |
| 153 | 159 | /** |
| 154 | - * @param Bludata\Entities\BaseEntityInterface $entity |
|
| 160 | + * @param BaseEntityInterface $entity |
|
| 155 | 161 | * |
| 156 | 162 | * @return Bludata\Repositories\QueryWorker |
| 157 | 163 | */ |
@@ -163,7 +169,7 @@ discard block |
||
| 163 | 169 | } |
| 164 | 170 | |
| 165 | 171 | /** |
| 166 | - * @param Bludata\Entities\BaseEntityInterface $entity |
|
| 172 | + * @param BaseEntityInterface $entity |
|
| 167 | 173 | * |
| 168 | 174 | * @return Bludata\Repositories\QueryWorker |
| 169 | 175 | */ |