Skip to content

Commit

Permalink
Upgrading packages
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Jul 11, 2020
1 parent 86b79f2 commit c997dff
Show file tree
Hide file tree
Showing 28 changed files with 169 additions and 401 deletions.
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@
"ext-json" : "*",
"contributte/translation" : "^0.6",
"cweagans/composer-patches" : "^1.6",
"fastybird/node-libs" : "^0.5",
"fastybird/node-web-server" : "^0.3",
"fastybird/node-database": "^0.1",
"fastybird/json-schemas" : "^0.2",
"fastybird/node-database" : "^0.2",
"fastybird/node-json-api" : "^0.1",
"fastybird/node-libs" : "^0.6",
"fastybird/node-web-server" : "^0.5",
"ipub/doctrine-consistence" : "^0.3",
"ipub/doctrine-crud" : "^2.3",
"ipub/doctrine-orm-query" : "^0.0.5",
"ipub/doctrine-orm-query" : "^0.0.6",
"ipub/doctrine-timestampable" : "^1.4",
"ipub/json-api-document" : "^0.1",
"ipub/slim-router" : "^0.1",
"phpdocumentor/reflection-docblock" : "^5.1"
},

Expand Down
2 changes: 2 additions & 0 deletions config/common.neon
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ parameters:

rabbitmq:
queueName: fb.ui.node.exchange
routing: []

#########################
# Used Nette extensions #
Expand All @@ -38,6 +39,7 @@ extensions:
nettrineOrmCache : Nettrine\ORM\DI\OrmCacheExtension
nodeWebServer : FastyBird\NodeWebServer\DI\NodeWebServerExtension
nodeDatabase : FastyBird\NodeDatabase\DI\NodeDatabaseExtension
nodeJsonApi : FastyBird\NodeJsonApi\DI\NodeJsonApiExtension

