Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions Controller/BlacklistItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
namespace Sulu\Bundle\CommunityBundle\Controller;

use Doctrine\ORM\EntityManagerInterface;
use FOS\RestBundle\Controller\Annotations\NamePrefix;
use FOS\RestBundle\Controller\Annotations\RouteResource;
use FOS\RestBundle\Routing\ClassResourceInterface;
use FOS\RestBundle\View\ViewHandlerInterface;
use Sulu\Component\Rest\AbstractRestController;
use Sulu\Bundle\CommunityBundle\Entity\BlacklistItem;
use Sulu\Bundle\CommunityBundle\Manager\BlacklistItemManagerInterface;
use Sulu\Component\Rest\AbstractRestController;
use Sulu\Component\Rest\ListBuilder\Doctrine\DoctrineListBuilderFactoryInterface;
use Sulu\Component\Rest\ListBuilder\Doctrine\FieldDescriptor\DoctrineFieldDescriptor;
use Sulu\Component\Rest\ListBuilder\FieldDescriptorInterface;
Expand All @@ -32,12 +29,8 @@

/**
* Provides admin-api for blacklist-items.
*
* @NamePrefix("sulu_community.")
*
* @RouteResource("blacklist-item")
*/
class BlacklistItemController extends AbstractRestController implements ClassResourceInterface
class BlacklistItemController extends AbstractRestController
{
use RequestParametersTrait;

Expand Down
58 changes: 55 additions & 3 deletions Resources/config/routing_api.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
sulu_community.blacklist_item:
type: rest
resource: sulu_community.controller.blacklist_item
sulu_community.fields_blacklist-item:
path: '/blacklist-items/fields.{_format}'
methods: GET
controller: 'sulu_community.controller.blacklist_item::fieldsAction'
format: json
defaults: { _format: json }
requirements: { _format: json|csv }

sulu_community.get_blacklist-items:
path: '/blacklist-items.{_format}'
methods: GET
controller: 'sulu_community.controller.blacklist_item::cgetAction'
format: json
defaults: { _format: json }
requirements: { _format: json|csv }

sulu_community.get_blacklist-item:
path: '/blacklist-items/{id}.{_format}'
methods: GET
controller: 'sulu_community.controller.blacklist_item::getAction'
format: json
defaults: { _format: json }
requirements: { _format: json|csv }

sulu_community.post_blacklist-item:
path: '/blacklist-items.{_format}'
methods: POST
controller: 'sulu_community.controller.blacklist_item::postAction'
format: json
defaults: { _format: json }
requirements: { _format: json|csv }

sulu_community.delete_blacklist-item:
path: '/blacklist-items/{id}.{_format}'
methods: DELETE
controller: 'sulu_community.controller.blacklist_item::deleteAction'
format: json
defaults: { _format: json }
requirements: { _format: json|csv }

sulu_community.delete_blacklist-items:
path: '/blacklist-items.{_format}'
methods: DELETE
controller: 'sulu_community.controller.blacklist_item::cdeleteAction'
format: json
defaults: { _format: json }
requirements: { _format: json|csv }

sulu_community.put_blacklist-item:
path: '/blacklist-items/{id}.{_format}'
methods: PUT
controller: 'sulu_community.controller.blacklist_item::putAction'
format: json
defaults: { _format: json }
requirements: { _format: json|csv }
1 change: 0 additions & 1 deletion Resources/doc/1-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Register the admin routes:
# config/routes/sulu_community_admin.yaml

sulu_community_api:
type: rest
resource: "@SuluCommunityBundle/Resources/config/routing_api.yaml"
prefix: /admin/api
```
Expand Down
1 change: 0 additions & 1 deletion Tests/Application/config/routing_admin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
sulu_community_api:
type: rest
prefix: /admin/api
resource: "@SuluCommunityBundle/Resources/config/routing_api.yaml"
16 changes: 16 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

## 2.0.0 (unreleased)

### FOSRestRouting Bundle removed

As announced in Sulu [2.6.10](https://github.com/sulu/sulu/blob/2.6/UPGRADE-2.x.md)
the `type: rest` / [FOSRestRouting](https://github.com/handcraftedinthealps/RestRoutingBundle) was removed.

The following change is needed in your application:

```diff
# config/routes/sulu_community_admin.yaml

sulu_community_api:
- type: rest
resource: "@SuluCommunityBundle/Resources/config/routing_api.yaml"
prefix: /admin/api
```

### ListRepresentation relation name changed

The name of the relation inside of the `_embedded` field has been changed from `items` to `blacklist_items`.
Expand Down
24 changes: 17 additions & 7 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,42 @@ parameters:
path: Controller/AbstractController.php

-
message: "#^Parameter \\#1 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManagerInterface\\:\\:completion\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, mixed given\\.$#"
message: "#^Parameter \\#1 \\$type of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:createForm\\(\\) expects class\\-string\\<Symfony\\\\Component\\\\Form\\\\FormTypeInterface\\<Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User\\>\\>, string given\\.$#"
count: 1
path: Controller/CompletionController.php

-
message: "#^Parameter \\#2 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\CompletionController\\:\\:saveMediaFields\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, mixed given\\.$#"
message: "#^Parameter \\#1 \\$emailUsername of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManagerInterface\\:\\:passwordForget\\(\\) expects string, mixed given\\.$#"
count: 1
path: Controller/CompletionController.php
path: Controller/PasswordController.php

-
message: "#^Parameter \\#1 \\$emailUsername of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Manager\\\\CommunityManagerInterface\\:\\:passwordForget\\(\\) expects string, mixed given\\.$#"
message: "#^Parameter \\#1 \\$type of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:createForm\\(\\) expects class\\-string\\<Symfony\\\\Component\\\\Form\\\\FormTypeInterface\\<Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User\\>\\>, string given\\.$#"
count: 1
path: Controller/PasswordController.php

-
message: "#^Parameter \\#1 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:setUserPasswordAndSalt\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, mixed given\\.$#"
message: "#^Parameter \\#1 \\$type of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:createForm\\(\\) expects class\\-string\\<Symfony\\\\Component\\\\Form\\\\FormTypeInterface\\<array\\{\\}\\>\\>, string given\\.$#"
count: 1
path: Controller/PasswordController.php

-
message: "#^Parameter \\#1 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:setUserPasswordAndSalt\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, mixed given\\.$#"
message: "#^Parameter \\#1 \\$type of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:createForm\\(\\) expects class\\-string\\<Symfony\\\\Component\\\\Form\\\\FormTypeInterface\\<Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User\\|null\\>\\>, string given\\.$#"
count: 1
path: Controller/ProfileController.php

-
message: "#^Parameter \\#1 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:setUserPasswordAndSalt\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User\\|null given\\.$#"
count: 1
path: Controller/ProfileController.php

-
message: "#^Parameter \\#1 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:setUserPasswordAndSalt\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, mixed given\\.$#"
message: "#^Parameter \\#1 \\$type of method Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:\\:createForm\\(\\) expects class\\-string\\<Symfony\\\\Component\\\\Form\\\\FormTypeInterface\\<null\\>\\>, string given\\.$#"
count: 1
path: Controller/RegistrationController.php

-
message: "#^Parameter \\#1 \\$user of method Sulu\\\\Bundle\\\\CommunityBundle\\\\Controller\\\\AbstractController\\:\\:setUserPasswordAndSalt\\(\\) expects Sulu\\\\Bundle\\\\SecurityBundle\\\\Entity\\\\User, null given\\.$#"
count: 1
path: Controller/RegistrationController.php

Expand Down
Loading