Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Remove deprecated ReST API with dependencies (#780)
Browse files Browse the repository at this point in the history
* Remove deprecated ReST API with dependencies

Signed-off-by: Wojciech Błoszyk <wbloszyk@gmail.com>

* Fix tests

Signed-off-by: Wojciech Błoszyk <wbloszyk@gmail.com>

* Remove sonata/datagrid-bundle

Signed-off-by: Wojciech Błoszyk <wbloszyk@gmail.com>

* Fix lint

Signed-off-by: Wojciech Błoszyk <wbloszyk@gmail.com>

* Remove ReST API from docs

Signed-off-by: Wojciech Błoszyk <wbloszyk@gmail.com>

* Fixes

Signed-off-by: Wojciech Błoszyk <wbloszyk@gmail.com>
  • Loading branch information
wbloszyk committed Sep 25, 2021
1 parent 2e1a183 commit fbf6ee7
Show file tree
Hide file tree
Showing 47 changed files with 411 additions and 1,925 deletions.
12 changes: 3 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@
"php": "^7.3 || ^8.0",
"doctrine/persistence": "^1.3 || ^2.0",
"sonata-project/classification-bundle": "^3.12",
"sonata-project/datagrid-bundle": "^2.4 || ^3.0",
"sonata-project/doctrine-extensions": "^1.10.1",
"sonata-project/form-extensions": "^0.1 || ^1.4",
"sonata-project/form-extensions": "^1.4",
"sonata-project/formatter-bundle": "^4.0",
"sonata-project/intl-bundle": "^2.4",
"sonata-project/media-bundle": "^3.20",
"sonata-project/twig-extensions": "^0.1 || ^1.3",
"sonata-project/twig-extensions": "^1.3",
"symfony/config": "^4.4",
"symfony/console": "^4.4",
"symfony/dependency-injection": "^4.4",
Expand All @@ -53,8 +52,6 @@
},
"conflict": {
"doctrine/dbal": "<2.6.0",
"friendsofsymfony/rest-bundle": "<2.3",
"jms/serializer": "<0.13",
"sonata-project/admin-bundle": "<3.59",
"sonata-project/block-bundle": "<3.18",
"sonata-project/core-bundle": "<3.20",
Expand All @@ -63,12 +60,10 @@
"sonata-project/seo-bundle": "<2.5 || >=3.0"
},
"require-dev": {
"doctrine/mongodb-odm": "^2.2",
"doctrine/orm": "^2.4",
"friendsofsymfony/rest-bundle": "^2.3 || ^3.0",
"jms/serializer-bundle": "^3.0",
"matthiasnoback/symfony-config-test": "^4.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.2",
"nelmio/api-doc-bundle": "^2.13.3",
"sonata-project/admin-bundle": "^3.59",
"sonata-project/block-bundle": "^3.18",
"sonata-project/doctrine-orm-admin-bundle": "^3.5",
Expand All @@ -79,7 +74,6 @@
"symfony/swiftmailer-bundle": "^3.4"
},
"suggest": {
"nelmio/api-doc-bundle": "If you want to use the API.",
"sonata-project/block-bundle": "For rendering block lists.",
"sonata-project/doctrine-orm-admin-bundle": "For integrate Doctrine ORM into the SonataAdminBundle.",
"sonata-project/notification-bundle": "If you want to send comment notification asynchronously.",
Expand Down
1 change: 0 additions & 1 deletion docs/.doctor-rst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ rules:
whitelist:
lines:
- '.. versionadded:: 3.x'
- 'resource: "@NelmioApiDocBundle/Resources/config/routing.yml"'
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ News Bundle
reference/introduction
reference/installation
reference/advanced_configuration
reference/api
85 changes: 0 additions & 85 deletions docs/reference/api.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/reference/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ Add ``SonataNewsBundle`` via composer::

composer require sonata-project/news-bundle

If you want to use the REST API, you also need ``friendsofsymfony/rest-bundle`` and ``nelmio/api-doc-bundle``::

composer require friendsofsymfony/rest-bundle nelmio/api-doc-bundle

Next, be sure to enable the bundles in your ``config/bundles.php`` file if they
are not already enabled::

Expand Down
2 changes: 1 addition & 1 deletion src/Action/AbstractPostArchiveAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function __construct(BlogInterface $blog, PostManagerInterface $postManag
*/
final public function renderArchive(Request $request, array $criteria = [], array $parameters = [])
{
$pager = $this->postManager->getPager(
$pager = $this->postManager->getPaginator(
$criteria,
$request->get('page', 1)
);
Expand Down
2 changes: 1 addition & 1 deletion src/Action/CommentListAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(CommentManagerInterface $commentManager)
public function __invoke($postId)
{
$pager = $this->commentManager
->getPager([
->getPaginator([
'postId' => $postId,
'status' => CommentInterface::STATUS_VALID,
], 1, 500); //no limit
Expand Down
2 changes: 1 addition & 1 deletion src/Block/RecentCommentsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function execute(BlockContextInterface $blockContext, ?Response $response
'context' => $blockContext,
'settings' => $blockContext->getSettings(),
'block' => $blockContext->getBlock(),
'pager' => $this->manager->getPager($criteria, 1, $blockContext->getSetting('number')),
'pager' => $this->manager->getPaginator($criteria, 1, $blockContext->getSetting('number')),
'admin_pool' => $this->adminPool,
];

Expand Down
2 changes: 1 addition & 1 deletion src/Block/RecentPostsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function execute(BlockContextInterface $blockContext, ?Response $response
'context' => $blockContext,
'settings' => $blockContext->getSettings(),
'block' => $blockContext->getBlock(),
'pager' => $this->manager->getPager($criteria, 1, $blockContext->getSetting('number')),
'pager' => $this->manager->getPaginator($criteria, 1, $blockContext->getSetting('number')),
'admin_pool' => $this->adminPool,
];

Expand Down
125 changes: 0 additions & 125 deletions src/Controller/Api/CommentController.php

This file was deleted.

0 comments on commit fbf6ee7

Please sign in to comment.