##################################
# Nette extensions configuration #
Expand Down
3 changes: 2 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
bootstrap: phpstan-bootstrap.php
level: max
bootstrapFiles:
- phpstan-bootstrap.php
stubFiles:
- tests/PHPStan/stubs/Doctrine/ORM/Query.php
- tests/PHPStan/stubs/Doctrine/ORM/QueryBuilder.php
Expand Down
14 changes: 7 additions & 7 deletions src/Controllers/BaseV1Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use Contributte\Translation;
use Doctrine\DBAL\Connection;
use FastyBird\NodeWebServer\Exceptions as NodeWebServerExceptions;
use FastyBird\NodeJsonApi\Exceptions as NodeJsonApiExceptions;
use FastyBird\UINode\Exceptions;
use Fig\Http\Message\StatusCodeInterface;
use IPub\JsonAPIDocument;
Expand Down Expand Up @@ -87,22 +87,22 @@ public function injectLogger(LoggerInterface $logger): void
*
* @return JsonAPIDocument\IDocument<JsonAPIDocument\Objects\StandardObject>
*
* @throws NodeWebServerExceptions\IJsonApiException
* @throws NodeJsonApiExceptions\IJsonApiException
*/
protected function createDocument(ServerRequestInterface $request): JsonAPIDocument\IDocument
{
try {
$document = new JsonAPIDocument\Document(Utils\Json::decode($request->getBody()->getContents()));

} catch (Utils\JsonException $ex) {
throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_BAD_REQUEST,
$this->translator->translate('//node.base.messages.notValidJson.heading'),
$this->translator->translate('//node.base.messages.notValidJson.message')
);

} catch (JsonAPIDocument\Exceptions\RuntimeException $ex) {
throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_BAD_REQUEST,
$this->translator->translate('//node.base.messages.notValidJsonApi.heading'),
$this->translator->translate('//node.base.messages.notValidJsonApi.message')
Expand All @@ -115,19 +115,19 @@ protected function createDocument(ServerRequestInterface $request): JsonAPIDocum
/**
* @param string|null $relationEntity
*
* @throws NodeWebServerExceptions\IJsonApiException
* @throws NodeJsonApiExceptions\IJsonApiException
*/
protected function throwUnknownRelation(?string $relationEntity): void
{
if ($relationEntity !== null) {
throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_NOT_FOUND,
$this->translator->translate('//node.base.messages.relationNotFound.heading'),
$this->translator->translate('//node.base.messages.relationNotFound.message', ['relation' => $relationEntity])
);
}

throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_NOT_FOUND,
$this->translator->translate('//node.base.messages.unknownRelation.heading'),
$this->translator->translate('//node.base.messages.unknownRelation.message')
Expand Down
32 changes: 16 additions & 16 deletions src/Controllers/DashboardsV1Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace FastyBird\UINode\Controllers;

use Doctrine;
use FastyBird\NodeWebServer\Exceptions as NodeWebServerExceptions;
use FastyBird\NodeJsonApi\Exceptions as NodeJsonApiExceptions;
use FastyBird\NodeWebServer\Http as NodeWebServerHttp;
use FastyBird\UINode\Controllers;
use FastyBird\UINode\Hydrators;
Expand Down Expand Up @@ -99,7 +99,7 @@ public function index(
*
* @return NodeWebServerHttp\Response
*
* @throws NodeWebServerExceptions\IJsonApiException
* @throws NodeJsonApiExceptions\IJsonApiException
*/
public function read(
Message\ServerRequestInterface $request,
Expand All @@ -117,7 +117,7 @@ public function read(
*
* @return NodeWebServerHttp\Response
*
* @throws NodeWebServerExceptions\IJsonApiException
* @throws NodeJsonApiExceptions\IJsonApiException
* @throws Doctrine\DBAL\ConnectionException
*/
public function create(
Expand All @@ -136,7 +136,7 @@ public function create(
// Commit all changes into database
$this->getOrmConnection()->commit();

} catch (NodeWebServerExceptions\IJsonApiException $ex) {
} catch (NodeJsonApiExceptions\IJsonApiException $ex) {
// Revert all changes when error occur
$this->getOrmConnection()->rollBack();

Expand All @@ -148,7 +148,7 @@ public function create(

$pointer = 'data/attributes/' . $ex->getField();

throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY,
$this->translator->translate('//node.base.messages.missingRequired.heading'),
$this->translator->translate('//node.base.messages.missingRequired.message'),
Expand All @@ -161,7 +161,7 @@ public function create(
// Revert all changes when error occur
$this->getOrmConnection()->rollBack();

throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY,
$this->translator->translate('//node.base.messages.missingRequired.heading'),
$this->translator->translate('//node.base.messages.missingRequired.message'),
Expand All @@ -182,7 +182,7 @@ public function create(
],
]);

throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY,
$this->translator->translate('messages.notCreated.heading'),
$this->translator->translate('messages.notCreated.message')
Expand All @@ -197,7 +197,7 @@ public function create(
return $response;
}

throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY,
$this->translator->translate('messages.invalidType.heading'),
$this->translator->translate('messages.invalidType.message'),
Expand All @@ -213,7 +213,7 @@ public function create(
*
* @return NodeWebServerHttp\Response
*
* @throws NodeWebServerExceptions\IJsonApiException
* @throws NodeJsonApiExceptions\IJsonApiException
* @throws Doctrine\DBAL\ConnectionException
*/
public function update(
Expand All @@ -223,7 +223,7 @@ public function update(
$document = $this->createDocument($request);

if ($request->getAttribute(Router\Router::URL_ITEM_ID) !== $document->getResource()->getIdentifier()->getId()) {
throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_BAD_REQUEST,
$this->translator->translate('//node.base.messages.invalid.heading'),
$this->translator->translate('//node.base.messages.invalid.message')
Expand All @@ -240,7 +240,7 @@ public function update(
$updateDashboardData = $this->dashboardHydrator->hydrate($document, $dashboard);

} else {
throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY,
$this->translator->translate('messages.invalidType.heading'),
$this->translator->translate('messages.invalidType.message'),
Expand All @@ -255,7 +255,7 @@ public function update(
// Commit all changes into database
$this->getOrmConnection()->commit();

} catch (NodeWebServerExceptions\IJsonApiException $ex) {
} catch (NodeJsonApiExceptions\IJsonApiException $ex) {
// Revert all changes when error occur
$this->getOrmConnection()->rollBack();

Expand All @@ -273,7 +273,7 @@ public function update(
],
]);

throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY,
$this->translator->translate('messages.notUpdated.heading'),
$this->translator->translate('messages.notUpdated.message')
Expand All @@ -290,7 +290,7 @@ public function update(
*
* @return NodeWebServerHttp\Response
*
* @throws NodeWebServerExceptions\IJsonApiException
* @throws NodeJsonApiExceptions\IJsonApiException
* @throws Doctrine\DBAL\ConnectionException
*/
public function delete(
Expand Down Expand Up @@ -326,7 +326,7 @@ public function delete(
// Revert all changes when error occur
$this->getOrmConnection()->rollBack();

throw new NodeWebServerExceptions\JsonApiErrorException(
throw new NodeJsonApiExceptions\JsonApiErrorException(
StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY,
$this->translator->translate('messages.notDeleted.heading'),
$this->translator->translate('messages.notDeleted.message')
Expand All @@ -345,7 +345,7 @@ public function delete(
*
* @return NodeWebServerHttp\Response
*
* @throws NodeWebServerExceptions\IJsonApiException
* @throws NodeJsonApiExceptions\IJsonApiException
*/
public function readRelationship(
Message\ServerRequestInterface $request,
Expand Down
Loading

0 comments on commit c997dff

Please sign in to comment.