Skip to content
Merged
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
7 changes: 7 additions & 0 deletions Classes/Controller/SessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
use PhpList\PhpList4\Domain\Model\Identity\Administrator;
use PhpList\PhpList4\Domain\Model\Identity\AdministratorToken;
use PhpList\PhpList4\Domain\Repository\Identity\AdministratorRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
* This controller provides methods to create and destroy REST API sessions.
*
* @Route("/api/v2")
*
* @author Oliver Klee <[email protected]>
*/
class SessionController extends Controller
Expand Down Expand Up @@ -43,6 +47,9 @@ public function __construct()
/**
* Creates a new session (if the provided credentials are valid).
*
* @Route("/sessions")
* @Method("POST")
*
* @param Request $request
*
* @return Response
Expand Down
6 changes: 3 additions & 3 deletions Tests/Integration/Composer/ScriptsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ public function moduleRoutesConfigurationFileExists()
public function moduleRoutingDataProvider(): array
{
return [
'route name' => ['phplist/rest-api.create_session'],
'defaults' => ["defaults: { _controller: 'PhpListRestBundle:Session:create' }"],
'methods' => ['methods: [POST]'],
'route name' => ['phplist/rest-api.rest-api'],
'resource' => ["resource: '@PhpListRestBundle/Controller/'"],
'type' => ['type: annotation'],
];
}

Expand Down
11 changes: 3 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,9 @@
"PhpList\\RestBundle\\PhpListRestBundle"
],
"routes": {
"create_session": {
"path": "/api/v2/sessions",
"defaults": {
"_controller": "PhpListRestBundle:Session:create"
},
"methods": [
"POST"
]
"rest-api": {
"resource": "@PhpListRestBundle/Controller/",
"type": "annotation"
}
}
}
Expand Down