Skip to content

Commit

Permalink
🐛 update CREATE Content
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuMarchand committed Mar 17, 2024
1 parent 9a6ec3c commit c21d9ca
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 16 deletions.
9 changes: 0 additions & 9 deletions src/Controller/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@

namespace App\Controller;

use App\Entity\User;
use App\Enum\RoleEnum;
use App\Form\RegisterFormType;
use App\Manager\Auth\RegistrationManager;
use App\Manager\Auth\SessionManager;
use FOS\RestBundle\Controller\AbstractFOSRestController;
use FOS\RestBundle\Controller\Annotations as Rest;
use FOS\RestBundle\Controller\Annotations\Route;
use FOS\RestBundle\View\View;
use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Attributes as OA;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Http\Attribute\CurrentUser;
use Symfony\Component\Security\Http\Attribute\IsGranted;

#[OA\Tag(name: 'Home')]
#[Route(path: '/api')]
Expand Down
1 change: 1 addition & 0 deletions src/Manager/AbstractManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function __construct(

/* @phpstan-ignore-next-line */
if ($token && $token->getUser() && !is_string($token->getUser())) {
/* @phpstan-ignore-next-line */
$this->user = $token->getUser();
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/Repository/ContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public function get(string $id): ?Content
->getOneOrNullResult();
}

/**
* @return Content[]
*/
public function list(string $userId): array
{
return $this->createQueryBuilder('c')
Expand Down
1 change: 0 additions & 1 deletion tests/Controller/Auth/LoginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Tests\Controller\Auth;

use App\Tests\Base\AbstractTest;
use function json_encode;

class LoginTest extends AbstractTest
{
Expand Down
2 changes: 0 additions & 2 deletions tests/Controller/Auth/RegisterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
use App\Factory\UserFactory;
use App\Tests\Base\AbstractTest;
use Symfony\Component\HttpFoundation\Response;
use function json_encode;
use const JSON_THROW_ON_ERROR;

class RegisterTest extends AbstractTest
{
Expand Down
1 change: 0 additions & 1 deletion tests/Controller/Content/DeleteContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Tests\Controller\Content;

use App\Factory\ContentFactory;
use App\Factory\ProfileFactory;
use App\Factory\UserFactory;
use App\Tests\Base\AbstractTest;
use Symfony\Component\HttpFoundation\Response;
Expand Down
1 change: 0 additions & 1 deletion tests/Controller/Content/ListContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use App\Factory\UserFactory;
use App\Tests\Base\AbstractTest;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Zenstruck\Foundry\Test\Factories;

Expand Down
2 changes: 0 additions & 2 deletions tests/Controller/Profile/CreateProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Zenstruck\Foundry\Test\Factories;
use function json_encode;
use const JSON_THROW_ON_ERROR;

class CreateProfileTest extends AbstractTest
{
Expand Down

0 comments on commit c21d9ca

Please sign in to comment.