diff --git a/src/new/config/reference.php b/src/new/config/reference.php index 577739b43..1875f986e 100644 --- a/src/new/config/reference.php +++ b/src/new/config/reference.php @@ -474,7 +474,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; * datetime?: array{ * default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP" * default_deserialization_formats?: list, - * default_timezone?: scalar|null, // Default: "Europe/Berlin" + * default_timezone?: scalar|null, // Default: "UTC" * cdata?: scalar|null, // Default: true * }, * array_collection?: array{ @@ -574,7 +574,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; * datetime?: array{ * default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP" * default_deserialization_formats?: list, - * default_timezone?: scalar|null, // Default: "Europe/Berlin" + * default_timezone?: scalar|null, // Default: "UTC" * cdata?: scalar|null, // Default: true * }, * array_collection?: array{ diff --git a/src/new/src/PSC/Backend/DashboardBundle/Controller/DashboardController.php b/src/new/src/PSC/Backend/DashboardBundle/Controller/DashboardController.php index b202bd447..0490f6ff0 100755 --- a/src/new/src/PSC/Backend/DashboardBundle/Controller/DashboardController.php +++ b/src/new/src/PSC/Backend/DashboardBundle/Controller/DashboardController.php @@ -23,7 +23,7 @@ use PSC\System\UpdateBundle\Service\Migration; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Intl\NumberFormatter\NumberFormatter; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\UX\Chartjs\Builder\ChartBuilderInterface; use Symfony\UX\Chartjs\Model\Chart; diff --git a/src/new/src/PSC/Backend/DashboardBundle/Controller/DefaultController.php b/src/new/src/PSC/Backend/DashboardBundle/Controller/DefaultController.php index 2ef96b6f1..666293fdd 100755 --- a/src/new/src/PSC/Backend/DashboardBundle/Controller/DefaultController.php +++ b/src/new/src/PSC/Backend/DashboardBundle/Controller/DefaultController.php @@ -15,7 +15,7 @@ namespace PSC\Backend\DashboardBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; diff --git a/src/new/src/PSC/Backend/DashboardBundle/Controller/LoginController.php b/src/new/src/PSC/Backend/DashboardBundle/Controller/LoginController.php index 60c4d9e2d..f1f6265e1 100755 --- a/src/new/src/PSC/Backend/DashboardBundle/Controller/LoginController.php +++ b/src/new/src/PSC/Backend/DashboardBundle/Controller/LoginController.php @@ -16,7 +16,7 @@ namespace PSC\Backend\DashboardBundle\Controller; use Http\Message\Authentication; use PSC\System\UpdateBundle\Service\Migration; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; diff --git a/src/new/src/PSC/Backend/DomainBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Backend/DomainBundle/Controller/Backend/ListController.php index e2cd9e173..aa228e5c6 100755 --- a/src/new/src/PSC/Backend/DomainBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Backend/DomainBundle/Controller/Backend/ListController.php @@ -30,7 +30,7 @@ use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ExporterController.php b/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ExporterController.php index 3e396c537..03feffc93 100755 --- a/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ExporterController.php +++ b/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ExporterController.php @@ -4,7 +4,7 @@ namespace PSC\Backend\ToolsBundle\Controller\Backend; use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface; use PSC\Backend\ToolsBundle\Service\ExporterRegistry; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; diff --git a/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ImporterController.php b/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ImporterController.php index 107d7b829..8ae77aefb 100755 --- a/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ImporterController.php +++ b/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ImporterController.php @@ -5,7 +5,7 @@ namespace PSC\Backend\ToolsBundle\Controller\Backend; use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface; use PSC\Backend\ToolsBundle\Service\ImporterRegistry; use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Account/GetParentByTitle.php b/src/new/src/PSC/Component/ApiBundle/Api/Account/GetParentByTitle.php index fad0eb5ff..85eda25c9 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Account/GetParentByTitle.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Account/GetParentByTitle.php @@ -3,65 +3,65 @@ namespace PSC\Component\ApiBundle\Api\Account; use Doctrine\ORM\EntityManagerInterface; -use Nelmio\ApiDocBundle\Annotation\Model; -use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; use PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input; use PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Output; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Model\Shop; use PSC\Component\ApiBundle\Model\Shop\Domain; +use PSC\Shop\EntityBundle\Entity\Account; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Yaml\Yaml; -use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; +use Symfony\Component\HttpKernel\KernelInterface; +use Symfony\Component\Routing\Attribute\Route; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\Yaml\Yaml; class GetParentByTitle extends AbstractController { private EntityManagerInterface $entityManager; private \PSC\System\SettingsBundle\Service\Shop $shopService; - public function __construct(EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService) - { + public function __construct( + EntityManagerInterface $entityManager, + \PSC\System\SettingsBundle\Service\Shop $shopService, + ) { $this->entityManager = $entityManager; $this->shopService = $shopService; } - /** - * Check account parents by title - * - * @OA\Response( - * response=200, - * description="account", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input::class)) - * ) - * @OA\Tag(name="Account") - * @IsGranted("ROLE_API") - * @Security(name="ApiKeyAuth") - */ + #[Response( + response: 200, + description: 'account', + content: new JsonContent( + ref: new Model(type: PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Output::class), + ), + )] + #[RequestBody( + description: 'This is a request body', + content: new Model(type: PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input::class), + )] + #[Tag(name: 'Account')] + #[IsGranted('ROLE_API')] + #[Security(name: 'ApiKeyAuth')] #[Route(path: '/account/getparentbytitle', methods: ['POST'])] - public function existsAction(#[MapRequestPayload] Input $data): JsonResponse + public function existsAction(#[MapRequestPayload] Input $data): JsonResponse { $output = new Output(); $account = $this->entityManager ->getRepository('PSC\Shop\EntityBundle\Entity\Account') - ->getAccountByTitle( - $data->title - ); - - + ->getAccountByTitle($data->title); if (!$account) { - $output->parent = ""; + $output->parent = ''; $output->parent_id = 0; return $this->json($output); } @@ -76,14 +76,7 @@ class GetParentByTitle extends AbstractController return $this->json($output); } - /** - * Gets the Parent Account - * - * @param \PSC\Shop\EntityBundle\Entity\Account $account - * - * @return \PSC\Shop\EntityBundle\Entity\Account - */ - protected function recursiveParent(\PSC\Shop\EntityBundle\Entity\Account $account) + protected function recursiveParent(\PSC\Shop\EntityBundle\Entity\Account $account): Account { if ($account->getParent()) { $account = $this->recursiveParent($account->getParent()); diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Cms/Get.php b/src/new/src/PSC/Component/ApiBundle/Api/Cms/Get.php index 35df94279..0f9d6bac1 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Cms/Get.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Cms/Get.php @@ -3,9 +3,11 @@ namespace PSC\Component\ApiBundle\Api\Cms; use Doctrine\ORM\EntityManagerInterface; -use Nelmio\ApiDocBundle\Annotation\Model; -use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; use PSC\Component\ApiBundle\Dto\Cms\Cms\Output; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Shop\Shops; @@ -14,11 +16,11 @@ use PSC\Component\ApiBundle\Model\Shop; use PSC\Component\ApiBundle\Model\Shop\Domain; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Yaml\Yaml; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\Yaml\Yaml; class Get extends AbstractController { @@ -26,27 +28,24 @@ class Get extends AbstractController private Cms $hydrateCms; private \PSC\System\SettingsBundle\Service\Shop $shopService; - public function __construct(EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService, Cms $hydrateCms) - { + public function __construct( + EntityManagerInterface $entityManager, + \PSC\System\SettingsBundle\Service\Shop $shopService, + Cms $hydrateCms, + ) { $this->entityManager = $entityManager; $this->hydrateCms = $hydrateCms; $this->shopService = $shopService; } - /** - * Cms - * - * @OA\Response( - * response=200, - * description="cms", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Cms\Cms\Output::class)) - * ) - * @OA\Tag(name="Cms") - */ + #[Response(response: 200, description: 'cms', content: new JsonContent(ref: new Model(type: Output::class)))] + #[Tag(name: 'Cms')] #[Route(path: '/cms', methods: ['GET'])] public function allAction(): JsonResponse { - $cmss = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Cms::class)->findAllByShop($this->shopService->getShopByDomain()); + $cmss = $this->entityManager + ->getRepository(\PSC\Shop\EntityBundle\Entity\Cms::class) + ->findAllByShop($this->shopService->getShopByDomain()); $data = []; /** @var \PSC\Shop\EntityBundle\Entity\Cms $cms */ @@ -57,21 +56,17 @@ class Get extends AbstractController return $this->json(new Output($data)); } - /** - * Get One Cms - * - * @OA\Response( - * response=200, - * description="found cms", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Cms::class)) - * ) - * @OA\Response( - * response=404, - * description="not found", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Error\NotFound::class)) - * ) - * @OA\Tag(name="Cms") - */ + #[Response( + response: 200, + description: 'found cms', + content: new JsonContent(ref: new Model(type: \PSC\Component\ApiBundle\Model\Cms::class)), + )] + #[Response( + response: 404, + description: 'not found', + content: new JsonContent(ref: new Model(type: NotFound::class)), + )] + #[Tag(name: 'Cms')] #[Route(path: '/cms/{id}', methods: ['GET'])] public function one($id): JsonResponse { diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Plugin/Get.php b/src/new/src/PSC/Component/ApiBundle/Api/Plugin/Get.php index cef728620..a867c5ce0 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Plugin/Get.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Plugin/Get.php @@ -4,9 +4,11 @@ namespace PSC\Component\ApiBundle\Api\Plugin; use Doctrine\ODM\MongoDB\DocumentManager; use MongoDB\BSON\ObjectId; -use Nelmio\ApiDocBundle\Annotation\Model; -use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Model\Shop; @@ -14,11 +16,11 @@ use PSC\Component\ApiBundle\Model\Shop\Domain; use PSC\System\PluginBundle\Interfaces\Plugin; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Yaml\Yaml; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\Yaml\Yaml; class Get extends AbstractController { @@ -29,16 +31,12 @@ class Get extends AbstractController $this->documentManager = $documentManager; } - /** - * Layouter Plugins - * - * @OA\Response( - * response=200, - * description="shops", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class)) - * ) - * @OA\Tag(name="Plugin") - */ + #[Response( + response: 200, + description: 'shops', + content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class)), + )] + #[Tag(name: 'Plugin')] #[Route(path: '/plugins/layouter', methods: ['GET'])] public function layouterAction(): JsonResponse { @@ -61,17 +59,13 @@ class Get extends AbstractController return $this->json(new Shops\Output($data)); } - /** - * Plugins - * - * @OA\Response( - * response=200, - * description="shops", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class)) - * ) - * @OA\Tag(name="Plugin") - * @Security(name="ApiKeyAuth") - */ + #[Response( + response: 200, + description: 'shops', + content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class)), + )] + #[Tag(name: 'Plugin')] + #[Security(name: 'ApiKeyAuth')] #[Route(path: '/plugins', methods: ['GET'])] #[IsGranted('ROLE_API')] public function allAction(): JsonResponse @@ -90,27 +84,25 @@ class Get extends AbstractController return $this->json(new Shops\Output($data)); } - /** - * Get one plugin - * - * @OA\Response( - * response=200, - * description="found plugin", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Plugin::class)) - * ) - * @OA\Response( - * response=404, - * description="not found", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Error\NotFound::class)) - * ) - * @OA\Tag(name="Plugin") - * @Security(name="ApiKeyAuth") - */ + #[Response( + response: 200, + description: 'found plugin', + content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Model\Plugin::class)), + )] + #[Response( + response: 404, + description: 'not found', + content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Error\NotFound::class)), + )] + #[Tag(name: 'Plugin')] + #[Security(name: 'ApiKeyAuth')] #[Route(path: '/plugins/{uuid}', methods: ['GET'])] #[IsGranted('ROLE_API')] public function one($uuid): JsonResponse { - $plugin = $this->documentManager->getRepository(\PSC\System\PluginBundle\Document\Plugin::class)->findOneBy(['id' => new ObjectId($uuid)]); + $plugin = $this->documentManager + ->getRepository(\PSC\System\PluginBundle\Document\Plugin::class) + ->findOneBy(['id' => new ObjectId($uuid)]); if (!$plugin) { return $this->json(new NotFound()); } diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Shop/Get.php b/src/new/src/PSC/Component/ApiBundle/Api/Shop/Get.php index bd814e332..71a7494e1 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Shop/Get.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Shop/Get.php @@ -3,44 +3,44 @@ namespace PSC\Component\ApiBundle\Api\Shop; use Doctrine\ORM\EntityManagerInterface; -use Nelmio\ApiDocBundle\Annotation\Model; -use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Model\Shop; use PSC\Component\ApiBundle\Model\Shop\Domain; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Yaml\Yaml; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\Yaml\Yaml; class Get extends AbstractController { private EntityManagerInterface $entityManager; private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop; - public function __construct(EntityManagerInterface $entityManager, \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop) - { + public function __construct( + EntityManagerInterface $entityManager, + \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop, + ) { $this->entityManager = $entityManager; $this->hydrateShop = $hydrateShop; } - /** - * Shops - * - * @OA\Response( - * response=200, - * description="shops", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Shop\Shops\Output::class)) - * ) - * @OA\Tag(name="Shops") - * @Security(name="ApiKeyAuth") - * @Security(name="Bearer") - */ + #[Response( + response: 200, + description: 'shops', + content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Shop\Shops\Output::class)), + )] + #[Tag(name: 'Shops')] + #[Security(name: 'ApiKeyAuth')] + #[Security(name: 'Bearer')] #[Route(path: '/shops', methods: ['GET'])] #[IsGranted('ROLE_SHOP')] public function allAction(): JsonResponse @@ -56,27 +56,25 @@ class Get extends AbstractController return $this->json(new Shops\Output($data)); } - /** - * Get One Shop - * - * @OA\Response( - * response=200, - * description="found shop", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Shop::class)) - * ) - * @OA\Response( - * response=404, - * description="not found", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Error\NotFound::class)) - * ) - * @OA\Tag(name="Shops") - * @Security(name="ApiKeyAuth") - */ + #[Response( + response: 200, + description: 'found shop', + content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Model\Shop::class)), + )] + #[Response( + response: 404, + description: 'not found', + content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Error\NotFound::class)), + )] + #[Tag(name: 'Shops')] + #[Security(name: 'ApiKeyAuth')] #[Route(path: '/shops/{id}', methods: ['GET'])] #[IsGranted('ROLE_API')] public function one($id): JsonResponse { - $shop = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Shop::class)->findOneBy(['uid' => $id]); + $shop = $this->entityManager + ->getRepository(\PSC\Shop\EntityBundle\Entity\Shop::class) + ->findOneBy(['uid' => $id]); if ($shop) { return $this->json($this->hydrateShop->hydrateToModel($shop)); diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/CreateByNr.php b/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/CreateByNr.php index d8b390099..654c6e675 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/CreateByNr.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/CreateByNr.php @@ -3,9 +3,12 @@ namespace PSC\Component\ApiBundle\Api\Stockbooking; use Doctrine\ORM\EntityManagerInterface; -use Nelmio\ApiDocBundle\Annotation\Model; -use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\PersistFailure; use PSC\Component\ApiBundle\Dto\Shop\Shops; @@ -17,55 +20,58 @@ use PSC\Component\ApiBundle\Model\Shop\Domain; use PSC\Component\ApiBundle\Model\Stockbooking; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Yaml\Yaml; -use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; +use Symfony\Component\HttpKernel\KernelInterface; +use Symfony\Component\Routing\Attribute\Route; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\Yaml\Yaml; class CreateByNr extends AbstractController { private EntityManagerInterface $entityManager; private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop; - public function __construct(EntityManagerInterface $entityManager, \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop) - { + public function __construct( + EntityManagerInterface $entityManager, + \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop, + ) { $this->entityManager = $entityManager; $this->hydrateShop = $hydrateShop; } - /** - * create by nr - * - * @OA\Response( - * response=200, - * description="stockbooking", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Input::class)) - * ) - * @OA\Tag(name="Stockbooking") - * @IsGranted("ROLE_API") - * @Security(name="ApiKeyAuth") - */ + #[Response( + response: 200, + description: 'stockbooking', + content: new JsonContent( + ref: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Output::class), + ), + )] + #[RequestBody( + description: 'This is a request body', + content: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Input::class), + )] + #[Tag(name: 'Stockbooking')] + #[IsGranted('ROLE_API')] + #[Security(name: 'ApiKeyAuth')] #[Route(path: '/stockbooking/createbynr', methods: ['POST'])] - public function create(#[MapRequestPayload] Input $data): JsonResponse + public function create(#[MapRequestPayload] Input $data): JsonResponse { $product = $this->entityManager - ->getRepository('PSC\Shop\EntityBundle\Entity\Product')->createQueryBuilder('product') + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->createQueryBuilder('product') ->andWhere('product.nrIntern = :nr or product.nrExtern = :nr') ->setParameter('nr', $data->product_nr) - ->getQuery()->getOneOrNullResult(); + ->getQuery() + ->getOneOrNullResult(); if ($product) { $contact = $this->entityManager - ->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(['uid' => $data->contact_id]); + ->getRepository('PSC\Shop\EntityBundle\Entity\Contact') + ->findOneBy(['uid' => $data->contact_id]); if (!$contact) { - return $this->json(new NotFound("Contact not found")); + return $this->json(new NotFound('Contact not found')); } $stBooking = new \PSC\Shop\EntityBundle\Entity\Stockbooking($product); @@ -89,6 +95,6 @@ class CreateByNr extends AbstractController return $this->json(new Output()); } - return $this->json(new NotFound("Product not found")); + return $this->json(new NotFound('Product not found')); } } diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/GetByNr.php b/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/GetByNr.php index 7c63d408b..5bed3b1da 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/GetByNr.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/GetByNr.php @@ -3,9 +3,12 @@ namespace PSC\Component\ApiBundle\Api\Stockbooking; use Doctrine\ORM\EntityManagerInterface; -use Nelmio\ApiDocBundle\Annotation\Model; -use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input; @@ -16,55 +19,55 @@ use PSC\Component\ApiBundle\Model\Shop\Domain; use PSC\Component\ApiBundle\Model\Stockbooking; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Yaml\Yaml; -use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; +use Symfony\Component\HttpKernel\KernelInterface; +use Symfony\Component\Routing\Attribute\Route; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\Yaml\Yaml; class GetByNr extends AbstractController { private EntityManagerInterface $entityManager; private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop; - public function __construct(EntityManagerInterface $entityManager, \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop) - { + public function __construct( + EntityManagerInterface $entityManager, + \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop, + ) { $this->entityManager = $entityManager; $this->hydrateShop = $hydrateShop; } - /** - * get all by nr - * - * @OA\Response( - * response=200, - * description="account", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input::class)) - * ) - * @OA\Tag(name="Stockbooking") - * @IsGranted("ROLE_API") - * @Security(name="ApiKeyAuth") - */ + #[Response( + response: 200, + description: 'account', + content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Output::class)), + )] + #[RequestBody( + description: 'This is a request body', + content: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input::class), + )] + #[Tag(name: 'Stockbooking')] + #[IsGranted('ROLE_API')] + #[Security(name: 'ApiKeyAuth')] #[Route(path: '/stockbooking/getallbynr', methods: ['POST'])] - public function allAction(#[MapRequestPayload] Input $data): JsonResponse + public function allAction(#[MapRequestPayload] Input $data): JsonResponse { $product = $this->entityManager - ->getRepository('PSC\Shop\EntityBundle\Entity\Product')->createQueryBuilder('product') + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->createQueryBuilder('product') ->andWhere('product.nrIntern = :nr or product.nrExtern = :nr') ->setParameter('nr', $data->nr) - ->getQuery()->getOneOrNullResult(); + ->getQuery() + ->getOneOrNullResult(); if ($product) { $bookings = $this->entityManager ->getRepository('PSC\Shop\EntityBundle\Entity\Stockbooking') ->findByProduct($product); - $bookingsTemp = array(); + $bookingsTemp = []; /** @var \PSC\Shop\EntityBundle\Entity\Stockbooking $booking */ foreach ($bookings as $booking) { $contact = new Contact(); @@ -85,6 +88,6 @@ class GetByNr extends AbstractController return $this->json(new Output($bookingsTemp)); } - return $this->json(new NotFound("Product not found")); + return $this->json(new NotFound('Product not found')); } } diff --git a/src/new/src/PSC/Component/ApiBundle/Api/System/Info.php b/src/new/src/PSC/Component/ApiBundle/Api/System/Info.php index 96a94c20f..64d56a5c8 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/System/Info.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/System/Info.php @@ -3,32 +3,28 @@ namespace PSC\Component\ApiBundle\Api\System; use Doctrine\ODM\MongoDB\DocumentManager; -use Nelmio\ApiDocBundle\Annotation\Model; -use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; use PSC\Component\ApiBundle\Model\Instance; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Yaml\Yaml; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\Yaml\Yaml; class Info extends AbstractController { - /** - * Get system info. - * - * - * @Security(name="ApiKeyAuth") - * @OA\Response( - * response=200, - * description="Returns system info", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Instance::class)) - * ) - * @OA\Tag(name="System") - */ + #[Tag(name: 'System')] + #[Response( + response: 200, + description: 'Returns system info', + content: new JsonContent(ref: new Model(type: Instance::class)), + )] #[Route(path: '/system/info', methods: ['GET'])] #[IsGranted('ROLE_API')] public function infoAction(DocumentManager $documentManager): JsonResponse @@ -38,14 +34,13 @@ class Info extends AbstractController ->getRepository(\PSC\Shop\EntityBundle\Document\Instance::class) ->findOneBy(['appId' => '1']); - $data = new Instance(); $data->sftpHost = getenv('ftpIp'); $data->ip = getenv('ftpIp'); $data->sftpUserName = getenv('ftpUsername'); $data->sftpPassword = getenv('ftpPassword'); $data->sftpPort = getenv('ftpPort'); - if($instance && $instance->isSmtpOwn()) { + if ($instance && $instance->isSmtpOwn()) { $data->smtpOwn = true; } diff --git a/src/new/src/PSC/Component/ApiBundle/Api/System/Version.php b/src/new/src/PSC/Component/ApiBundle/Api/System/Version.php index aaac59492..7136c0d20 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/System/Version.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/System/Version.php @@ -2,14 +2,16 @@ namespace PSC\Component\ApiBundle\Api\System; -use Nelmio\ApiDocBundle\Annotation\Model; -use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; class Version extends AbstractController @@ -21,17 +23,12 @@ class Version extends AbstractController $this->kernel = $kernel; } - /** - * Get Release version. - * - * - * @OA\Response( - * response=200, - * description="release version", - * @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Version::class)) - * ) - * @OA\Tag(name="System") - */ + #[Response( + response: 200, + description: 'release version', + content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Model\Version::class)), + )] + #[Tag(name: 'System')] #[Route(path: '/system/version', methods: ['GET'])] public function versionAction(): JsonResponse { diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Account/GetParentByTitle/Input.php b/src/new/src/PSC/Component/ApiBundle/Dto/Account/GetParentByTitle/Input.php index bdc2a00a6..61a1359e7 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Account/GetParentByTitle/Input.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Account/GetParentByTitle/Input.php @@ -2,15 +2,12 @@ namespace PSC\Component\ApiBundle\Dto\Account\GetParentByTitle; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; final class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $title; } diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Account/GetParentByTitle/Output.php b/src/new/src/PSC/Component/ApiBundle/Dto/Account/GetParentByTitle/Output.php index 87d51290c..f054552c7 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Account/GetParentByTitle/Output.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Account/GetParentByTitle/Output.php @@ -2,22 +2,15 @@ namespace PSC\Component\ApiBundle\Dto\Account\GetParentByTitle; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; final class Output { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $parent; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $parent_id; } diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Cms/Cms/Output.php b/src/new/src/PSC/Component/ApiBundle/Dto/Cms/Cms/Output.php index 6c95dcbb7..73750c52c 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Cms/Cms/Output.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Cms/Cms/Output.php @@ -3,8 +3,10 @@ namespace PSC\Component\ApiBundle\Dto\Cms\Cms; use PSC\Component\ApiBundle\Model\Cms; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; class Output { @@ -14,17 +16,9 @@ class Output $this->count = count($cms); } - /** - * @var Cms[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Cms::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Cms::class)))] public array $data = []; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $count = 0; } diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Error/NotFound.php b/src/new/src/PSC/Component/ApiBundle/Dto/Error/NotFound.php index 6f7f4cfc1..28dd5ee3c 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Error/NotFound.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Error/NotFound.php @@ -3,8 +3,9 @@ namespace PSC\Component\ApiBundle\Dto\Error; use PSC\Component\ApiBundle\Model\Shop; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class NotFound { @@ -13,8 +14,6 @@ class NotFound $this->message = $message; } - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $message = ""; } diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Error/PersistFailure.php b/src/new/src/PSC/Component/ApiBundle/Dto/Error/PersistFailure.php index abf9418e1..b42410738 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Error/PersistFailure.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Error/PersistFailure.php @@ -3,8 +3,9 @@ namespace PSC\Component\ApiBundle\Dto\Error; use PSC\Component\ApiBundle\Model\Shop; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class PersistFailure { @@ -13,8 +14,6 @@ class PersistFailure $this->message = $message; } - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $message = ""; } diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Plugin/Plugins/Output.php b/src/new/src/PSC/Component/ApiBundle/Dto/Plugin/Plugins/Output.php index 4cabbd3d4..cd624d784 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Plugin/Plugins/Output.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Plugin/Plugins/Output.php @@ -2,8 +2,10 @@ namespace PSC\Component\ApiBundle\Dto\Plugin\Plugins; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; use PSC\Component\ApiBundle\Model\Plugin; class Output @@ -14,17 +16,9 @@ class Output $this->count = count($plugins); } - /** - * @var Plugin[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Plugin::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Plugin::class)))] public array $data = []; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $count = 0; } diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Shop/Shops/Output.php b/src/new/src/PSC/Component/ApiBundle/Dto/Shop/Shops/Output.php index baabbe427..3db103f1e 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Shop/Shops/Output.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Shop/Shops/Output.php @@ -3,8 +3,10 @@ namespace PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Model\Shop; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; class Output { @@ -14,17 +16,9 @@ class Output $this->count = count($shops); } - /** - * @var Shop[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Shop::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Shop::class)))] public array $data = []; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $count = 0; } diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/CreateByNr/Input.php b/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/CreateByNr/Input.php index b0c2d4546..7e3b21026 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/CreateByNr/Input.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/CreateByNr/Input.php @@ -2,43 +2,24 @@ namespace PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $product_nr = ""; - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $description = ""; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $amount = 0; - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $delivery_nr = ""; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $contact_id = 0; } diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/CreateByNr/Output.php b/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/CreateByNr/Output.php index fac33750d..7d1525a48 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/CreateByNr/Output.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/CreateByNr/Output.php @@ -2,16 +2,13 @@ namespace PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; use PSC\Component\ApiBundle\Model\Stockbooking; class Output { - /** - * @var bool - * - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $success = true; } diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/GetByNr/Input.php b/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/GetByNr/Input.php index ce9d2faf7..fd77d5bb7 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/GetByNr/Input.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/GetByNr/Input.php @@ -2,15 +2,12 @@ namespace PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $nr = ""; } diff --git a/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/GetByNr/Output.php b/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/GetByNr/Output.php index b8495de41..ee50b70cc 100755 --- a/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/GetByNr/Output.php +++ b/src/new/src/PSC/Component/ApiBundle/Dto/Stockbooking/GetByNr/Output.php @@ -2,8 +2,10 @@ namespace PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; use PSC\Component\ApiBundle\Model\Stockbooking; class Output @@ -14,17 +16,9 @@ class Output $this->count = count($shops); } - /** - * @var Stockbooking[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Stockbooking::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Stockbooking::class)))] public array $data = []; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $count = 0; } diff --git a/src/new/src/PSC/Component/ApiBundle/Model/Cms.php b/src/new/src/PSC/Component/ApiBundle/Model/Cms.php index 0363d34a9..34f218473 100755 --- a/src/new/src/PSC/Component/ApiBundle/Model/Cms.php +++ b/src/new/src/PSC/Component/ApiBundle/Model/Cms.php @@ -13,25 +13,18 @@ namespace PSC\Component\ApiBundle\Model; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Cms { - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $id; -/** - * @OA\Property(type="string", maxLength=255) - */ - public string $title = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ - public string $text = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ - public string $shopId = ""; + #[Property(type: 'string', maxLength: 255)] + public string $title = ''; + #[Property(type: 'string', maxLength: 255)] + public string $text = ''; + #[Property(type: 'string', maxLength: 255)] + public string $shopId = ''; } diff --git a/src/new/src/PSC/Component/ApiBundle/Model/Instance.php b/src/new/src/PSC/Component/ApiBundle/Model/Instance.php index 67f16840d..93b8c1be1 100755 --- a/src/new/src/PSC/Component/ApiBundle/Model/Instance.php +++ b/src/new/src/PSC/Component/ApiBundle/Model/Instance.php @@ -13,34 +13,23 @@ namespace PSC\Component\ApiBundle\Model; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Instance { - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $sftpUserName = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $sftpPassword; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $sftpPort; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $sftpHost; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $ip; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $smtpOwn = false; } diff --git a/src/new/src/PSC/Component/ApiBundle/Model/Plugin.php b/src/new/src/PSC/Component/ApiBundle/Model/Plugin.php index 7629e2f94..770fae422 100755 --- a/src/new/src/PSC/Component/ApiBundle/Model/Plugin.php +++ b/src/new/src/PSC/Component/ApiBundle/Model/Plugin.php @@ -13,8 +13,9 @@ namespace PSC\Component\ApiBundle\Model; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Plugin { @@ -24,16 +25,10 @@ class Plugin $this->title = $title; } - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $uuid = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $title = ""; -/** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $installed = false; } diff --git a/src/new/src/PSC/Component/ApiBundle/Model/Shop.php b/src/new/src/PSC/Component/ApiBundle/Model/Shop.php index 88b305eda..8421af2ee 100755 --- a/src/new/src/PSC/Component/ApiBundle/Model/Shop.php +++ b/src/new/src/PSC/Component/ApiBundle/Model/Shop.php @@ -13,62 +13,38 @@ namespace PSC\Component\ApiBundle\Model; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; class Shop { - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $id = 0; - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $uuid = ""; - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $name = ""; - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $basketField1 = ""; - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $basketField2 = ""; - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $logo1 = ""; - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $logo2 = ""; - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $browsericon = ""; - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $basketPosField1 = ""; - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $basketPosField2 = ""; - /** - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Shop\Domain::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Shop\Domain::class)))] public array $domains = []; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $disabled = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $private = false; /** diff --git a/src/new/src/PSC/Component/ApiBundle/Model/Shop/Domain.php b/src/new/src/PSC/Component/ApiBundle/Model/Shop/Domain.php index 65bcbf29b..e447cff4f 100755 --- a/src/new/src/PSC/Component/ApiBundle/Model/Shop/Domain.php +++ b/src/new/src/PSC/Component/ApiBundle/Model/Shop/Domain.php @@ -13,8 +13,9 @@ namespace PSC\Component\ApiBundle\Model\Shop; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Domain { @@ -25,16 +26,10 @@ class Domain $this->ssl = $ssl; } - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $id; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $name = ""; -/** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $ssl = false; } diff --git a/src/new/src/PSC/Component/ApiBundle/Model/Stockbooking.php b/src/new/src/PSC/Component/ApiBundle/Model/Stockbooking.php index b9e9cdcd9..187b9973d 100755 --- a/src/new/src/PSC/Component/ApiBundle/Model/Stockbooking.php +++ b/src/new/src/PSC/Component/ApiBundle/Model/Stockbooking.php @@ -13,37 +13,24 @@ namespace PSC\Component\ApiBundle\Model; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Stockbooking { - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $id; -/** - * @OA\Property(type="object") - */ + #[Property(type: 'object')] public Contact $contact; -/** - * @OA\Property(type="object") - */ + #[Property(type: 'object')] public Product $product; -/** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $amount = 0; -/** - * @OA\Property(type="date") - */ + #[Property(type: 'date')] public \DateTime $created; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $deliveryNumber; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $description; } diff --git a/src/new/src/PSC/Component/ApiBundle/Model/Version.php b/src/new/src/PSC/Component/ApiBundle/Model/Version.php index a2179ff2b..d23f4d90c 100755 --- a/src/new/src/PSC/Component/ApiBundle/Model/Version.php +++ b/src/new/src/PSC/Component/ApiBundle/Model/Version.php @@ -13,17 +13,15 @@ namespace PSC\Component\ApiBundle\Model; -use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use Nelmio\ApiDocBundle\Attribute\Model; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Version { - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $datum = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + + #[Property(type: 'string', maxLength: 255)] public string $release = ""; } diff --git a/src/new/src/PSC/Component/ConfigurationlayouterBundle/Controller/StoreController.php b/src/new/src/PSC/Component/ConfigurationlayouterBundle/Controller/StoreController.php index 1255c7161..501f34554 100755 --- a/src/new/src/PSC/Component/ConfigurationlayouterBundle/Controller/StoreController.php +++ b/src/new/src/PSC/Component/ConfigurationlayouterBundle/Controller/StoreController.php @@ -26,7 +26,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Translation\Exception\NotFoundResourceException; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hoch.php b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hoch.php index 93ab4dedf..f6f67fd9d 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hoch.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hoch.php @@ -14,7 +14,7 @@ namespace PSC\Component\SteplayouterBundle\Calendar\Type; use PSC\Component\SteplayouterBundle\Calendar\Type; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hochvariable.php b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hochvariable.php index 0d98a67e8..daee4ccc4 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hochvariable.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hochvariable.php @@ -14,7 +14,7 @@ namespace PSC\Component\SteplayouterBundle\Calendar\Type; use PSC\Component\SteplayouterBundle\Calendar\Type; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Quer.php b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Quer.php index f20740f6b..8e7fea7f1 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Quer.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Quer.php @@ -14,7 +14,7 @@ namespace PSC\Component\SteplayouterBundle\Calendar\Type; use PSC\Component\SteplayouterBundle\Calendar\Type; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/CalendarController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/CalendarController.php index 589e6f291..c3b8468bf 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/CalendarController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/CalendarController.php @@ -18,7 +18,7 @@ use PSC\Component\SteplayouterBundle\Calendar\Type\Quer; use PSC\Component\SteplayouterBundle\Calendar\Type\Hoch; use PSC\Component\SteplayouterBundle\Calendar\Design; use PSC\Component\SteplayouterBundle\Calendar\Generator; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Bridge\Twig\Attribute\Template; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/DefaultController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/DefaultController.php index 61018ab25..c53fd4b96 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/DefaultController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/DefaultController.php @@ -13,7 +13,7 @@ namespace PSC\Component\SteplayouterBundle\Controller; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/PdfController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/PdfController.php index 7dce7a735..cbd2a2ac3 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/PdfController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/PdfController.php @@ -36,7 +36,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Translation\Exception\NotFoundResourceException; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/ProductController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/ProductController.php index a98901a4e..25cba2334 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/ProductController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/ProductController.php @@ -23,7 +23,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Translation\Exception\NotFoundResourceException; use PSC\Component\SteplayouterBundle\Config\Converter\ToArray; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/StoreController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/StoreController.php index 5c11511ea..036e4c4c0 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/StoreController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/StoreController.php @@ -25,7 +25,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Translation\Exception\NotFoundResourceException; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/CheckController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/CheckController.php index 8c67912ba..ec03ca5f0 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/CheckController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/CheckController.php @@ -24,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/SettingsController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/SettingsController.php index 7d433a90e..7b84fe3b8 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/SettingsController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/SettingsController.php @@ -24,7 +24,7 @@ use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/AccountBundle/Api/AllByShop.php b/src/new/src/PSC/Shop/AccountBundle/Api/AllByShop.php index 9f588dfe5..813eef44d 100755 --- a/src/new/src/PSC/Shop/AccountBundle/Api/AllByShop.php +++ b/src/new/src/PSC/Shop/AccountBundle/Api/AllByShop.php @@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Yaml\Yaml; diff --git a/src/new/src/PSC/Shop/AccountBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/AccountBundle/Controller/Backend/EditController.php index 3694722e7..1703a010a 100755 --- a/src/new/src/PSC/Shop/AccountBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/AccountBundle/Controller/Backend/EditController.php @@ -30,7 +30,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/AccountBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/AccountBundle/Controller/Backend/ListController.php index 81a383e0f..22c385446 100755 --- a/src/new/src/PSC/Shop/AccountBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/AccountBundle/Controller/Backend/ListController.php @@ -26,7 +26,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/AccountBundle/Dto/All/Output.php b/src/new/src/PSC/Shop/AccountBundle/Dto/All/Output.php index 83e021215..78611147a 100755 --- a/src/new/src/PSC/Shop/AccountBundle/Dto/All/Output.php +++ b/src/new/src/PSC/Shop/AccountBundle/Dto/All/Output.php @@ -3,15 +3,13 @@ namespace PSC\Shop\AccountBundle\Dto\All; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; use PSC\Shop\ContactBundle\Model\Contact; class Output { - /** - * @var Contact[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\AccountBundle\Model\Account::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\AccountBundle\Model\Account::class)))] public array $data = []; } diff --git a/src/new/src/PSC/Shop/AccountBundle/Model/Account.php b/src/new/src/PSC/Shop/AccountBundle/Model/Account.php index 05124b3e9..9e31c029b 100755 --- a/src/new/src/PSC/Shop/AccountBundle/Model/Account.php +++ b/src/new/src/PSC/Shop/AccountBundle/Model/Account.php @@ -3,33 +3,24 @@ namespace PSC\Shop\AccountBundle\Model; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Account { - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $id = 0; - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $uid = 0; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $uuid = ""; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $appendix; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $title; public function getUuid(): string diff --git a/src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Save.php b/src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Save.php index c9999034c..940f38526 100644 --- a/src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Save.php +++ b/src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Save.php @@ -10,41 +10,82 @@ use OpenApi\Attributes\Response; use OpenApi\Attributes\Tag; use PSC\Shop\BasketBundle\Dto\Layouter\Input; use PSC\Shop\BasketBundle\Dto\Legacy\Output; +use PSC\Shop\EntityBundle\Entity\LayouterSession; +use PSC\Shop\EntityBundle\Repository\LayouterSessionRepository; +use PSC\Shop\EntityBundle\Repository\ProductRepository; +use Ramsey\Uuid\Nonstandard\Uuid; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; +use TP_Layouter_Item; class Save extends AbstractController { public function __construct( private readonly EntityManagerInterface $entityManager, + private readonly LayouterSessionRepository $layouterSessionRepository, private readonly EventDispatcherInterface $eventDispatcher, + private readonly ProductRepository $productRepository, private readonly TokenStorageInterface $tokenStorage, ) {} - /** - * change temp basketitem - * - * @deprecated - */ #[Tag(name: 'Basket')] - #[Response( - response: 200, - description: 'basket', - content: new JsonContent(ref: new Model(type: Output::class)) - )] - #[RequestBody( - description: 'This is a request body', - content: new Model(type: Input::class) - )] + #[Response(response: 200, description: 'basket', content: new JsonContent(ref: new Model(type: Output::class)))] + #[RequestBody(description: 'This is a request body', content: new Model(type: Input::class))] #[Route(path: '/layouter/save', methods: ['POST'])] public function save(#[MapRequestPayload] Input $data): JsonResponse { - include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php'; - include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php'; - include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php'; + include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Basket_Item.php'; + include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Basket_Collection.php'; + include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Util.php'; + include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Layouter_Item.php'; + include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Layoutersession.php'; + + $product = $this->productRepository->findOneBy(['uuid' => $data->productUUId]); + + if ($this->tokenStorage->getToken()) { + $row = new LayouterSession(); + $row->setUuid(Uuid::uuid4()->toString()); + $row->setContactId( + $this->tokenStorage + ->getToken() + ->getUser() + ->getId(), + ); + $row->setProductId($data->productUUId); + $row->setTitle($product->getTitle()); + $row->setLayouterModus($data->layouterModus); + // TODO: Store uploadedFiles in session data + $this->entityManager->persist($row); + + return $this->json([ + 'success' => true, + 'layouterUUId' => $row->getUuid(), + 'auth' => true, + 'user' => $this->tokenStorage + ->getToken() + ->getUser() + ->getUsername(), + ]); + } + + $session = new TP_Layouter_Item(); + $session->setTitle($product->getTitle()); + $session->setArticleId(Uuid::uuid4()->toString()); + $session->setOrgArticleId($data->productUUId); + $session->setIsEdit(true); + $session->setUpdated(date('Y-m-d H:i:s')); + $session->setLayouterModus($data->layouterModus); + // Store uploaded files in session + $_SESSION['Layoutersession']['data'][$session->getArticleId()] = $session; + + return $this->json([ + 'success' => true, + 'auth' => false, + 'layouterUUId' => $session->getArticleId(), + ]); } } diff --git a/src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Upload.php b/src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Upload.php new file mode 100644 index 000000000..fdffa57cb --- /dev/null +++ b/src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Upload.php @@ -0,0 +1,91 @@ +files->get('file'); + + if (!$file) { + return $this->json( + data: ['error' => 'No file provided'], + status: JsonResponse::HTTP_BAD_REQUEST, + ); + } + + try { + $selectedFolder = $documentManager->getRepository(Folder::class)->findOneBy(['_id' => $req->get('folder')]); + + $handler = $mediaManager->getHandlerForType('pdf'); + $media = new Media(); + $media->setContent($file); + $media->setFolder($selectedFolder); + $handler->prepareMedia($media); + + // Store additional metadata + $media->setTitle($req->get('fileName', $file->getClientOriginalName())); + + $documentManager->persist($media); + $documentManager->flush(); + + return $this->json([ + 'success' => true, + 'uuid' => $media->getId(), + 'url' => $media->getUrl(), + ]); + } catch (\Exception $e) { + return $this->json( + data: ['error' => 'Upload failed: ' . $e->getMessage()], + status: JsonResponse::HTTP_INTERNAL_SERVER_ERROR, + ); + } + } +} diff --git a/src/new/src/PSC/Shop/BasketBundle/Dto/Layouter/Input.php b/src/new/src/PSC/Shop/BasketBundle/Dto/Layouter/Input.php index eccee4d80..f0fedf5a7 100644 --- a/src/new/src/PSC/Shop/BasketBundle/Dto/Layouter/Input.php +++ b/src/new/src/PSC/Shop/BasketBundle/Dto/Layouter/Input.php @@ -2,6 +2,7 @@ namespace PSC\Shop\BasketBundle\Dto\Layouter; +use OpenApi\Attributes\Items; use OpenApi\Attributes\Property; class Input @@ -9,6 +10,6 @@ class Input #[Property(type: 'string')] public string $productUUId = ''; - #[Property(type: 'string')] - public string $layouterUUId = ''; + #[Property(type: 'integer')] + public int $layouterModus = 0; } diff --git a/src/new/src/PSC/Shop/CmsBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/CmsBundle/Controller/Backend/EditController.php index 44cb966b8..e8eddae07 100755 --- a/src/new/src/PSC/Shop/CmsBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/CmsBundle/Controller/Backend/EditController.php @@ -34,7 +34,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/CmsBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/CmsBundle/Controller/Backend/ListController.php index f6d412ea7..a7f89e475 100755 --- a/src/new/src/PSC/Shop/CmsBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/CmsBundle/Controller/Backend/ListController.php @@ -24,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/CmsBundle/Controller/Frontend/ShowController.php b/src/new/src/PSC/Shop/CmsBundle/Controller/Frontend/ShowController.php index a7271e65d..5c61090c1 100755 --- a/src/new/src/PSC/Shop/CmsBundle/Controller/Frontend/ShowController.php +++ b/src/new/src/PSC/Shop/CmsBundle/Controller/Frontend/ShowController.php @@ -19,7 +19,7 @@ use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/CommunicationBundle/Controller/Backend/OrderController.php b/src/new/src/PSC/Shop/CommunicationBundle/Controller/Backend/OrderController.php index 4ce29ce04..f624f5bc6 100755 --- a/src/new/src/PSC/Shop/CommunicationBundle/Controller/Backend/OrderController.php +++ b/src/new/src/PSC/Shop/CommunicationBundle/Controller/Backend/OrderController.php @@ -43,7 +43,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Address/Crud.php b/src/new/src/PSC/Shop/ContactBundle/Api/Address/Crud.php index 416895b48..91070e154 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Address/Crud.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Address/Crud.php @@ -13,7 +13,7 @@ use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use OpenApi\Attributes as OA; class Crud extends AbstractController { diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Address/GetAllForType.php b/src/new/src/PSC/Shop/ContactBundle/Api/Address/GetAllForType.php index 4b655504c..4fad0f7bd 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Address/GetAllForType.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Address/GetAllForType.php @@ -13,7 +13,7 @@ use PSC\System\SettingsBundle\Service\Shop; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use OpenApi\Attributes as OA; class GetAllForType extends AbstractController diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/All.php b/src/new/src/PSC/Shop/ContactBundle/Api/All.php index 55f942df2..a8c59e7f7 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/All.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/All.php @@ -13,7 +13,7 @@ use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use OpenApi\Attributes as OA; use Nelmio\ApiDocBundle\Annotation\Security; diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/AllByShop.php b/src/new/src/PSC/Shop/ContactBundle/Api/AllByShop.php index e1f8fda17..2976f709c 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/AllByShop.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/AllByShop.php @@ -14,7 +14,7 @@ use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use OpenApi\Attributes as OA; class AllByShop extends AbstractController diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Crud.php b/src/new/src/PSC/Shop/ContactBundle/Api/Crud.php index f1a9818fc..5fed38414 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Crud.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Crud.php @@ -14,7 +14,7 @@ use setasign\Fpdi\PdfReader\DataStructure\Rectangle; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use OpenApi\Attributes as OA; class Crud extends AbstractController { diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Exists.php b/src/new/src/PSC/Shop/ContactBundle/Api/Exists.php index 35e371751..0f0640f96 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Exists.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Exists.php @@ -5,7 +5,11 @@ namespace PSC\Shop\ContactBundle\Api; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Shop\ContactBundle\Dto\Exists\Input; use PSC\Shop\ContactBundle\Dto\Exists\Output; use PSC\Component\ApiBundle\Dto\Error\NotFound; @@ -14,9 +18,9 @@ use PSC\Component\ApiBundle\Model\Shop; use PSC\Component\ApiBundle\Model\Shop\Domain; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -35,16 +39,16 @@ class Exists extends AbstractController /** * User exists in database * - * @OA\Response( - * response=200, - * description="contact", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\ContactBundle\Dto\Exists\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\ContactBundle\Dto\Exists\Input::class)) - * ) - * @OA\Tag(name="Contact") + #[Response( + * response: 200, + * description: 'contact', + * content: new JsonContent(ref: new Model(type: PSC\Shop\ContactBundle\Dto\Exists\Output::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\ContactBundle\Dto\Exists\Input::class) + * )] + #[Tag(name: 'Contact')] * @IsGranted("ROLE_API") * @Security(name="ApiKeyAuth") */ @@ -71,16 +75,16 @@ class Exists extends AbstractController /** * User exists in database * - * @OA\Response( - * response=200, - * description="contact", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\ContactBundle\Dto\Exists\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\ContactBundle\Dto\ExistsWithPassword\Input::class)) - * ) - * @OA\Tag(name="Contact") + #[Response( + * response: 200, + * description: 'contact', + * content: new JsonContent(ref: new Model(type: PSC\Shop\ContactBundle\Dto\Exists\Output::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\ContactBundle\Dto\ExistsWithPassword\Input::class) + * )] + #[Tag(name: 'Contact')] * @IsGranted("ROLE_API") * @Security(name="ApiKeyAuth") */ diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Login.php b/src/new/src/PSC/Shop/ContactBundle/Api/Login.php index 3f10d2ff2..4032da78c 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Login.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Login.php @@ -13,7 +13,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Refresh.php b/src/new/src/PSC/Shop/ContactBundle/Api/Refresh.php index 47c4feb07..4fbe1aafe 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Refresh.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Refresh.php @@ -7,7 +7,7 @@ use Nelmio\ApiDocBundle\Annotation\Security; use PSC\Shop\ContactBundle\Dto\Refresh\Output; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; use OpenApi\Attributes as OA; diff --git a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressDetailController.php b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressDetailController.php index 56dd47b2c..9549a8a1a 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressDetailController.php +++ b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressDetailController.php @@ -15,7 +15,7 @@ use PSC\System\SettingsBundle\Service\History; use PSC\System\SettingsBundle\Service\Log; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressImportController.php b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressImportController.php index 40d7fed0d..0cd5c59bb 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressImportController.php +++ b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressImportController.php @@ -33,7 +33,7 @@ use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/EditController.php index ec2ac9125..d31f7aa8f 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/EditController.php @@ -44,7 +44,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/ListController.php index 752223332..0ba814335 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/ListController.php @@ -21,7 +21,7 @@ use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ContactBundle/Dto/Address/GetAllForType/Output.php b/src/new/src/PSC/Shop/ContactBundle/Dto/Address/GetAllForType/Output.php index 3d3e6691c..7ba472f97 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Dto/Address/GetAllForType/Output.php +++ b/src/new/src/PSC/Shop/ContactBundle/Dto/Address/GetAllForType/Output.php @@ -3,15 +3,13 @@ namespace PSC\Shop\ContactBundle\Dto\Address\GetAllForType; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; use PSC\Shop\ContactBundle\Model\Address; class Output { - /** - * @var Address[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\ContactBundle\Model\Address::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\ContactBundle\Model\Address::class)))] public array $data = []; } diff --git a/src/new/src/PSC/Shop/ContactBundle/Dto/All/Output.php b/src/new/src/PSC/Shop/ContactBundle/Dto/All/Output.php index cba705882..9b3e0bce3 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Dto/All/Output.php +++ b/src/new/src/PSC/Shop/ContactBundle/Dto/All/Output.php @@ -3,15 +3,13 @@ namespace PSC\Shop\ContactBundle\Dto\All; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; use PSC\Shop\ContactBundle\Model\Contact; class Output { - /** - * @var Contact[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\ContactBundle\Model\Contact::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\ContactBundle\Model\Contact::class)))] public array $data = []; } diff --git a/src/new/src/PSC/Shop/ContactBundle/Dto/Exists/Input.php b/src/new/src/PSC/Shop/ContactBundle/Dto/Exists/Input.php index 7b81880c7..a1e5e9c6f 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Dto/Exists/Input.php +++ b/src/new/src/PSC/Shop/ContactBundle/Dto/Exists/Input.php @@ -3,14 +3,11 @@ namespace PSC\Shop\ContactBundle\Dto\Exists; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $username = ""; } diff --git a/src/new/src/PSC/Shop/ContactBundle/Dto/Exists/Output.php b/src/new/src/PSC/Shop/ContactBundle/Dto/Exists/Output.php index 436f22f89..6b1a0cf3f 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Dto/Exists/Output.php +++ b/src/new/src/PSC/Shop/ContactBundle/Dto/Exists/Output.php @@ -3,14 +3,11 @@ namespace PSC\Shop\ContactBundle\Dto\Exists; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Output { - /** - * @var bool - * - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public string $exists; } diff --git a/src/new/src/PSC/Shop/ContactBundle/Dto/ExistsWithPassword/Input.php b/src/new/src/PSC/Shop/ContactBundle/Dto/ExistsWithPassword/Input.php index e66468e9f..5e98d5eca 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Dto/ExistsWithPassword/Input.php +++ b/src/new/src/PSC/Shop/ContactBundle/Dto/ExistsWithPassword/Input.php @@ -3,21 +3,14 @@ namespace PSC\Shop\ContactBundle\Dto\ExistsWithPassword; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $username = ""; - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $password = ""; } diff --git a/src/new/src/PSC/Shop/ContactBundle/Dto/Login/Output.php b/src/new/src/PSC/Shop/ContactBundle/Dto/Login/Output.php index b498b4e1a..81c2a1ab4 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Dto/Login/Output.php +++ b/src/new/src/PSC/Shop/ContactBundle/Dto/Login/Output.php @@ -3,14 +3,11 @@ namespace PSC\Shop\ContactBundle\Dto\Login; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Output { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $token; } diff --git a/src/new/src/PSC/Shop/ContactBundle/Dto/Refresh/Output.php b/src/new/src/PSC/Shop/ContactBundle/Dto/Refresh/Output.php index 33a65f9c6..94792da81 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Dto/Refresh/Output.php +++ b/src/new/src/PSC/Shop/ContactBundle/Dto/Refresh/Output.php @@ -3,29 +3,18 @@ namespace PSC\Shop\ContactBundle\Dto\Refresh; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Output { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $token; - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $userName; - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $email; } diff --git a/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/CopyController.php b/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/CopyController.php index 28953d6e8..82b1a473a 100755 --- a/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/CopyController.php +++ b/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/CopyController.php @@ -22,7 +22,7 @@ use PSC\Shop\EntityBundle\Entity\ShopAccount; use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\System\SettingsBundle\Service\Shop; use Ramsey\Uuid\Uuid; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; diff --git a/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/StartController.php b/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/StartController.php index 1a491725c..9571d35a5 100755 --- a/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/StartController.php +++ b/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/StartController.php @@ -14,7 +14,7 @@ use PSC\Shop\EntityBundle\Entity\Shop; use PSC\Shop\EntityBundle\Entity\ShopAccount; use PSC\Shop\EntityBundle\Entity\ShopContact; use Ramsey\Uuid\Uuid; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; diff --git a/src/new/src/PSC/Shop/EntityBundle/Entity/LayouterSession.php b/src/new/src/PSC/Shop/EntityBundle/Entity/LayouterSession.php index a70242509..726e6dffa 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Entity/LayouterSession.php +++ b/src/new/src/PSC/Shop/EntityBundle/Entity/LayouterSession.php @@ -17,6 +17,29 @@ class LayouterSession #[ORM\Column(name: 'uuid', type: 'string', length: 255, nullable: true)] protected string $uuid; + #[ORM\Column(name: 'layouter_modus', type: 'integer')] + protected int $layouterModus = 0; + + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: true)] + protected string $title; + + #[ORM\Column(name: 'org_article_id', type: 'integer')] + protected string $productId; + + #[ORM\Column(name: 'contact_id', type: 'integer')] + protected string $contactId; + + #[ORM\Column(name: 'created', type: 'datetime', nullable: true)] + protected \DateTime $createdAt; + #[ORM\Column(name: 'updated', type: 'datetime', nullable: true)] + protected \DateTime $updatedAt; + + public function __construct() + { + $this->createdAt = new \DateTime(); + $this->updatedAt = new \DateTime(); + } + public function getUid(): int { return $this->uid; @@ -36,4 +59,64 @@ class LayouterSession { $this->uuid = $uuid; } + + public function getLayouterModus(): int + { + return $this->layouterModus; + } + + public function setLayouterModus(int $layouterModus): void + { + $this->layouterModus = $layouterModus; + } + + public function getTitle(): string + { + return $this->title; + } + + public function setTitle(string $title): void + { + $this->title = $title; + } + + public function getProductId(): string + { + return $this->productId; + } + + public function setProductId(string $productId): void + { + $this->productId = $productId; + } + + public function getContactId(): string + { + return $this->contactId; + } + + public function setContactId(string $contactId): void + { + $this->contactId = $contactId; + } + + public function getCreatedAt(): \DateTime + { + return $this->createdAt; + } + + public function setCreatedAt(\DateTime $createdAt): void + { + $this->createdAt = $createdAt; + } + + public function getUpdatedAt(): \DateTime + { + return $this->updatedAt; + } + + public function setUpdatedAt(\DateTime $updatedAt): void + { + $this->updatedAt = $updatedAt; + } } diff --git a/src/new/src/PSC/Shop/EntityBundle/Lagacy/TP_Layouter_Item.php b/src/new/src/PSC/Shop/EntityBundle/Lagacy/TP_Layouter_Item.php new file mode 100644 index 000000000..00cd46a0d --- /dev/null +++ b/src/new/src/PSC/Shop/EntityBundle/Lagacy/TP_Layouter_Item.php @@ -0,0 +1,257 @@ +template_print_id = $var; + } + + public function getTemplatePrintId() + { + return $this->template_print_id; + } + + public function setPreviewPath($xml) + { + $this->preview_path = $xml; + } + + public function getPreviewPath() + { + return $this->preview_path; + } + + public function setDesignerXML($xml) + { + $this->designer_xml = $xml; + $this->updated = date('Y-m-d H:i:s'); + } + + public function getDesignerXML() + { + return $this->designer_xml; + } + + public function setIsEdit() + { + $this->is_edit = true; + } + + public function getIsEdit() + { + return $this->is_edit; + } + + public function getArticleId() + { + return $this->_article_id; + } + + public function setArticleId($id) + { + $this->_article_id = $id; + } + + public function getOrgArticleId() + { + return $this->_org_article_id; + } + + public function setOrgArticleId($id) + { + $this->_org_article_id = $id; + } + + public function getPageObjects() + { + return $this->_page_objects; + } + + public function setPageObjects($xml) + { + $this->_page_objects = $xml; + } + + public function setTitle($xml) + { + $this->_title = $xml; + } + + public function getTitle() + { + return $this->_title; + } + + public function getPageTemplates() + { + return $this->_page_templates; + } + + public function setPageTemplates($xml) + { + $this->_page_templates = $xml; + } + + public function getConfigXml() + { + return $this->_config_xml; + } + + public function setConfigXml($xml) + { + $this->_config_xml = $xml; + } + + public function getPagesXml() + { + return $this->_pages_xml; + } + + public function setPagesXml($xml) + { + $this->_pages_xml = $xml; + } + + public function getXslFo() + { + return $this->_xslfo; + } + + public function setXslFo($xml) + { + $this->_xslfo = $xml; + } + + public function getPreviewXslFo() + { + return $this->_preview_xslfo; + } + + public function setPreviewXslFo($xml) + { + $this->_preview_xslfo = $xml; + } + + public function getExtendPreviewXslFo() + { + return $this->_extend_preview_xslfo; + } + + public function setExtendPreviewXslFo($xml) + { + $this->_extend_preview_xslfo = $xml; + } + + public function getLayouterModus() + { + return $this->layouter_modus; + } + + public function setLayouterModus($layouter_modus) + { + $this->layouter_modus = $layouter_modus; + } + + /** + * @return bool|string + */ + public function getUpdated() + { + return $this->updated; + } + + /** + * @param bool|string $updated + */ + public function setUpdated($updated) + { + $this->updated = $updated; + } + + /** + * @return int + */ + public function getTemplatePrintContactId() + { + return $this->templatePrintContactId; + } + + /** + * @param int $templatePrintContactId + */ + public function setTemplatePrintContactId($templatePrintContactId) + { + $this->templatePrintContactId = $templatePrintContactId; + } + + /** + * @return string + */ + public function getRef() + { + return $this->ref; + } + + /** + * @param string $ref + */ + public function setRef($ref) + { + $this->ref = $ref; + } + + /** + * @return string + */ + public function getKst() + { + return $this->kst; + } + + /** + * @param string $kst + */ + public function setKst($kst) + { + $this->kst = $kst; + } + } +} diff --git a/src/new/src/PSC/Shop/EntityBundle/Lagacy/TP_Layoutersession.php b/src/new/src/PSC/Shop/EntityBundle/Lagacy/TP_Layoutersession.php new file mode 100644 index 000000000..7186431ab --- /dev/null +++ b/src/new/src/PSC/Shop/EntityBundle/Lagacy/TP_Layoutersession.php @@ -0,0 +1,69 @@ +_items); + } + + /** + * Retireve count of collection loaded items + * + * @return int + */ + #[\Override] + public function count(): int + { + return count($this->_items); + } + } +} diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/LayouterSessionRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/LayouterSessionRepository.php index 76b13960d..8af0b200f 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/LayouterSessionRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/LayouterSessionRepository.php @@ -2,8 +2,14 @@ namespace PSC\Shop\EntityBundle\Repository; -use Doctrine\ORM\EntityRepository; +use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; +use Doctrine\Persistence\ManagerRegistry; +use PSC\Shop\EntityBundle\Entity\LayouterSession; -class LayouterSessionRepository extends EntityRepository +class LayouterSessionRepository extends ServiceEntityRepository { + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, LayouterSession::class); + } } diff --git a/src/new/src/PSC/Shop/MediaBundle/Api/UploadVariant.php b/src/new/src/PSC/Shop/MediaBundle/Api/UploadVariant.php index c6fb550c1..89c173bb7 100644 --- a/src/new/src/PSC/Shop/MediaBundle/Api/UploadVariant.php +++ b/src/new/src/PSC/Shop/MediaBundle/Api/UploadVariant.php @@ -5,7 +5,12 @@ namespace PSC\Shop\MediaBundle\Api; use Doctrine\ODM\MongoDB\DocumentManager; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Shop\MediaBundle\Document\Embed\Variant; use PSC\Shop\MediaBundle\Document\Media; use PSC\Shop\MediaBundle\Helper\MediaManager; @@ -54,7 +59,7 @@ class UploadVariant extends AbstractController * ) * ) * ) - * @OA\Tag(name="Media") + #[Tag(name: 'Media')] * @IsGranted("ROLE_USER") * @Security(name="ApiKeyAuth") * @Security(name="Bearer") diff --git a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/ChooserController.php b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/ChooserController.php index fd590c6f3..5951365a9 100755 --- a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/ChooserController.php +++ b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/ChooserController.php @@ -14,7 +14,7 @@ use PSC\Shop\MediaBundle\Helper\FolderManager; use PSC\Shop\MediaBundle\Helper\Media\AbstractMediaHandler; use PSC\Shop\MediaBundle\Helper\MediaManager; use PSC\System\SettingsBundle\Service\Shop; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; diff --git a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/FolderController.php b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/FolderController.php index 64048d14c..41ec36225 100755 --- a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/FolderController.php +++ b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/FolderController.php @@ -37,7 +37,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/MediaController.php b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/MediaController.php index e70a171d6..c6ed1b22a 100755 --- a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/MediaController.php +++ b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/MediaController.php @@ -30,7 +30,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/UploadController.php b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/UploadController.php index ec721100d..644b0b5cc 100755 --- a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/UploadController.php +++ b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/UploadController.php @@ -32,7 +32,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/MediaBundle/Document/Media.php b/src/new/src/PSC/Shop/MediaBundle/Document/Media.php index bd31cbb8a..0ec363406 100755 --- a/src/new/src/PSC/Shop/MediaBundle/Document/Media.php +++ b/src/new/src/PSC/Shop/MediaBundle/Document/Media.php @@ -14,10 +14,10 @@ namespace PSC\Shop\MediaBundle\Document; use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\ODM\MongoDB\Mapping\Annotations\Document; use Doctrine\ODM\MongoDB\Mapping\Annotations\EmbedMany; use Doctrine\ODM\MongoDB\Mapping\Annotations\Field; use Doctrine\ODM\MongoDB\Mapping\Annotations\Id; -use Doctrine\ODM\MongoDB\Mapping\Annotations\Document; use Doctrine\ODM\MongoDB\Mapping\Annotations\ReferenceOne; use Doctrine\ODM\MongoDB\PersistentCollection; use PSC\Shop\MediaBundle\Document\Embed\Variant; @@ -41,67 +41,67 @@ class Media implements MediaInterface #[Field(type: 'string')] protected $title; /** - * @var string - */ + * @var string + */ #[Field(type: 'string')] protected $description; /** - * @var string - */ + * @var string + */ #[Field(type: 'string')] protected $copyright; /** - * @var string - */ + * @var string + */ #[Field(type: 'string')] protected $location; /** - * @var string - */ + * @var string + */ #[Field(type: 'string')] protected $contentType; /** - * @var array - */ + * @var array + */ #[Field(type: 'hash')] - protected $metadata = array(); + protected $metadata = []; /** - * @var \DateTime - */ + * @var \DateTime + */ #[Field(type: 'date')] protected $createdAt; /** - * @var \DateTime - */ + * @var \DateTime + */ #[Field(type: 'date')] protected $updatedAt; /** - * @var Folder - */ + * @var Folder + */ #[ReferenceOne(targetDocument: 'PSC\Shop\MediaBundle\Document\Folder')] protected $folder; /** - * @var mixed - */ + * @var mixed + */ protected $content; /** - * @var int - */ + * @var int + */ #[Field(type: 'int')] protected $filesize; /** - * @var string - */ + * @var string + */ #[Field(type: 'string')] protected $url; /** - * @var string - */ + * @var string + */ #[Field(type: 'string')] protected $originalFilename; /** - * @var bool - */ + * @var bool + */ #[Field(type: 'bool')] protected $deleted; #[Field(type: 'string')] @@ -112,6 +112,9 @@ class Media implements MediaInterface protected $providerReference; #[Field(type: 'hash')] protected $providerMetadata = []; + #[Field(type: 'hash')] + protected array $additionalInfos = []; + public function __construct() { $this->setCreatedAt(new \DateTime()); @@ -151,6 +154,7 @@ class Media implements MediaInterface { $this->shop = $shop; } + /** * @return string */ @@ -158,13 +162,13 @@ class Media implements MediaInterface { $size = $this->filesize; if ($size < 1024) { - return $size . "b"; + return $size . 'b'; } else { $help = $size / 1024; if ($help < 1024) { - return round($help, 1) . "kb"; + return round($help, 1) . 'kb'; } else { - return round(($help / 1024), 1) . "mb"; + return round($help / 1024, 1) . 'mb'; } } } @@ -242,7 +246,7 @@ class Media implements MediaInterface public function getContentTypeShort() { $contentType = $this->contentType; - $array = explode("/", $contentType); + $array = explode('/', $contentType); $contentType = end($array); return $contentType; } @@ -307,7 +311,7 @@ class Media implements MediaInterface /** * {@inheritdoc} */ - public function setCreatedAt(\DateTime $createdAt = null) + public function setCreatedAt(null|\DateTime $createdAt = null) { $this->createdAt = $createdAt; } @@ -325,7 +329,7 @@ class Media implements MediaInterface /** * {@inheritdoc} */ - public function setUpdatedAt(\DateTime $updatedAt = null) + public function setUpdatedAt(null|\DateTime $updatedAt = null) { $this->updatedAt = $updatedAt; } @@ -732,7 +736,7 @@ class Media implements MediaInterface /** * @inheritDoc */ - public function setCdnFlushAt(\DateTime $cdnFlushAt = null) + public function setCdnFlushAt(null|\DateTime $cdnFlushAt = null) { // TODO: Implement setCdnFlushAt() method. } @@ -847,4 +851,14 @@ class Media implements MediaInterface { return $this->variants; } + + public function getAdditionalInfos(): array + { + return $this->additionalInfos; + } + + public function setAdditionalInfos(array $additionalInfos): void + { + $this->additionalInfos = $additionalInfos; + } } diff --git a/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/EditController.php index 13e2cd5f8..ed18bc55f 100755 --- a/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/EditController.php @@ -30,7 +30,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/ListController.php index 289fe48ab..48e6d0a93 100755 --- a/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/ListController.php @@ -21,7 +21,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Action/Create.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Action/Create.php index d1c5bbb5d..8cd0adb56 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Action/Create.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Action/Create.php @@ -6,7 +6,10 @@ use Doctrine\ORM\EntityManagerInterface; use PSC\Component\ApiBundle\Dto\Error\NotFound; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; use PSC\Shop\EntityBundle\Entity\Order; use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Input; use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output; @@ -15,7 +18,7 @@ use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Http\Attribute\IsGranted; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; class Create extends AbstractController { @@ -32,12 +35,12 @@ class Create extends AbstractController /** * create action for order * - * @OA\Response( - * response=200, - * description="order", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output::class)) - * ) - * @OA\Tag(name="Order") + #[Response( + * response: 200, + * description: 'order', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output::class)) + * )] + #[Tag(name: 'Order')] * @IsGranted("ROLE_SHOP") * @Security(name="ApiKeyAuth") * @Security(name="Bearer") diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Calc.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Calc.php index de6febd49..9b176b23d 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Calc.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Calc.php @@ -5,15 +5,19 @@ namespace PSC\Shop\OrderBundle\Api\Order; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\OrderBundle\Model\Order as ModelOrder; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -32,16 +36,16 @@ class Calc extends AbstractController /** * create order * - * @OA\Response( - * response=200, - * description="orders", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) - * ) - * @OA\Tag(name="Order") + #[Response( + * response: 200, + * description: 'orders', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Model\Order::class) + * )] + #[Tag(name: 'Order')] * @IsGranted("ROLE_SHOP") * @Security(name="ApiKeyAuth") * @Security(name="Bearer") diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/ChangeContact.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/ChangeContact.php index d37d52b59..88bdd163a 100644 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/ChangeContact.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/ChangeContact.php @@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Order; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\OrderBundle\Dto\Order\ChangeContact\Input; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Service\Order; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -33,16 +37,16 @@ class ChangeContact extends AbstractController /** * get order by uuid * - * @OA\Response( - * response=200, - * description="orders", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Dto\Order\ChangeContact\Input::class)) - * ) - * @OA\Tag(name="Order") + #[Response( + * response: 200, + * description: 'orders', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\ChangeContact\Input::class) + * )] + #[Tag(name: 'Order')] * @IsGranted("ROLE_SHOP") * @Security(name="ApiKeyAuth") * @Security(name="Bearer") diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Copy.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Copy.php index 882f882af..b1eb37ba1 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Copy.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Copy.php @@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Order; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\OrderBundle\Dto\Order\Copy\Input; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Service\Order; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -33,16 +37,16 @@ class Copy extends AbstractController /** * get order by uuid * - * @OA\Response( - * response=200, - * description="orders", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Dto\Order\Copy\Input::class)) - * ) - * @OA\Tag(name="Order") + #[Response( + * response: 200, + * description: 'orders', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Copy\Input::class) + * )] + #[Tag(name: 'Order')] * @IsGranted("ROLE_SHOP") * @Security(name="ApiKeyAuth") * @Security(name="Bearer") diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Create.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Create.php index 74d75d7c8..ce9163b91 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Create.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Create.php @@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Order; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\OrderBundle\Model\Order as ModelOrder; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Service\Order; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -33,16 +37,16 @@ class Create extends AbstractController /** * create order * - * @OA\Response( - * response=200, - * description="orders", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) - * ) - * @OA\Tag(name="Order") + #[Response( + * response: 200, + * description: 'orders', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Model\Order::class) + * )] + #[Tag(name: 'Order')] * @IsGranted("ROLE_SHOP") * @Security(name="ApiKeyAuth") * @Security(name="Bearer") diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/GetOneByUuid.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/GetOneByUuid.php index 82c22c6c6..c1b586f5c 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/GetOneByUuid.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/GetOneByUuid.php @@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Order; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\OrderBundle\Dto\Order\GetOneByUuid\Input; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Service\Order; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -33,16 +37,16 @@ class GetOneByUuid extends AbstractController /** * get order by uuid * - * @OA\Response( - * response=200, - * description="orders", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Dto\Order\GetOneByUuid\Input::class)) - * ) - * @OA\Tag(name="Order") + #[Response( + * response: 200, + * description: 'orders', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\GetOneByUuid\Input::class) + * )] + #[Tag(name: 'Order')] * @IsGranted("ROLE_SHOP") * @Security(name="ApiKeyAuth") * @Security(name="Bearer") diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Package/Nr.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Package/Nr.php index 4696b68d6..233c6a023 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Package/Nr.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Package/Nr.php @@ -5,7 +5,11 @@ namespace PSC\Shop\OrderBundle\Api\Order\Package; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Input; use PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Output; @@ -15,9 +19,9 @@ use PSC\Shop\QueueBundle\Service\Event\Manager; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -34,16 +38,16 @@ class Nr extends AbstractController /** * change packagenumber for order * - * @OA\Response( - * response=200, - * description="order", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Input::class)) - * ) - * @OA\Tag(name="Order") + #[Response( + * response: 200, + * description: 'order', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Output::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Input::class) + * )] + #[Tag(name: 'Order')] * @IsGranted("ROLE_API") * @Security(name="ApiKeyAuth") */ diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/Change.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/Change.php index 9bda96767..ace0f0b5c 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/Change.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/Change.php @@ -5,7 +5,11 @@ namespace PSC\Shop\OrderBundle\Api\Order\Status; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Input; use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output; @@ -15,9 +19,9 @@ use PSC\Shop\QueueBundle\Service\Event\Manager; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted as SymfonyIsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -37,16 +41,16 @@ class Change extends AbstractController /** * change status for order * - * @OA\Response( - * response=200, - * description="order", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Dto\Order\Status\Change\Input::class)) - * ) - * @OA\Tag(name="Order") + #[Response( + * response: 200, + * description: 'order', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Status\Change\Input::class) + * )] + #[Tag(name: 'Order')] * @Security(name="ApiKeyAuth") */ #[SymfonyIsGranted('ROLE_API')] diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/GetAllByStatus.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/GetAllByStatus.php index fe33b6d19..e413f05be 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/GetAllByStatus.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/GetAllByStatus.php @@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Order\Status; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Input; use PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Output; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Service\Order; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -33,16 +37,16 @@ class GetAllByStatus extends AbstractController /** * get orders by status * - * @OA\Response( - * response=200, - * description="orders", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Input::class)) - * ) - * @OA\Tag(name="Order") + #[Response( + * response: 200, + * description: 'orders', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Output::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Input::class) + * )] + #[Tag(name: 'Order')] * @IsGranted("ROLE_API") * @Security(name="ApiKeyAuth") */ diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Position/CheckDownload.php b/src/new/src/PSC/Shop/OrderBundle/Api/Position/CheckDownload.php index bf5ff53d1..98d1f0314 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Position/CheckDownload.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Position/CheckDownload.php @@ -7,8 +7,11 @@ use PSC\Shop\OrderBundle\Dto\Position\CheckDownload\Output; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; -use OpenApi\Annotations as OA; +use Symfony\Component\Routing\Attribute\Route; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; @@ -22,12 +25,12 @@ class CheckDownload extends AbstractController /** * get order by uuid * - * @OA\Response( - * response=200, - * description="orders", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Position\CheckDownload\Output::class)) - * ) - * @OA\Tag(name="Position") + #[Response( + * response: 200, + * description: 'orders', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Position\CheckDownload\Output::class)) + * )] + #[Tag(name: 'Position')] */ #[Route(path: '/position/checkdownload/{posUuid}', methods: ['GET'])] public function checkDownload(string $posUuid): JsonResponse diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Position/GetPluginListDisplay.php b/src/new/src/PSC/Shop/OrderBundle/Api/Position/GetPluginListDisplay.php index 8600a9a60..3d7f5ffbd 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Position/GetPluginListDisplay.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Position/GetPluginListDisplay.php @@ -7,8 +7,11 @@ use PSC\Shop\OrderBundle\Dto\Position\GetPluginListDisplay\Output; use PSC\Shop\OrderBundle\Interface\List\Position; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; -use OpenApi\Annotations as OA; +use Symfony\Component\Routing\Attribute\Route; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; use Symfony\Component\Security\Http\Attribute\IsGranted; @@ -25,12 +28,12 @@ class GetPluginListDisplay extends AbstractController /** * get order by uuid * - * @OA\Response( - * response=200, - * description="orders", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Position\GetPluginListDisplay\Output::class)) - * ) - * @OA\Tag(name="Position") + #[Response( + * response: 200, + * description: 'orders', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Position\GetPluginListDisplay\Output::class)) + * )] + #[Tag(name: 'Position')] * @IsGranted("ROLE_SHOP") * @Security(name="ApiKeyAuth") * @Security(name="Bearer") diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/Change.php b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/Change.php index 2c28490b5..c373611a4 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/Change.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/Change.php @@ -5,7 +5,11 @@ namespace PSC\Shop\OrderBundle\Api\Position\Status; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\OrderBundle\Dto\Position\Status\Change\Input; use PSC\Shop\OrderBundle\Dto\Position\Status\Change\Output; @@ -14,9 +18,9 @@ use PSC\Shop\QueueBundle\Service\Event\Manager; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -37,16 +41,16 @@ class Change extends AbstractController /** * change status for position * - * @OA\Response( - * response=200, - * description="position", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Position\Status\Change\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Dto\Position\Status\Change\Input::class)) - * ) - * @OA\Tag(name="Position") + #[Response( + * response: 200, + * description: 'position', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Position\Status\Change\Output::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Dto\Position\Status\Change\Input::class) + * )] + #[Tag(name: 'Position')] * @IsGranted("ROLE_SHOP") * @Security(name="ApiKeyAuth") * @Security(name="Bearer") diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/ChangeAll.php b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/ChangeAll.php index b372a5e02..3b5d1b27d 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/ChangeAll.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/ChangeAll.php @@ -5,7 +5,11 @@ namespace PSC\Shop\OrderBundle\Api\Position\Status; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\EntityBundle\Entity\Order; use PSC\Shop\OrderBundle\Dto\Position\Status\ChangeAll\Input; @@ -15,9 +19,9 @@ use PSC\Shop\QueueBundle\Service\Event\Manager; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -38,16 +42,16 @@ class ChangeAll extends AbstractController /** * change status for position * - * @OA\Response( - * response=200, - * description="position", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Position\Status\ChangeAll\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Dto\Position\Status\ChangeAll\Input::class)) - * ) - * @OA\Tag(name="Position") + #[Response( + * response: 200, + * description: 'position', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Position\Status\ChangeAll\Output::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Dto\Position\Status\ChangeAll\Input::class) + * )] + #[Tag(name: 'Position')] * @IsGranted("ROLE_SHOP") * @Security(name="ApiKeyAuth") * @Security(name="Bearer") diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Upload/Delete.php b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Upload/Delete.php index b25482058..2accec148 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Upload/Delete.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Upload/Delete.php @@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Position\Upload; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; +use OpenApi\Attributes\RequestBody; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\OrderBundle\Dto\Position\Upload\Delete\Input; use PSC\Shop\OrderBundle\Dto\Position\Upload\Delete\Output; use PSC\Shop\EntityBundle\Entity\Orderpos; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; @@ -31,16 +35,16 @@ class Delete extends AbstractController /** * delete uploads for position * - * @OA\Response( - * response=200, - * description="position", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Position\Upload\Delete\Output::class)) - * ) - * @OA\RequestBody( - * description="This is a request body", - * @Model(type=\PSC\Shop\OrderBundle\Dto\Position\Upload\Delete\Input::class)) - * ) - * @OA\Tag(name="Position") + #[Response( + * response: 200, + * description: 'position', + * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Position\Upload\Delete\Output::class)) + * )] + #[RequestBody( + * description: 'This is a request body', + * content: new Model(type: PSC\Shop\OrderBundle\Dto\Position\Upload\Delete\Input::class) + * )] + #[Tag(name: 'Position')] * @IsGranted("ROLE_API") * @Security(name="ApiKeyAuth") */ diff --git a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/DetailController.php b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/DetailController.php index 4486ad1c8..dd3c4732d 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/DetailController.php +++ b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/DetailController.php @@ -47,7 +47,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/ListController.php index 26c24b1d2..71fd761eb 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/ListController.php @@ -33,7 +33,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PackageController.php b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PackageController.php index ac4b4315f..ad79e82dd 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PackageController.php +++ b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PackageController.php @@ -37,7 +37,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PrintController.php b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PrintController.php index dafb1e1cc..c2aa473a4 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PrintController.php +++ b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PrintController.php @@ -37,7 +37,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/UploadController.php b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/UploadController.php index ff3f72122..b81192201 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/UploadController.php +++ b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/UploadController.php @@ -20,7 +20,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/ChangeContact/Input.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/ChangeContact/Input.php index e7ce2bdde..08ff38f52 100644 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/ChangeContact/Input.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/ChangeContact/Input.php @@ -3,20 +3,14 @@ namespace PSC\Shop\OrderBundle\Dto\Order\ChangeContact; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $uuid = ""; - /** - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $contact = ""; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Copy/Input.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Copy/Input.php index 65462e2b8..da88c6b91 100644 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Copy/Input.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Copy/Input.php @@ -3,20 +3,14 @@ namespace PSC\Shop\OrderBundle\Dto\Order\Copy; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $uuid = ""; - /** - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $typ = 0; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/GetOneByUuid/Input.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/GetOneByUuid/Input.php index 7950ee7bb..d8cd58d77 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/GetOneByUuid/Input.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/GetOneByUuid/Input.php @@ -3,14 +3,11 @@ namespace PSC\Shop\OrderBundle\Dto\Order\GetOneByUuid; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $uuid = ""; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Package/Nr/Input.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Package/Nr/Input.php index ed198f3ba..48d2ab12f 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Package/Nr/Input.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Package/Nr/Input.php @@ -3,21 +3,14 @@ namespace PSC\Shop\OrderBundle\Dto\Order\Package\Nr; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $order = ""; - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $nr = ""; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Package/Nr/Output.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Package/Nr/Output.php index a5b9e9cc4..28f609864 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Package/Nr/Output.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Package/Nr/Output.php @@ -3,14 +3,11 @@ namespace PSC\Shop\OrderBundle\Dto\Order\Package\Nr; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Output { - /** - * @var bool - * - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $success = true; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/Change/Input.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/Change/Input.php index 11d9a3147..ce0b7347e 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/Change/Input.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/Change/Input.php @@ -3,21 +3,14 @@ namespace PSC\Shop\OrderBundle\Dto\Order\Status\Change; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $order = ""; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $status = 10; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/Change/Output.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/Change/Output.php index c787ebe4d..6d9b37890 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/Change/Output.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/Change/Output.php @@ -3,14 +3,11 @@ namespace PSC\Shop\OrderBundle\Dto\Order\Status\Change; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Output { - /** - * @var bool - * - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $success = true; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/GetAllByStatus/Input.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/GetAllByStatus/Input.php index 4a93576a4..22cc618d9 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/GetAllByStatus/Input.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/GetAllByStatus/Input.php @@ -3,14 +3,11 @@ namespace PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $status = 10; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/GetAllByStatus/Output.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/GetAllByStatus/Output.php index a09186efe..79f2f053b 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/GetAllByStatus/Output.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Order/Status/GetAllByStatus/Output.php @@ -3,7 +3,9 @@ namespace PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; use PSC\Shop\OrderBundle\Model\Order; class Output @@ -14,17 +16,9 @@ class Output $this->count = count($shops); } - /** - * @var Order[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class)))] public array $data = []; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $count = 0; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/Change/Input.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/Change/Input.php index 4a53126b2..efe3905ca 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/Change/Input.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/Change/Input.php @@ -2,21 +2,14 @@ namespace PSC\Shop\OrderBundle\Dto\Position\Status\Change; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $position = ""; - /** - * @var int - * - * @OA\Property(type="int") - */ + #[Property(type: 'int')] public int $status = 10; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/Change/Output.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/Change/Output.php index a2d7c0311..7f382af63 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/Change/Output.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/Change/Output.php @@ -2,14 +2,11 @@ namespace PSC\Shop\OrderBundle\Dto\Position\Status\Change; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Output { - /** - * @var bool - * - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $success = true; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/ChangeAll/Input.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/ChangeAll/Input.php index 76dc7e5b5..b2bf303f7 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/ChangeAll/Input.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/ChangeAll/Input.php @@ -2,21 +2,14 @@ namespace PSC\Shop\OrderBundle\Dto\Position\Status\ChangeAll; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $order = ""; - /** - * @var int - * - * @OA\Property(type="int") - */ + #[Property(type: 'int')] public int $status = 10; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/ChangeAll/Output.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/ChangeAll/Output.php index 852ccc270..dfcb6d38f 100644 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/ChangeAll/Output.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Status/ChangeAll/Output.php @@ -2,14 +2,11 @@ namespace PSC\Shop\OrderBundle\Dto\Position\Status\ChangeAll; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Output { - /** - * @var bool - * - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $success = true; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Upload/Delete/Input.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Upload/Delete/Input.php index 20029b367..49d452382 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Upload/Delete/Input.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Upload/Delete/Input.php @@ -3,14 +3,11 @@ namespace PSC\Shop\OrderBundle\Dto\Position\Upload\Delete; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Input { - /** - * @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] public string $position = ""; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Upload/Delete/Output.php b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Upload/Delete/Output.php index a19b0929e..72dc54f93 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Upload/Delete/Output.php +++ b/src/new/src/PSC/Shop/OrderBundle/Dto/Position/Upload/Delete/Output.php @@ -3,14 +3,11 @@ namespace PSC\Shop\OrderBundle\Dto\Position\Upload\Delete; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Output { - /** - * @var bool - * - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] public bool $success = true; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Model/Cancelation.php b/src/new/src/PSC/Shop/OrderBundle/Model/Cancelation.php index 3de28a79c..a0f17fa02 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Model/Cancelation.php +++ b/src/new/src/PSC/Shop/OrderBundle/Model/Cancelation.php @@ -14,14 +14,11 @@ namespace PSC\Shop\OrderBundle\Model; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Cancelation extends Order { - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private $type = 3; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Model/Credit.php b/src/new/src/PSC/Shop/OrderBundle/Model/Credit.php index c5ae525c9..280cf2d3a 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Model/Credit.php +++ b/src/new/src/PSC/Shop/OrderBundle/Model/Credit.php @@ -14,14 +14,11 @@ namespace PSC\Shop\OrderBundle\Model; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Credit extends Order { - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private $type = 4; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Model/Invoice.php b/src/new/src/PSC/Shop/OrderBundle/Model/Invoice.php index 665247d77..707fa647d 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Model/Invoice.php +++ b/src/new/src/PSC/Shop/OrderBundle/Model/Invoice.php @@ -14,14 +14,11 @@ namespace PSC\Shop\OrderBundle\Model; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Invoice extends Order { - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private $type = 5; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Model/Offer.php b/src/new/src/PSC/Shop/OrderBundle/Model/Offer.php index 4b3da85ff..b232a7709 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Model/Offer.php +++ b/src/new/src/PSC/Shop/OrderBundle/Model/Offer.php @@ -14,14 +14,11 @@ namespace PSC\Shop\OrderBundle\Model; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Offer extends Base { - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private $type = 2; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Model/Order.php b/src/new/src/PSC/Shop/OrderBundle/Model/Order.php index c63750c55..c6c68dafc 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Model/Order.php +++ b/src/new/src/PSC/Shop/OrderBundle/Model/Order.php @@ -14,14 +14,11 @@ namespace PSC\Shop\OrderBundle\Model; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Order extends Base { - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private $type = 2; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/AdditionalInfo.php b/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/AdditionalInfo.php index f1c95f523..b2a3f4b67 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/AdditionalInfo.php +++ b/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/AdditionalInfo.php @@ -14,19 +14,15 @@ namespace PSC\Shop\OrderBundle\Model\Order\Position; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class AdditionalInfo { - /** @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private $key; -/** @var string - * - * @OA\Property(type="string") - */ + + #[Property(type: 'string')] private $value; public function __construct() { diff --git a/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/Upload.php b/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/Upload.php index 0bff2e893..0028716c5 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/Upload.php +++ b/src/new/src/PSC/Shop/OrderBundle/Model/Order/Position/Upload.php @@ -14,34 +14,24 @@ namespace PSC\Shop\OrderBundle\Model\Order\Position; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Upload { - /** @var string - * - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $fileName = ""; -/** @var string - * - * @OA\Property(type="string") - */ + + #[Property(type: 'string')] private string $uuid = ""; -/** @var string - * - * @OA\Property(type="string") - */ + + #[Property(type: 'string')] private string $path = ""; -/** @var string - * - * @OA\Property(type="string") - */ + + #[Property(type: 'string')] private string $chunkTitle = ""; -/** @var string - * - * @OA\Property(type="string") - */ + + #[Property(type: 'string')] private string $typ = ""; public function asArray() { diff --git a/src/new/src/PSC/Shop/OrderBundle/Model/ParcelCancellation.php b/src/new/src/PSC/Shop/OrderBundle/Model/ParcelCancellation.php index 41d4642e3..03316f402 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Model/ParcelCancellation.php +++ b/src/new/src/PSC/Shop/OrderBundle/Model/ParcelCancellation.php @@ -14,14 +14,11 @@ namespace PSC\Shop\OrderBundle\Model; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class ParcelCancellation extends Order { - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private $type = 7; } diff --git a/src/new/src/PSC/Shop/OrderBundle/Model/ParcelInvoice.php b/src/new/src/PSC/Shop/OrderBundle/Model/ParcelInvoice.php index 8d9f313ff..6e5eed436 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Model/ParcelInvoice.php +++ b/src/new/src/PSC/Shop/OrderBundle/Model/ParcelInvoice.php @@ -14,14 +14,11 @@ namespace PSC\Shop\OrderBundle\Model; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class ParcelInvoice extends Order { - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private $type = 6; } diff --git a/src/new/src/PSC/Shop/PaymentBundle/Api/One.php b/src/new/src/PSC/Shop/PaymentBundle/Api/One.php index bce2cd7ed..c29a868ec 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Api/One.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Api/One.php @@ -12,7 +12,7 @@ use PSC\Shop\EntityBundle\Entity\Payment as PSCPayment; use PSC\Shop\PaymentBundle\Model\Payment; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; class One extends AbstractController { diff --git a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/EditController.php index aa6e6d15e..331407f9e 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/EditController.php @@ -32,7 +32,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/GatewayController.php b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/GatewayController.php index d3f639202..86cbd3d43 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/GatewayController.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/GatewayController.php @@ -26,7 +26,7 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/ListController.php index 3d3d72a18..dbbe13c83 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/ListController.php @@ -21,7 +21,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/NotifyController.php b/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/NotifyController.php index 91da5ab3e..3d29a1ed6 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/NotifyController.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/NotifyController.php @@ -26,7 +26,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/PayController.php b/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/PayController.php index 7c92c728d..8a232e30c 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/PayController.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/PayController.php @@ -26,7 +26,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/PaymentBundle/Dto/All/Output.php b/src/new/src/PSC/Shop/PaymentBundle/Dto/All/Output.php index 0d8555786..049eab504 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Dto/All/Output.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Dto/All/Output.php @@ -3,7 +3,9 @@ namespace PSC\Shop\PaymentBundle\Dto\All; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; use PSC\Shop\PaymentBundle\Model\Payment; class Output @@ -14,17 +16,9 @@ class Output $this->count = count($payments); } - /** - * @var Payment[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\PaymentBundle\Model\Payment::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\PaymentBundle\Model\Payment::class)))] public array $data = []; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $count = 0; } diff --git a/src/new/src/PSC/Shop/PaymentBundle/Model/Payment.php b/src/new/src/PSC/Shop/PaymentBundle/Model/Payment.php index 0d090e506..53f239533 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Model/Payment.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Model/Payment.php @@ -2,39 +2,26 @@ namespace PSC\Shop\PaymentBundle\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; use Nelmio\ApiDocBundle\Annotation\Model; class Payment { - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $uid = 0; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $title; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $description; - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $price = 0; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private bool $percent = false; - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $taxClass = 190; - /** - * @OA\Property(ref=@Model(type=\PSC\Shop\PaymentBundle\Model\Price::class)) - */ + #[Property(ref: new Model(type: PSC\Shop\PaymentBundle\Model\Price::class))] private Price $calcPrice; public function construct() diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByProductGroup.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByProductGroup.php index b2c9ad976..7388e4dbb 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByProductGroup.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByProductGroup.php @@ -13,8 +13,11 @@ use PSC\System\SettingsBundle\Model\Papercontainer; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; -use OpenApi\Annotations as OA; +use Symfony\Component\Routing\Attribute\Route; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; use Nelmio\ApiDocBundle\Annotation\Model; use PSC\System\SettingsBundle\Model\Paper as PSCPaper; use Symfony\Component\Security\Http\Attribute\IsGranted; @@ -34,12 +37,12 @@ class GetAllByProductGroup extends AbstractController /** * get product * - * @OA\Response( - * response=200, - * description="get papercontainer", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\ProductBundle\Dto\Product\GetAllByProductGroup\Output::class)) - * ) - * @OA\Tag(name="Product") + #[Response( + * response: 200, + * description: 'get papercontainer', + * content: new JsonContent(ref: new Model(type: PSC\Shop\ProductBundle\Dto\Product\GetAllByProductGroup\Output::class)) + * )] + #[Tag(name: 'Product')] */ #[Route(path: '/product/getallbyproductgroup/{uuid}', methods: ['GET'])] public function getAll(string $uuid): JsonResponse diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByTerm.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByTerm.php index d34b5869a..383eeb88a 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByTerm.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByTerm.php @@ -5,7 +5,10 @@ namespace PSC\Shop\ProductBundle\Api\Product; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\EntityBundle\Entity\Paper; use PSC\Shop\EntityBundle\Entity\Product; @@ -18,7 +21,7 @@ use PSC\System\SettingsBundle\Service\Shop; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; class GetAllByTerm extends AbstractController { @@ -35,12 +38,12 @@ class GetAllByTerm extends AbstractController /** * get product * - * @OA\Response( - * response=200, - * description="get papercontainer", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\ProductBundle\Dto\Product\GetAllByProductGroup\Output::class)) - * ) - * @OA\Tag(name="Product") + #[Response( + * response: 200, + * description: 'get papercontainer', + * content: new JsonContent(ref: new Model(type: PSC\Shop\ProductBundle\Dto\Product\GetAllByProductGroup\Output::class)) + * )] + #[Tag(name: 'Product')] */ #[Route(path: '/product/getallbyterm/{shop_uuid}/{term}', methods: ['GET'])] public function getAll(string $term, string $shop_uuid): JsonResponse diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetFormAsJson.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetFormAsJson.php index 7806938ac..85f13823a 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetFormAsJson.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetFormAsJson.php @@ -14,8 +14,11 @@ use PSC\Shop\ProductBundle\Interfaces\IUiProducer; use PSC\System\PluginBundle\Service\ProductType; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; -use OpenApi\Annotations as OA; +use Symfony\Component\Routing\Attribute\Route; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; use Nelmio\ApiDocBundle\Annotation\Model; class GetFormAsJson extends AbstractController @@ -26,12 +29,12 @@ class GetFormAsJson extends AbstractController /** * get product * - * @OA\Response( - * response=200, - * description="get form", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\ProductBundle\Dto\Product\GetFormAsJson\Output::class)) - * ) - * @OA\Tag(name="Product") + #[Response( + * response: 200, + * description: 'get form', + * content: new JsonContent(ref: new Model(type: PSC\Shop\ProductBundle\Dto\Product\GetFormAsJson\Output::class)) + * )] + #[Tag(name: 'Product')] */ #[Route(path: '/product/get/form/json/{uuid}', methods: ['POST'])] public function getForm(string $uuid, \Symfony\Component\HttpFoundation\Request $request): JsonResponse diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/One.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/One.php index 198129b4b..47c3b9f22 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/One.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/One.php @@ -11,8 +11,11 @@ use PSC\System\SettingsBundle\Model\Papercontainer; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; -use OpenApi\Annotations as OA; +use Symfony\Component\Routing\Attribute\Route; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; use Nelmio\ApiDocBundle\Annotation\Model; use PSC\System\SettingsBundle\Model\Paper as PSCPaper; use Symfony\Component\Security\Http\Attribute\IsGranted; @@ -32,12 +35,12 @@ class One extends AbstractController /** * get product * - * @OA\Response( - * response=200, - * description="get papercontainer", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\ProductBundle\Model\Product::class)) - * ) - * @OA\Tag(name="Product") + #[Response( + * response: 200, + * description: 'get papercontainer', + * content: new JsonContent(ref: new Model(type: PSC\Shop\ProductBundle\Model\Product::class)) + * )] + #[Tag(name: 'Product')] */ #[Route(path: '/product/{uuid}', methods: ['GET'])] public function getOne(string $uuid): JsonResponse diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Add.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Add.php index ff9b58c93..f7cdd8d8d 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Add.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Add.php @@ -12,7 +12,7 @@ use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Nelmio\ApiDocBundle\Annotation\Model; use OpenApi\Attributes as OA; diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Delete.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Delete.php index 0aac3526b..09e070bd0 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Delete.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Delete.php @@ -12,7 +12,7 @@ use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Nelmio\ApiDocBundle\Annotation\Model; use OpenApi\Attributes as OA; diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Get.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Get.php index 09a966ca6..88fd26051 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Get.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Get.php @@ -8,7 +8,7 @@ use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\ProductBundle\Dto\Product\Set\Get\Output; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Nelmio\ApiDocBundle\Annotation\Model; use OpenApi\Attributes as OA; diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetTree.php b/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetTree.php index 225c3050f..5d7377b7a 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetTree.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetTree.php @@ -5,7 +5,10 @@ namespace PSC\Shop\ProductBundle\Api\ProductGroup; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; use PSC\Shop\ProductBundle\Dto\Cms\Cms\Output; use PSC\Shop\ProductBundle\Dto\Error\NotFound; use PSC\Shop\ProductBundle\Dto\Shop\Shops; @@ -15,9 +18,9 @@ use PSC\Shop\ProductBundle\Model\Shop; use PSC\Shop\ProductBundle\Model\Shop\Domain; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; @@ -39,12 +42,12 @@ class GetTree extends AbstractController /** * Get Productgroups by ShopUuid * - * @OA\Response( - * response=200, - * description="productgroup", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\ProductBundle\Dto\ProductGroup\GetWithProducts\Output::class)) - * ) - * @OA\Tag(name="ProductGroup") + #[Response( + * response: 200, + * description: 'productgroup', + * content: new JsonContent(ref: new Model(type: PSC\Shop\ProductBundle\Dto\ProductGroup\GetWithProducts\Output::class)) + * )] + #[Tag(name: 'ProductGroup')] */ #[Route(path: '/productgroup/gettree/{shopUuid}', methods: ['GET'])] public function treeAction(string $shopUuid): JsonResponse @@ -67,12 +70,12 @@ class GetTree extends AbstractController /** * Get Productgroups by Domain * - * @OA\Response( - * response=200, - * description="productgroup", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\ProductBundle\Dto\ProductGroup\GetWithProducts\Output::class)) - * ) - * @OA\Tag(name="ProductGroup") + #[Response( + * response: 200, + * description: 'productgroup', + * content: new JsonContent(ref: new Model(type: PSC\Shop\ProductBundle\Dto\ProductGroup\GetWithProducts\Output::class)) + * )] + #[Tag(name: 'ProductGroup')] */ #[Route(path: '/productgroup/gettree', methods: ['GET'])] public function domains(\PSC\System\SettingsBundle\Service\Shop $shopService): JsonResponse diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetWithProducts.php b/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetWithProducts.php index 30258b178..47fb04f0b 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetWithProducts.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetWithProducts.php @@ -5,7 +5,10 @@ namespace PSC\Shop\ProductBundle\Api\ProductGroup; use Doctrine\ORM\EntityManagerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Response; +use OpenApi\Attributes\Tag; +use OpenApi\Attributes\JsonContent; use PSC\Shop\ProductBundle\Dto\Cms\Cms\Output; use PSC\Shop\ProductBundle\Dto\Error\NotFound; use PSC\Shop\ProductBundle\Dto\Shop\Shops; @@ -15,9 +18,9 @@ use PSC\Shop\ProductBundle\Model\Shop; use PSC\Shop\ProductBundle\Model\Shop\Domain; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Response as HttpResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Security\Http\Attribute\IsGranted; @@ -37,12 +40,12 @@ class GetWithProducts extends AbstractController /** * Productgroups * - * @OA\Response( - * response=200, - * description="productgroup", - * @OA\JsonContent(ref=@Model(type=\PSC\Shop\ProductBundle\Dto\ProductGroup\GetWithProducts\Output::class)) - * ) - * @OA\Tag(name="ProductGroup") + #[Response( + * response: 200, + * description: 'productgroup', + * content: new JsonContent(ref: new Model(type: PSC\Shop\ProductBundle\Dto\ProductGroup\GetWithProducts\Output::class)) + * )] + #[Tag(name: 'ProductGroup')] */ #[Route(path: '/productgroup/getallwithproducts', methods: ['GET'])] public function allAction(): JsonResponse diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/EditController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/EditController.php index 1b9824870..0f65ceac4 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/EditController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/EditController.php @@ -31,7 +31,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Http\Attribute\IsGranted; diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/ListController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/ListController.php index 235ce47a7..682076597 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/ListController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/ListController.php @@ -30,7 +30,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/SetController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/SetController.php index 7b021bfa6..f57641fc7 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/SetController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/SetController.php @@ -21,7 +21,7 @@ use PSC\Shop\ProductBundle\Model\Set\Item; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/StockController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/StockController.php index 4f2db2f46..f8ea5fef2 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/StockController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/StockController.php @@ -25,7 +25,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/TemplateprintController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/TemplateprintController.php index 0504b0ba2..d1905949a 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/TemplateprintController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/TemplateprintController.php @@ -32,7 +32,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/EditController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/EditController.php index 86c77f510..f6d68e339 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/EditController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/EditController.php @@ -37,7 +37,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/ListController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/ListController.php index 544b490ec..c48a47a72 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/ListController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/ListController.php @@ -29,7 +29,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Frontend/Product/OfferController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Frontend/Product/OfferController.php index 7702ec609..b52627544 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Frontend/Product/OfferController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Frontend/Product/OfferController.php @@ -33,7 +33,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ProductBundle/Dto/Product/GetAllByProductGroup/Output.php b/src/new/src/PSC/Shop/ProductBundle/Dto/Product/GetAllByProductGroup/Output.php index ef48d3fe2..e04f1d346 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Dto/Product/GetAllByProductGroup/Output.php +++ b/src/new/src/PSC/Shop/ProductBundle/Dto/Product/GetAllByProductGroup/Output.php @@ -3,7 +3,9 @@ namespace PSC\Shop\ProductBundle\Dto\Product\GetAllByProductGroup; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; use PSC\Shop\ProductBundle\Model\Product; class Output @@ -14,17 +16,9 @@ class Output $this->count = count($products); } - /** - * @var Product[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\ProductBundle\Model\Product::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\ProductBundle\Model\Product::class)))] public array $data = []; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $count = 0; } diff --git a/src/new/src/PSC/Shop/ProductBundle/Dto/ProductGroup/GetWithProducts/Output.php b/src/new/src/PSC/Shop/ProductBundle/Dto/ProductGroup/GetWithProducts/Output.php index 73d864b35..544c1180f 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Dto/ProductGroup/GetWithProducts/Output.php +++ b/src/new/src/PSC/Shop/ProductBundle/Dto/ProductGroup/GetWithProducts/Output.php @@ -3,7 +3,9 @@ namespace PSC\Shop\ProductBundle\Dto\ProductGroup\GetWithProducts; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; use PSC\Shop\ProductBundle\Model\ProductGroup; class Output @@ -14,17 +16,9 @@ class Output $this->count = count($productGroups); } - /** - * @var ProductGroup[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\ProductBundle\Model\ProductGroup::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\ProductBundle\Model\ProductGroup::class)))] public array $data = []; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $count = 0; } diff --git a/src/new/src/PSC/Shop/ProductBundle/Model/Lang/Item.php b/src/new/src/PSC/Shop/ProductBundle/Model/Lang/Item.php index e2e6b10d5..e36b23c84 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Model/Lang/Item.php +++ b/src/new/src/PSC/Shop/ProductBundle/Model/Lang/Item.php @@ -14,32 +14,21 @@ namespace PSC\Shop\ProductBundle\Model\Lang; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Item { - /** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $title = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $code = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $einleitung = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $text_art = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $info = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $uuid = ""; } diff --git a/src/new/src/PSC/Shop/ProductBundle/Model/ProductGroup.php b/src/new/src/PSC/Shop/ProductBundle/Model/ProductGroup.php index 34f095f4d..488f1a59a 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Model/ProductGroup.php +++ b/src/new/src/PSC/Shop/ProductBundle/Model/ProductGroup.php @@ -14,45 +14,27 @@ namespace PSC\Shop\ProductBundle\Model; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; class ProductGroup { - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $id; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $uuid = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $title = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $image1 = ""; -/** - * @OA\Property(type="string", maxLength=255) - */ + #[Property(type: 'string', maxLength: 255)] public string $image2 = ""; -/** - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\ProductBundle\Model\Lang\Item::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\ProductBundle\Model\Lang\Item::class)))] public array $langData = []; -/** - * @var ProductGroup[] - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\ProductBundle\Model\ProductGroup::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\ProductBundle\Model\ProductGroup::class)))] public array $children = []; -/** - * @var Product[] - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\ProductBundle\Model\Product::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\ProductBundle\Model\Product::class)))] public array $products = []; public function addProduct(Product $productObj) { diff --git a/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/EditController.php index 3375d502a..2000e6115 100755 --- a/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/EditController.php @@ -30,7 +30,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/ListController.php index 263e47958..da386ebcb 100755 --- a/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/ListController.php @@ -28,7 +28,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/SettingsBundle/Api/CheckVat.php b/src/new/src/PSC/Shop/SettingsBundle/Api/CheckVat.php index abf4279f9..c35174ad8 100755 --- a/src/new/src/PSC/Shop/SettingsBundle/Api/CheckVat.php +++ b/src/new/src/PSC/Shop/SettingsBundle/Api/CheckVat.php @@ -14,7 +14,7 @@ use SoapClient; use SoapFault; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; class CheckVat extends AbstractController { diff --git a/src/new/src/PSC/Shop/SettingsBundle/Api/GetCountry.php b/src/new/src/PSC/Shop/SettingsBundle/Api/GetCountry.php index 0c9ef4db6..0abc069cd 100755 --- a/src/new/src/PSC/Shop/SettingsBundle/Api/GetCountry.php +++ b/src/new/src/PSC/Shop/SettingsBundle/Api/GetCountry.php @@ -13,7 +13,7 @@ use PSC\Shop\SettingsBundle\Model\Country; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; class GetCountry extends AbstractController { diff --git a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/CountryController.php b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/CountryController.php index b441cbefb..170900b57 100755 --- a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/CountryController.php +++ b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/CountryController.php @@ -28,7 +28,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/RoutingController.php b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/RoutingController.php index b98085d61..59e5d717a 100755 --- a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/RoutingController.php +++ b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/RoutingController.php @@ -26,7 +26,7 @@ use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/SettingsController.php b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/SettingsController.php index de20eda23..7bb63917a 100755 --- a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/SettingsController.php +++ b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/SettingsController.php @@ -32,7 +32,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/SettingsBundle/Controller/Json/ShopController.php b/src/new/src/PSC/Shop/SettingsBundle/Controller/Json/ShopController.php index e5a724c2f..548f5c3d5 100755 --- a/src/new/src/PSC/Shop/SettingsBundle/Controller/Json/ShopController.php +++ b/src/new/src/PSC/Shop/SettingsBundle/Controller/Json/ShopController.php @@ -25,7 +25,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Translation\Exception\NotFoundResourceException; use PSC\Shop\EntityBundle\Entity\Motiv; diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/EditController.php index c475334f0..ef9d09eb3 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/EditController.php @@ -33,7 +33,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/GatewayController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/GatewayController.php index a360549d7..68544b632 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/GatewayController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/GatewayController.php @@ -26,7 +26,7 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ImportController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ImportController.php index 6633f06a0..d0353f626 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ImportController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ImportController.php @@ -24,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ListController.php index 581f166a1..4760816e5 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ListController.php @@ -21,7 +21,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/CreateController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/CreateController.php index 9247a72fa..e65f29af2 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/CreateController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/CreateController.php @@ -25,7 +25,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/DownloadController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/DownloadController.php index 8a254b83a..ee9497564 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/DownloadController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/DownloadController.php @@ -28,7 +28,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ShippingBundle/Dto/All/Output.php b/src/new/src/PSC/Shop/ShippingBundle/Dto/All/Output.php index 7a925abd1..61a7e2832 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Dto/All/Output.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Dto/All/Output.php @@ -3,7 +3,9 @@ namespace PSC\Shop\ShippingBundle\Dto\All; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; class Output { @@ -13,17 +15,9 @@ class Output $this->count = count($shippings); } - /** - * @var Shipping[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\ShippingBundle\Model\Shipping::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\ShippingBundle\Model\Shipping::class)))] public array $data = []; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $count = 0; } diff --git a/src/new/src/PSC/Shop/ShippingBundle/Model/Shipping.php b/src/new/src/PSC/Shop/ShippingBundle/Model/Shipping.php index 8d6555aa2..d60f4342c 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Model/Shipping.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Model/Shipping.php @@ -2,54 +2,37 @@ namespace PSC\Shop\ShippingBundle\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; use Nelmio\ApiDocBundle\Annotation\Model; class Shipping { - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $uid = 0; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $uuid = ""; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $title = ""; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $description; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $matrix = ""; - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $price = 0; - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $pricePercent = 0; - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $taxClass = 0; - /** - * @OA\Property(ref=@Model(type=\PSC\Shop\ShippingBundle\Model\Price::class)) - */ + #[Property(ref: new Model(type: PSC\Shop\ShippingBundle\Model\Price::class))] private Price $calcPrice; public function __construct() diff --git a/src/new/src/PSC/Shop/ThemeBundle/Controller/Backend/SettingsController.php b/src/new/src/PSC/Shop/ThemeBundle/Controller/Backend/SettingsController.php index 866b4d9e3..3f36eba07 100755 --- a/src/new/src/PSC/Shop/ThemeBundle/Controller/Backend/SettingsController.php +++ b/src/new/src/PSC/Shop/ThemeBundle/Controller/Backend/SettingsController.php @@ -30,7 +30,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/EditController.php index fd92203d5..6483827a0 100755 --- a/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/EditController.php @@ -30,7 +30,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/ListController.php index bd1e420e4..30fc3b7c5 100755 --- a/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/ListController.php @@ -21,7 +21,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/System/PluginBundle/Controller/Backend/ListController.php b/src/new/src/PSC/System/PluginBundle/Controller/Backend/ListController.php index bcece1c8e..817e258b2 100755 --- a/src/new/src/PSC/System/PluginBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/System/PluginBundle/Controller/Backend/ListController.php @@ -29,7 +29,7 @@ use Symfony\Component\Finder\SplFileInfo; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/HelpController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/HelpController.php index ceb6b5802..47f6b9a5c 100644 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/HelpController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/HelpController.php @@ -10,7 +10,7 @@ use PSC\System\SettingsBundle\Form\Backend\HelpType; use Ramsey\Uuid\Uuid; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/LogController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/LogController.php index 1f1ba802b..1bf8ebafd 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/LogController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/LogController.php @@ -25,7 +25,7 @@ use Ramsey\Uuid\Uuid; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperContainerController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperContainerController.php index 4550136d9..6280632a0 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperContainerController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperContainerController.php @@ -23,7 +23,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperController.php index 5fc9a502e..ebd0d7272 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperController.php @@ -24,7 +24,7 @@ use Ramsey\Uuid\Uuid; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/SettingsController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/SettingsController.php index 166a20663..886918dd6 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/SettingsController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/SettingsController.php @@ -34,7 +34,7 @@ use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mailer\Transport; use Symfony\Component\Mime\Email; use Symfony\Component\Security\Core\SecurityContext; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/StatusController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/StatusController.php index 8dcc3abef..32fb929c8 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/StatusController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/StatusController.php @@ -22,7 +22,7 @@ use Ramsey\Uuid\Uuid; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/TaxController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/TaxController.php index 21e6f261b..bf1a1ab1f 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/TaxController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/TaxController.php @@ -34,7 +34,7 @@ use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\SessionInterface; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; /** * StatusController Backend diff --git a/src/new/src/PSC/System/SettingsBundle/Dto/Paper/All/Output.php b/src/new/src/PSC/System/SettingsBundle/Dto/Paper/All/Output.php index b1778c5d0..024bf57f5 100755 --- a/src/new/src/PSC/System/SettingsBundle/Dto/Paper/All/Output.php +++ b/src/new/src/PSC/System/SettingsBundle/Dto/Paper/All/Output.php @@ -3,7 +3,9 @@ namespace PSC\System\SettingsBundle\Dto\Paper\All; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; class Output { @@ -13,17 +15,9 @@ class Output $this->count = count($paper); } - /** - * @var Paper[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\System\SettingsBundle\Model\Paper::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\System\SettingsBundle\Model\Paper::class)))] public array $data = []; - /** - * @var int - * - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] public int $count = 0; } diff --git a/src/new/src/PSC/System/SettingsBundle/Dto/Status/All/Output.php b/src/new/src/PSC/System/SettingsBundle/Dto/Status/All/Output.php index 44dd1b735..a2a69ecbc 100755 --- a/src/new/src/PSC/System/SettingsBundle/Dto/Status/All/Output.php +++ b/src/new/src/PSC/System/SettingsBundle/Dto/Status/All/Output.php @@ -3,7 +3,9 @@ namespace PSC\System\SettingsBundle\Dto\Status\All; use Nelmio\ApiDocBundle\Annotation\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; +use OpenApi\Attributes\Items; class Output { @@ -13,18 +15,10 @@ class Output $this->order = $order; } - /** - * @var Status[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\System\SettingsBundle\Model\Status::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\System\SettingsBundle\Model\Status::class)))] public array $position = []; - /** - * @var Status[] - * - * @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\System\SettingsBundle\Model\Status::class))) - */ + #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\System\SettingsBundle\Model\Status::class)))] public array $order = []; } diff --git a/src/new/src/PSC/System/SettingsBundle/Model/Paper.php b/src/new/src/PSC/System/SettingsBundle/Model/Paper.php index b4f75446d..aac15a9d3 100755 --- a/src/new/src/PSC/System/SettingsBundle/Model/Paper.php +++ b/src/new/src/PSC/System/SettingsBundle/Model/Paper.php @@ -2,143 +2,90 @@ namespace PSC\System\SettingsBundle\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Paper { - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $id; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $artNr; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private ?string $description1 = null; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private ?string $description2 = null; - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private ?int $grammatur = null; - /** - * @OA\Property(type="number", format="double") - */ + #[Property(type: 'number', format: 'double')] private ?float $price = null; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp1 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp2 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp3 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp4 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp5 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp6 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp7 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp8 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp9 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp10 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp11 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp12 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp13 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $papiertyp14 = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $umschlagen = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $happy = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $eq = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $sense = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $sky = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $glam = false; - /** - * @OA\Property(type="boolean") - */ + #[Property(type: 'boolean')] private $post = false; diff --git a/src/new/src/PSC/System/SettingsBundle/Model/Papercontainer.php b/src/new/src/PSC/System/SettingsBundle/Model/Papercontainer.php index d55ca9cf5..25decc123 100755 --- a/src/new/src/PSC/System/SettingsBundle/Model/Papercontainer.php +++ b/src/new/src/PSC/System/SettingsBundle/Model/Papercontainer.php @@ -2,13 +2,12 @@ namespace PSC\System\SettingsBundle\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Papercontainer { - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private ?string $content = null; public function setContent(string $content) diff --git a/src/new/src/PSC/System/SettingsBundle/Model/Status.php b/src/new/src/PSC/System/SettingsBundle/Model/Status.php index 061316678..3af95d673 100755 --- a/src/new/src/PSC/System/SettingsBundle/Model/Status.php +++ b/src/new/src/PSC/System/SettingsBundle/Model/Status.php @@ -2,33 +2,24 @@ namespace PSC\System\SettingsBundle\Model; -use OpenApi\Annotations as OA; +use OpenApi\Attributes as OA; +use OpenApi\Attributes\Property; class Status { - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $uuid; - /** - * @OA\Property(type="integer") - */ + #[Property(type: 'integer')] private int $code; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $color; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $internalName; - /** - * @OA\Property(type="string") - */ + #[Property(type: 'string')] private string $externalName; public function setUuid(string $uuid): void diff --git a/src/new/src/PSC/System/UpdateBundle/Controller/MigrationController.php b/src/new/src/PSC/System/UpdateBundle/Controller/MigrationController.php index cb134001c..70cca6e42 100755 --- a/src/new/src/PSC/System/UpdateBundle/Controller/MigrationController.php +++ b/src/new/src/PSC/System/UpdateBundle/Controller/MigrationController.php @@ -26,7 +26,7 @@ use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\SplFileInfo; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Api/Save.php b/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Api/Save.php new file mode 100644 index 000000000..95027ae9c --- /dev/null +++ b/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Api/Save.php @@ -0,0 +1,35 @@ +setUuid($data->layouterUUId); + $layoutDesignData->setArticleUuid($data->productUUId); + $layoutDesignData->setDesign(['files' => $data->files]); + + $entityManager->persist($layoutDesignData); + $entityManager->flush(); + + $json = new JsonResponse(); + $json->setContent(json_encode(['success' => true])); + + return $json; + } +} diff --git a/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Controller/DesignerController.php b/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Controller/DesignerController.php index 212d739a6..82d211025 100644 --- a/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Controller/DesignerController.php +++ b/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Controller/DesignerController.php @@ -14,18 +14,18 @@ use Symfony\Component\Routing\Attribute\Route; class DesignerController extends AbstractController { #[Template('@PluginCustomPSCLaufkartenLayouter/designer/start.html.twig')] - #[Route('/start/{productId}/{layouterId}', name: 'psc_plugin_laufkartenlayouter_start')] + #[Route('/start/{productUUId}/{layouterUUId}', name: 'psc_plugin_laufkartenlayouter_start')] public function startAction( Request $request, EntityManagerInterface $entityManager, DocumentManager $documentManager, - $productId, - $layouterId = '', + $productUUId, + $layouterUUId = '', ) { /** @var Product $product */ $product = $entityManager ->getRepository('PSC\Shop\EntityBundle\Entity\Product') - ->findOneBy(['uuid' => $productId]); + ->findOneBy(['uuid' => $productUUId]); /** @var \PSC\Shop\EntityBundle\Entity\Shop $shop */ $shop = $product->getShop(); @@ -36,6 +36,6 @@ class DesignerController extends AbstractController ->getRepository('PSC\Shop\EntityBundle\Document\Product') ->findOneBy(['uid' => (string) $product->getUid()]); - return []; + return ['product' => $product, 'layouterUUId' => $layouterUUId]; } } diff --git a/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Dto/Input.php b/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Dto/Input.php new file mode 100644 index 000000000..fcf62f072 --- /dev/null +++ b/src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Dto/Input.php @@ -0,0 +1,18 @@ +OCR Bereich Nummer (OCR) In Rot - Aktion + OCR + Löschen @@ -450,6 +451,13 @@ ${pdf.processed ? '✓' : ''} + + + `; }); } @@ -468,6 +476,59 @@ console.log(`PDF ${index}: In Rot = ${checked}`); } + // Remove PDF from Step 2 + function removePDF(index) { + if (confirm(`Möchten Sie "${pdfData[index].fileName}" wirklich entfernen?`)) { + // Remove from pdfData + pdfData.splice(index, 1); + // Remove from uploadedFiles + uploadedFiles.splice(index, 1); + // Remove from thumbnails and ocrPreviews + delete thumbnails[index]; + delete ocrPreviews[index]; + + // Reindex remaining items + const newThumbnails = {}; + const newOcrPreviews = {}; + Object.keys(thumbnails).forEach(key => { + const keyInt = parseInt(key); + if (keyInt > index) { + newThumbnails[keyInt - 1] = thumbnails[key]; + } else { + newThumbnails[key] = thumbnails[key]; + } + }); + Object.keys(ocrPreviews).forEach(key => { + const keyInt = parseInt(key); + if (keyInt > index) { + newOcrPreviews[keyInt - 1] = ocrPreviews[key]; + } else { + newOcrPreviews[key] = ocrPreviews[key]; + } + }); + thumbnails = newThumbnails; + ocrPreviews = newOcrPreviews; + + // Update indices in pdfData + pdfData.forEach((pdf, i) => { + pdf.index = i; + }); + + // Update current file index if necessary + if (currentFileIndex >= pdfData.length) { + currentFileIndex = Math.max(0, pdfData.length - 1); + } + + // Refresh table + updatePDFTable(); + + // If no files left, go back to step 1 + if (pdfData.length === 0) { + goToStep(1); + } + } + } + // Upload zone handling const uploadZone = document.getElementById('uploadZone'); const pdfInput = document.getElementById('pdfInput'); @@ -494,13 +555,25 @@ }); function handleFiles(files) { - uploadedFiles = Array.from(files).filter(file => file.type === 'application/pdf'); + // Append new files instead of replacing + const newFiles = Array.from(files).filter(file => file.type === 'application/pdf'); + uploadedFiles = [...uploadedFiles, ...newFiles]; + displayUploadedFiles(); + document.getElementById('nextToStep2').disabled = uploadedFiles.length === 0; + } + + function removeFile(index) { + uploadedFiles.splice(index, 1); displayUploadedFiles(); document.getElementById('nextToStep2').disabled = uploadedFiles.length === 0; } function displayUploadedFiles() { const list = document.getElementById('uploadedFilesList'); + if (uploadedFiles.length === 0) { + list.innerHTML = ''; + return; + } list.innerHTML = '
Hochgeladene Dateien:
'; const ul = document.createElement('ul'); ul.className = 'space-y-2'; @@ -509,7 +582,12 @@ li.className = 'flex justify-between items-center p-3 bg-white rounded-lg shadow'; li.innerHTML = ` ${file.name} - ${(file.size / 1024).toFixed(2)} KB +
+ ${(file.size / 1024).toFixed(2)} KB + +
`; ul.appendChild(li); }); @@ -609,16 +687,38 @@ // Create a temporary canvas for the OCR area const tempCanvas = document.createElement('canvas'); - tempCanvas.width = 150; - tempCanvas.height = 50; + const sourceWidth = 150; + const sourceHeight = 50; + const scale = 4; // Scale up for better OCR + tempCanvas.width = sourceWidth * scale; + tempCanvas.height = sourceHeight * scale; const tempCtx = tempCanvas.getContext('2d'); - // Fill with white background first (for debugging) + // Fill with white background first tempCtx.fillStyle = 'white'; - tempCtx.fillRect(0, 0, 150, 50); + tempCtx.fillRect(0, 0, tempCanvas.width, tempCanvas.height); - // Copy only the specified area from the main canvas - tempCtx.drawImage(canvas, 20, 200, 150, 50, 0, 0, 150, 50); + // Copy and scale up the specified area from the main canvas + tempCtx.drawImage(canvas, 20, 50, sourceWidth, sourceHeight, 0, 0, tempCanvas.width, tempCanvas.height); + + // Image preprocessing for better OCR + const imageData = tempCtx.getImageData(0, 0, tempCanvas.width, tempCanvas.height); + const data = imageData.data; + + // Increase contrast and convert to grayscale + for (let i = 0; i < data.length; i += 4) { + // Convert to grayscale + const gray = data[i] * 0.299 + data[i + 1] * 0.587 + data[i + 2] * 0.114; + + // Increase contrast (threshold binarization) + const threshold = 128; + const binary = gray > threshold ? 255 : 0; + + data[i] = binary; // R + data[i + 1] = binary; // G + data[i + 2] = binary; // B + } + tempCtx.putImageData(imageData, 0, 0); // Display in debug canvas const debugCanvas = document.getElementById('debugCanvas'); @@ -628,20 +728,27 @@ debugCtx.drawImage(tempCanvas, 0, 0); document.getElementById('debugCanvasSize').textContent = `${tempCanvas.width}x${tempCanvas.height}px`; - // Save OCR preview for table - ocrPreviews[fileIndex] = tempCanvas.toDataURL(); + // Save OCR preview for table (downscaled version) + const previewCanvas = document.createElement('canvas'); + previewCanvas.width = sourceWidth; + previewCanvas.height = sourceHeight; + const previewCtx = previewCanvas.getContext('2d'); + previewCtx.drawImage(tempCanvas, 0, 0, sourceWidth, sourceHeight); + ocrPreviews[fileIndex] = previewCanvas.toDataURL(); console.log('Temp canvas data length:', tempCanvas.toDataURL().length); const result = await Tesseract.recognize( tempCanvas, - 'deu', + 'eng', { logger: m => { if (m.status === 'recognizing text') { console.log(`Fortschritt: ${(m.progress * 100).toFixed(0)}%`); } - } + }, + tessedit_char_whitelist: '0123456789', + tessedit_pageseg_mode: Tesseract.PSM.SINGLE_LINE } ); @@ -692,7 +799,26 @@ document.getElementById('backToStep2').addEventListener('click', () => goToStep(2)); document.getElementById('autoProcessAll').addEventListener('click', () => autoProcessAll()); - document.getElementById('finishBtn').addEventListener('click', () => { + async function uploadSinglePDF(pdf, index) { + const formData = new FormData(); + formData.append('file', pdf.file); + formData.append('fileName', pdf.fileName); + formData.append('folder', '693fd9be532acac26f0b6bf8'); + + const response = await fetch('/apps/api/basket/layouter/upload', { + method: 'POST', + body: formData + }); + + if (!response.ok) { + throw new Error(`Upload failed for ${pdf.fileName}: ${response.status}`); + } + + const result = await response.json(); + return result; + } + + document.getElementById('finishBtn').addEventListener('click', async () => { // Collect all OCR numbers and checkbox states from input fields pdfData.forEach((pdf, index) => { const input = document.getElementById(`ocr-input-${index}`); @@ -705,10 +831,92 @@ } }); - // Here you can send data to the backend console.log('Final data:', pdfData); - alert('Verarbeitung abgeschlossen!'); - // window.location.reload(); + + // Disable button and show loading state + const finishBtn = document.getElementById('finishBtn'); + const originalText = finishBtn.textContent; + finishBtn.disabled = true; + + try { + // Step 1: Upload all PDFs and collect UUIDs + finishBtn.textContent = `Uploading PDFs... (0/${pdfData.length})`; + const uploadedUUIDs = []; + + for (let i = 0; i < pdfData.length; i++) { + finishBtn.textContent = `Uploading PDFs... (${i + 1}/${pdfData.length})`; + const uploadResult = await uploadSinglePDF(pdfData[i], i); + + // Store UUID in pdfData + pdfData[i].uploadedUuid = uploadResult.uuid; + uploadedUUIDs.push({ + uuid: uploadResult.uuid, + fileName: pdfData[i].fileName, + ocrNumber: pdfData[i].ocrNumber, + inRed: pdfData[i].inRed, + numPages: pdfData[i].numPages, + isDuplex: pdfData[i].isDuplex + }); + + console.log(`Uploaded ${pdfData[i].fileName}: ${uploadResult.uuid}`); + } + + // Step 2: Call layouter/save with all UUIDs + finishBtn.textContent = 'Saving layouter session...'; + const saveResponse = await fetch('/apps/api/basket/layouter/save', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + productUUId: '{{product.uuid}}', + layouterModus: 106, + uploadedFiles: uploadedUUIDs + }) + }); + + if (!saveResponse.ok) { + throw new Error(`Layouter save failed! status: ${saveResponse.status}`); + } + + const saveResult = await saveResponse.json(); + console.log('Layouter Save Response:', saveResult); + + if (!saveResult.layouterUUId) { + throw new Error('No layouterUUId returned from layouter/save'); + } + + // Step 3: Call plugin save API with layouter UUID and file UUIDs + finishBtn.textContent = 'Finalizing...'; + const pluginSaveResponse = await fetch('/apps/api/plugin/custom/psc/laufkartenlayouter/save', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + layouterUUId: saveResult.layouterUUId, + productUUId: '{{product.uuid}}', + files: uploadedUUIDs + }) + }); + + if (!pluginSaveResponse.ok) { + throw new Error(`Plugin save failed! status: ${pluginSaveResponse.status}`); + } + + const pluginSaveResult = await pluginSaveResponse.json(); + console.log('Plugin Save Response:', pluginSaveResult); + + window.parent.document.location.href = "/article/show/uuid/{{ product.uuid }}/" + saveResult.layouterUUId + "?uploadModule=laufkartenlayouter"; + // window.location.reload(); + } catch (error) { + console.error('Error during process:', error); + alert('Fehler beim Verarbeiten: ' + error.message); + + // Re-enable button on error + finishBtn.disabled = false; + finishBtn.textContent = originalText; + } }); function generateFinalSummary() { diff --git a/src/new/web/app.php b/src/new/web/app.php index 2f6198038..b472afeeb 100755 --- a/src/new/web/app.php +++ b/src/new/web/app.php @@ -8,6 +8,7 @@ use Symfony\Component\ErrorHandler\Debug; use Symfony\Component\HttpFoundation\Request; require_once __DIR__ . '/../src/PSC/Shop/EntityBundle/Lagacy/TP_Basket_Item.php'; +require_once __DIR__ . '/../src/PSC/Shop/EntityBundle/Lagacy/TP_Layouter_Item.php'; require_once __DIR__ . '/../src/PSC/Shop/EntityBundle/Lagacy/TP_Basket_Collection.php'; require dirname(__DIR__) . '/vendor/autoload.php'; diff --git a/src/old/application/design/vorlagen/bootstrap4_api/templates/article/_articlelistitem.phtml b/src/old/application/design/vorlagen/bootstrap4_api/templates/article/_articlelistitem.phtml index d925cd8ff..b5f5d6c9e 100755 --- a/src/old/application/design/vorlagen/bootstrap4_api/templates/article/_articlelistitem.phtml +++ b/src/old/application/design/vorlagen/bootstrap4_api/templates/article/_articlelistitem.phtml @@ -1,6 +1,7 @@ @@ -8,42 +9,96 @@
- article->typ == 6 && $this->article->a6_org_article != 0) || $this->article->typ == 8 ) && $this->article->upload_steplayouter_data != ""): - echo $this->image()->thumbnailSteplayouter2Article($this->article->title, '', $this->article, false); + article->typ == 6 && $this->article->a6_org_article != 0 || $this->article->typ == 8) && + $this->article->upload_steplayouter_data != '' + ): + echo + $this->image()->thumbnailSteplayouter2Article($this->article->title, '', $this->article, false) + ; else: echo $this->image()->thumbnailImage($this->article->title, '', $this->article->file); endif; ?>
-

Text()->truncate_text($this->escape($this->article->getTitle()),40) ?>

+

Text()->truncate_text($this->escape($this->article->getTitle()), 40) + ?>

- designsettings()->get('display_no_price')) { ?>designsettings()->get('b2bshop') && - ($this->article->a4_abpreis_calc != 0 || - $this->article->OrgArticle->a4_abpreis_calc || - ($this->article->a6_org_article != 0 && $this->article->sum*1+($this->article->sum/100*$this->article->mwert) != 0) || - (($this->article->a4_abpreis + $this->article->a6_resale_price)*1+(($this->article->a4_abpreis + $this->article->a6_resale_price)/100*$this->article->mwert) != 0))): ?> + designsettings()->get('display_no_price')) { ?>designsettings()->get('b2bshop') && + ( + $this->article->a4_abpreis_calc != 0 || + $this->article->OrgArticle->a4_abpreis_calc || + $this->article->a6_org_article != 0 && + ( + ($this->article->sum * 1) + + (($this->article->sum / 100) * ((float) $this->article->mwert)) + ) != + 0 || + ( + ( + ( + ((float) $this->article->a4_abpreis) + + ((float) $this->article->a6_resale_price) + ) * + 1 + ) + + ( + ( + ( + ((float) $this->article->a4_abpreis) + + $this->article->a6_resale_price + ) / + 100 + ) * + ((float) $this->article->mwert) + ) + ) != + 0 + ) + ): ?>

translate('ab') ?> - article->typ != 2 && $this->article->a4_abpreis_calc || $this->article->OrgArticle->a4_abpreis_calc):?> + article->typ != 2 && $this->article->a4_abpreis_calc || + $this->article->OrgArticle->a4_abpreis_calc + ): ?> currency->toCurrency($this->article->a4_abpreis) ?> - article->typ == 2): ?> - currency->toCurrency($this->article->preis*1+($this->article->preis/100*$this->article->mwert)) ?> - article->a6_org_article != 0):?> - currency->toCurrency($this->article->sum*1+($this->article->sum/100*$this->article->mwert)) ?> - - currency->toCurrency(($this->article->a4_abpreis + $this->article->a6_resale_price)*1+(($this->article->a4_abpreis + $this->article->a6_resale_price)/100*$this->article->mwert)) ?> - + article->typ == 2): ?> + currency->toCurrency( + ($this->article->preis * 1) + (($this->article->preis / 100) * $this->article->mwert), + ) + ?> + article->a6_org_article != 0): ?> + currency->toCurrency(($this->article->sum * 1) + (($this->article->sum / 100) * $this->article->mwert)) + ?> + + currency->toCurrency( + (($this->article->a4_abpreis + $this->article->a6_resale_price) * 1) + + ( + (($this->article->a4_abpreis + $this->article->a6_resale_price) / 100) * + ((float) $this->article->mwert) + ), + ) + ?> +

- translate('Bestellen')?> + translate('Bestellen') ?>

- - diff --git a/src/old/application/modules/default/controllers/ArticleController.php b/src/old/application/modules/default/controllers/ArticleController.php index 92e899cdd..d36defe7f 100755 --- a/src/old/application/modules/default/controllers/ArticleController.php +++ b/src/old/application/modules/default/controllers/ArticleController.php @@ -2788,7 +2788,6 @@ class ArticleController extends TP_Controller_Action } $this->view->layouterPreviewId = $this->getRequest()->getParam('layouter'); - $this->view->inworkCount = 0; $this->view->inworkCount = count($articleSession->getAllLayouterArticle()); @@ -3493,7 +3492,7 @@ class ArticleController extends TP_Controller_Action $basket->setTempProductClass($article); $art = $article->getArticle(); $this->_redirect($this->view->url( - array('article' => $art['url'], 'layouter' => $article->getLayouterId()), + array('article' => $art['url'], 'articlegroup' => 'all', 'layouter' => $article->getLayouterId()), 'article', ) . '?load=1'); } diff --git a/src/old/library/SphinxClient.php b/src/old/library/SphinxClient.php deleted file mode 100755 index de5fbabc6..000000000 --- a/src/old/library/SphinxClient.php +++ /dev/null @@ -1,1644 +0,0 @@ -=8 ) - { - $v = (int)$v; - return pack ( "NN", $v>>32, $v&0xFFFFFFFF ); - } - - // x32, int - if ( is_int($v) ) - return pack ( "NN", $v < 0 ? -1 : 0, $v ); - - // x32, bcmath - if ( function_exists("bcmul") ) - { - if ( bccomp ( $v, 0 ) == -1 ) - $v = bcadd ( "18446744073709551616", $v ); - $h = bcdiv ( $v, "4294967296", 0 ); - $l = bcmod ( $v, "4294967296" ); - return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit - } - - // x32, no-bcmath - $p = max(0, strlen($v) - 13); - $lo = abs((float)substr($v, $p)); - $hi = abs((float)substr($v, 0, $p)); - - $m = $lo + $hi*1316134912.0; // (10 ^ 13) % (1 << 32) = 1316134912 - $q = floor($m/4294967296.0); - $l = $m - ($q*4294967296.0); - $h = $hi*2328.0 + $q; // (10 ^ 13) / (1 << 32) = 2328 - - if ( $v<0 ) - { - if ( $l==0 ) - $h = 4294967296.0 - $h; - else - { - $h = 4294967295.0 - $h; - $l = 4294967296.0 - $l; - } - } - return pack ( "NN", $h, $l ); -} - -/// pack 64-bit unsigned -function sphPackU64 ( $v ) -{ - assert ( is_numeric($v) ); - - // x64 - if ( PHP_INT_SIZE>=8 ) - { - assert ( $v>=0 ); - - // x64, int - if ( is_int($v) ) - return pack ( "NN", $v>>32, $v&0xFFFFFFFF ); - - // x64, bcmath - if ( function_exists("bcmul") ) - { - $h = bcdiv ( $v, 4294967296, 0 ); - $l = bcmod ( $v, 4294967296 ); - return pack ( "NN", $h, $l ); - } - - // x64, no-bcmath - $p = max ( 0, strlen($v) - 13 ); - $lo = (int)substr ( $v, $p ); - $hi = (int)substr ( $v, 0, $p ); - - $m = $lo + $hi*1316134912; - $l = $m % 4294967296; - $h = $hi*2328 + (int)($m/4294967296); - - return pack ( "NN", $h, $l ); - } - - // x32, int - if ( is_int($v) ) - return pack ( "NN", 0, $v ); - - // x32, bcmath - if ( function_exists("bcmul") ) - { - $h = bcdiv ( $v, "4294967296", 0 ); - $l = bcmod ( $v, "4294967296" ); - return pack ( "NN", (float)$h, (float)$l ); // conversion to float is intentional; int would lose 31st bit - } - - // x32, no-bcmath - $p = max(0, strlen($v) - 13); - $lo = (float)substr($v, $p); - $hi = (float)substr($v, 0, $p); - - $m = $lo + $hi*1316134912.0; - $q = floor($m / 4294967296.0); - $l = $m - ($q * 4294967296.0); - $h = $hi*2328.0 + $q; - - return pack ( "NN", $h, $l ); -} - -// unpack 64-bit unsigned -function sphUnpackU64 ( $v ) -{ - list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) ); - - if ( PHP_INT_SIZE>=8 ) - { - if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again - if ( $lo<0 ) $lo += (1<<32); - - // x64, int - if ( $hi<=2147483647 ) - return ($hi<<32) + $lo; - - // x64, bcmath - if ( function_exists("bcmul") ) - return bcadd ( $lo, bcmul ( $hi, "4294967296" ) ); - - // x64, no-bcmath - $C = 100000; - $h = ((int)($hi / $C) << 32) + (int)($lo / $C); - $l = (($hi % $C) << 32) + ($lo % $C); - if ( $l>$C ) - { - $h += (int)($l / $C); - $l = $l % $C; - } - - if ( $h==0 ) - return $l; - return sprintf ( "%d%05d", $h, $l ); - } - - // x32, int - if ( $hi==0 ) - { - if ( $lo>0 ) - return $lo; - return sprintf ( "%u", $lo ); - } - - $hi = sprintf ( "%u", $hi ); - $lo = sprintf ( "%u", $lo ); - - // x32, bcmath - if ( function_exists("bcmul") ) - return bcadd ( $lo, bcmul ( $hi, "4294967296" ) ); - - // x32, no-bcmath - $hi = (float)$hi; - $lo = (float)$lo; - - $q = floor($hi/10000000.0); - $r = $hi - $q*10000000.0; - $m = $lo + $r*4967296.0; - $mq = floor($m/10000000.0); - $l = $m - $mq*10000000.0; - $h = $q*4294967296.0 + $r*429.0 + $mq; - - $h = sprintf ( "%.0f", $h ); - $l = sprintf ( "%07.0f", $l ); - if ( $h=="0" ) - return sprintf( "%.0f", (float)$l ); - return $h . $l; -} - -// unpack 64-bit signed -function sphUnpackI64 ( $v ) -{ - list ( $hi, $lo ) = array_values ( unpack ( "N*N*", $v ) ); - - // x64 - if ( PHP_INT_SIZE>=8 ) - { - if ( $hi<0 ) $hi += (1<<32); // because php 5.2.2 to 5.2.5 is totally fucked up again - if ( $lo<0 ) $lo += (1<<32); - - return ($hi<<32) + $lo; - } - - // x32, int - if ( $hi==0 ) - { - if ( $lo>0 ) - return $lo; - return sprintf ( "%u", $lo ); - } - // x32, int - elseif ( $hi==-1 ) - { - if ( $lo<0 ) - return $lo; - return sprintf ( "%.0f", $lo - 4294967296.0 ); - } - - $neg = ""; - $c = 0; - if ( $hi<0 ) - { - $hi = ~$hi; - $lo = ~$lo; - $c = 1; - $neg = "-"; - } - - $hi = sprintf ( "%u", $hi ); - $lo = sprintf ( "%u", $lo ); - - // x32, bcmath - if ( function_exists("bcmul") ) - return $neg . bcadd ( bcadd ( $lo, bcmul ( $hi, "4294967296" ) ), $c ); - - // x32, no-bcmath - $hi = (float)$hi; - $lo = (float)$lo; - - $q = floor($hi/10000000.0); - $r = $hi - $q*10000000.0; - $m = $lo + $r*4967296.0; - $mq = floor($m/10000000.0); - $l = $m - $mq*10000000.0 + $c; - $h = $q*4294967296.0 + $r*429.0 + $mq; - - $h = sprintf ( "%.0f", $h ); - $l = sprintf ( "%07.0f", $l ); - if ( $h=="0" ) - return $neg . sprintf( "%.0f", (float)$l ); - return $neg . $h . $l; -} - - -/// sphinx searchd client class -class SphinxClient -{ - var $_host; ///< searchd host (default is "localhost") - var $_port; ///< searchd port (default is 3312) - var $_offset; ///< how many records to seek from result-set start (default is 0) - var $_limit; ///< how many records to return from result-set starting at offset (default is 20) - var $_mode; ///< query matching mode (default is SPH_MATCH_ALL) - var $_weights; ///< per-field weights (default is 1 for all fields) - var $_sort; ///< match sorting mode (default is SPH_SORT_RELEVANCE) - var $_sortby; ///< attribute to sort by (defualt is "") - var $_min_id; ///< min ID to match (default is 0, which means no limit) - var $_max_id; ///< max ID to match (default is 0, which means no limit) - var $_filters; ///< search filters - var $_groupby; ///< group-by attribute name - var $_groupfunc; ///< group-by function (to pre-process group-by attribute value with) - var $_groupsort; ///< group-by sorting clause (to sort groups in result set with) - var $_groupdistinct;///< group-by count-distinct attribute - var $_maxmatches; ///< max matches to retrieve - var $_cutoff; ///< cutoff to stop searching at (default is 0) - var $_retrycount; ///< distributed retries count - var $_retrydelay; ///< distributed retries delay - var $_anchor; ///< geographical anchor point - var $_indexweights; ///< per-index weights - var $_ranker; ///< ranking mode (default is SPH_RANK_PROXIMITY_BM25) - var $_maxquerytime; ///< max query time, milliseconds (default is 0, do not limit) - var $_fieldweights; ///< per-field-name weights - var $_overrides; ///< per-query attribute values overrides - var $_select; ///< select-list (attributes or expressions, with optional aliases) - - var $_error; ///< last error message - var $_warning; ///< last warning message - var $_connerror; ///< connection error vs remote error flag - - var $_reqs; ///< requests array for multi-query - var $_mbenc; ///< stored mbstring encoding - var $_arrayresult; ///< whether $result["matches"] should be a hash or an array - var $_timeout; ///< connect timeout - - ///////////////////////////////////////////////////////////////////////////// - // common stuff - ///////////////////////////////////////////////////////////////////////////// - - /// create a new client object and fill defaults - function SphinxClient () - { - // per-client-object settings - $this->_host = "localhost"; - $this->_port = 3312; - $this->_path = false; - $this->_socket = false; - - // per-query settings - $this->_offset = 0; - $this->_limit = 100; - $this->_mode = SPH_MATCH_ALL; - $this->_weights = array (); - $this->_sort = SPH_SORT_RELEVANCE; - $this->_sortby = ""; - $this->_min_id = 0; - $this->_max_id = 0; - $this->_filters = array (); - $this->_groupby = ""; - $this->_groupfunc = SPH_GROUPBY_DAY; - $this->_groupsort = "@group desc"; - $this->_groupdistinct= ""; - $this->_maxmatches = 1000; - $this->_cutoff = 0; - $this->_retrycount = 0; - $this->_retrydelay = 0; - $this->_anchor = array (); - $this->_indexweights= array (); - $this->_ranker = SPH_RANK_PROXIMITY_BM25; - $this->_maxquerytime= 0; - $this->_fieldweights= array(); - $this->_overrides = array(); - $this->_select = "*"; - - $this->_error = ""; // per-reply fields (for single-query case) - $this->_warning = ""; - $this->_connerror = false; - - $this->_reqs = array (); // requests storage (for multi-query case) - $this->_mbenc = ""; - $this->_arrayresult = false; - $this->_timeout = 0; - } - - function __destruct() - { - if ( $this->_socket !== false ) - fclose ( $this->_socket ); - } - - /// get last error message (string) - function GetLastError () - { - return $this->_error; - } - - /// get last warning message (string) - function GetLastWarning () - { - return $this->_warning; - } - - /// get last error flag (to tell network connection errors from searchd errors or broken responses) - function IsConnectError() - { - return $this->_connerror; - } - - /// set searchd host name (string) and port (integer) - function SetServer ( $host, $port = 0 ) - { - assert ( is_string($host) ); - if ( $host[0] == '/') - { - $this->_path = 'unix://' . $host; - return; - } - if ( substr ( $host, 0, 7 )=="unix://" ) - { - $this->_path = $host; - return; - } - - assert ( is_int($port) ); - $this->_host = $host; - $this->_port = $port; - $this->_path = ''; - - } - - /// set server connection timeout (0 to remove) - function SetConnectTimeout ( $timeout ) - { - assert ( is_numeric($timeout) ); - $this->_timeout = $timeout; - } - - - function _Send ( $handle, $data, $length ) - { - if ( feof($handle) || fwrite ( $handle, $data, $length ) !== $length ) - { - $this->_error = 'connection unexpectedly closed (timed out?)'; - $this->_connerror = true; - return false; - } - return true; - } - - ///////////////////////////////////////////////////////////////////////////// - - /// enter mbstring workaround mode - function _MBPush () - { - $this->_mbenc = ""; - if ( ini_get ( "mbstring.func_overload" ) & 2 ) - { - $this->_mbenc = mb_internal_encoding(); - mb_internal_encoding ( "latin1" ); - } - } - - /// leave mbstring workaround mode - function _MBPop () - { - if ( $this->_mbenc ) - mb_internal_encoding ( $this->_mbenc ); - } - - /// connect to searchd server - function _Connect () - { - if ( $this->_socket !== false ) - return $this->_socket; - - $errno = 0; - $errstr = ""; - $this->_connerror = false; - - if ( $this->_path ) - { - $host = $this->_path; - $port = 0; - } - else - { - $host = $this->_host; - $port = $this->_port; - } - - if ( $this->_timeout<=0 ) - $fp = @fsockopen ( $host, $port, $errno, $errstr ); - else - $fp = @fsockopen ( $host, $port, $errno, $errstr, $this->_timeout ); - - if ( !$fp ) - { - if ( $this->_path ) - $location = $this->_path; - else - $location = "{$this->_host}:{$this->_port}"; - - $errstr = trim ( $errstr ); - $this->_error = "connection to $location failed (errno=$errno, msg=$errstr)"; - $this->_connerror = true; - return false; - } - - // send my version - // this is a subtle part. we must do it before (!) reading back from searchd. - // because otherwise under some conditions (reported on FreeBSD for instance) - // TCP stack could throttle write-write-read pattern because of Nagle. - if ( !$this->_Send ( $fp, pack ( "N", 1 ), 4 ) ) - { - fclose ( $fp ); - $this->_error = "failed to send client protocol version"; - return false; - } - - // check version - list(,$v) = unpack ( "N*", fread ( $fp, 4 ) ); - $v = (int)$v; - if ( $v<1 ) - { - fclose ( $fp ); - $this->_error = "expected searchd protocol version 1+, got version '$v'"; - return false; - } - - return $fp; - } - - /// get and check response packet from searchd server - function _GetResponse ( $fp, $client_ver ) - { - $response = ""; - $len = 0; - - $header = fread ( $fp, 8 ); - if ( strlen($header)==8 ) - { - list ( $status, $ver, $len ) = array_values ( unpack ( "n2a/Nb", $header ) ); - $left = $len; - while ( $left>0 && !feof($fp) ) - { - $chunk = fread ( $fp, $left ); - if ( $chunk ) - { - $response .= $chunk; - $left -= strlen($chunk); - } - } - } - if ( $this->_socket === false ) - fclose ( $fp ); - - // check response - $read = strlen ( $response ); - if ( !$response || $read!=$len ) - { - $this->_error = $len - ? "failed to read searchd response (status=$status, ver=$ver, len=$len, read=$read)" - : "received zero-sized searchd response"; - return false; - } - - // check status - if ( $status==SEARCHD_WARNING ) - { - list(,$wlen) = unpack ( "N*", substr ( $response, 0, 4 ) ); - $this->_warning = substr ( $response, 4, $wlen ); - return substr ( $response, 4+$wlen ); - } - if ( $status==SEARCHD_ERROR ) - { - $this->_error = "searchd error: " . substr ( $response, 4 ); - return false; - } - if ( $status==SEARCHD_RETRY ) - { - $this->_error = "temporary searchd error: " . substr ( $response, 4 ); - return false; - } - if ( $status!=SEARCHD_OK ) - { - $this->_error = "unknown status code '$status'"; - return false; - } - - // check version - if ( $ver<$client_ver ) - { - $this->_warning = sprintf ( "searchd command v.%d.%d older than client's v.%d.%d, some options might not work", - $ver>>8, $ver&0xff, $client_ver>>8, $client_ver&0xff ); - } - - return $response; - } - - ///////////////////////////////////////////////////////////////////////////// - // searching - ///////////////////////////////////////////////////////////////////////////// - - /// set offset and count into result set, - /// and optionally set max-matches and cutoff limits - function SetLimits ( $offset, $limit, $max=0, $cutoff=0 ) - { - assert ( is_int($offset) ); - assert ( is_int($limit) ); - assert ( $offset>=0 ); - assert ( $limit>0 ); - assert ( $max>=0 ); - $this->_offset = $offset; - $this->_limit = $limit; - if ( $max>0 ) - $this->_maxmatches = $max; - if ( $cutoff>0 ) - $this->_cutoff = $cutoff; - } - - /// set maximum query time, in milliseconds, per-index - /// integer, 0 means "do not limit" - function SetMaxQueryTime ( $max ) - { - assert ( is_int($max) ); - assert ( $max>=0 ); - $this->_maxquerytime = $max; - } - - /// set matching mode - function SetMatchMode ( $mode ) - { - assert ( $mode==SPH_MATCH_ALL - || $mode==SPH_MATCH_ANY - || $mode==SPH_MATCH_PHRASE - || $mode==SPH_MATCH_BOOLEAN - || $mode==SPH_MATCH_EXTENDED - || $mode==SPH_MATCH_FULLSCAN - || $mode==SPH_MATCH_EXTENDED2 ); - $this->_mode = $mode; - } - - /// set ranking mode - function SetRankingMode ( $ranker ) - { - assert ( $ranker>=0 && $ranker_ranker = $ranker; - } - - /// set matches sorting mode - function SetSortMode ( $mode, $sortby="" ) - { - assert ( - $mode==SPH_SORT_RELEVANCE || - $mode==SPH_SORT_ATTR_DESC || - $mode==SPH_SORT_ATTR_ASC || - $mode==SPH_SORT_TIME_SEGMENTS || - $mode==SPH_SORT_EXTENDED || - $mode==SPH_SORT_EXPR ); - assert ( is_string($sortby) ); - assert ( $mode==SPH_SORT_RELEVANCE || strlen($sortby)>0 ); - - $this->_sort = $mode; - $this->_sortby = $sortby; - } - - /// bind per-field weights by order - /// DEPRECATED; use SetFieldWeights() instead - function SetWeights ( $weights ) - { - assert ( is_array($weights) ); - foreach ( $weights as $weight ) - assert ( is_int($weight) ); - - $this->_weights = $weights; - } - - /// bind per-field weights by name - function SetFieldWeights ( $weights ) - { - assert ( is_array($weights) ); - foreach ( $weights as $name=>$weight ) - { - assert ( is_string($name) ); - assert ( is_int($weight) ); - } - $this->_fieldweights = $weights; - } - - /// bind per-index weights by name - function SetIndexWeights ( $weights ) - { - assert ( is_array($weights) ); - foreach ( $weights as $index=>$weight ) - { - assert ( is_string($index) ); - assert ( is_int($weight) ); - } - $this->_indexweights = $weights; - } - - /// set IDs range to match - /// only match records if document ID is beetwen $min and $max (inclusive) - function SetIDRange ( $min, $max ) - { - assert ( is_numeric($min) ); - assert ( is_numeric($max) ); - assert ( $min<=$max ); - $this->_min_id = $min; - $this->_max_id = $max; - } - - /// set values set filter - /// only match records where $attribute value is in given set - function SetFilter ( $attribute, $values, $exclude=false ) - { - assert ( is_string($attribute) ); - assert ( is_array($values) ); - assert ( count($values) ); - - if ( is_array($values) && count($values) ) - { - foreach ( $values as $value ) - assert ( is_numeric($value) ); - - $this->_filters[] = array ( "type"=>SPH_FILTER_VALUES, "attr"=>$attribute, "exclude"=>$exclude, "values"=>$values ); - } - } - - /// set range filter - /// only match records if $attribute value is beetwen $min and $max (inclusive) - function SetFilterRange ( $attribute, $min, $max, $exclude=false ) - { - assert ( is_string($attribute) ); - assert ( is_numeric($min) ); - assert ( is_numeric($max) ); - assert ( $min<=$max ); - - $this->_filters[] = array ( "type"=>SPH_FILTER_RANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max ); - } - - /// set float range filter - /// only match records if $attribute value is beetwen $min and $max (inclusive) - function SetFilterFloatRange ( $attribute, $min, $max, $exclude=false ) - { - assert ( is_string($attribute) ); - assert ( is_float($min) ); - assert ( is_float($max) ); - assert ( $min<=$max ); - - $this->_filters[] = array ( "type"=>SPH_FILTER_FLOATRANGE, "attr"=>$attribute, "exclude"=>$exclude, "min"=>$min, "max"=>$max ); - } - - /// setup anchor point for geosphere distance calculations - /// required to use @geodist in filters and sorting - /// latitude and longitude must be in radians - function SetGeoAnchor ( $attrlat, $attrlong, $lat, $long ) - { - assert ( is_string($attrlat) ); - assert ( is_string($attrlong) ); - assert ( is_float($lat) ); - assert ( is_float($long) ); - - $this->_anchor = array ( "attrlat"=>$attrlat, "attrlong"=>$attrlong, "lat"=>$lat, "long"=>$long ); - } - - /// set grouping attribute and function - function SetGroupBy ( $attribute, $func, $groupsort="@group desc" ) - { - assert ( is_string($attribute) ); - assert ( is_string($groupsort) ); - assert ( $func==SPH_GROUPBY_DAY - || $func==SPH_GROUPBY_WEEK - || $func==SPH_GROUPBY_MONTH - || $func==SPH_GROUPBY_YEAR - || $func==SPH_GROUPBY_ATTR - || $func==SPH_GROUPBY_ATTRPAIR ); - - $this->_groupby = $attribute; - $this->_groupfunc = $func; - $this->_groupsort = $groupsort; - } - - /// set count-distinct attribute for group-by queries - function SetGroupDistinct ( $attribute ) - { - assert ( is_string($attribute) ); - $this->_groupdistinct = $attribute; - } - - /// set distributed retries count and delay - function SetRetries ( $count, $delay=0 ) - { - assert ( is_int($count) && $count>=0 ); - assert ( is_int($delay) && $delay>=0 ); - $this->_retrycount = $count; - $this->_retrydelay = $delay; - } - - /// set result set format (hash or array; hash by default) - /// PHP specific; needed for group-by-MVA result sets that may contain duplicate IDs - function SetArrayResult ( $arrayresult ) - { - assert ( is_bool($arrayresult) ); - $this->_arrayresult = $arrayresult; - } - - /// set attribute values override - /// there can be only one override per attribute - /// $values must be a hash that maps document IDs to attribute values - function SetOverride ( $attrname, $attrtype, $values ) - { - assert ( is_string ( $attrname ) ); - assert ( in_array ( $attrtype, array ( SPH_ATTR_INTEGER, SPH_ATTR_TIMESTAMP, SPH_ATTR_BOOL, SPH_ATTR_FLOAT, SPH_ATTR_BIGINT ) ) ); - assert ( is_array ( $values ) ); - - $this->_overrides[$attrname] = array ( "attr"=>$attrname, "type"=>$attrtype, "values"=>$values ); - } - - /// set select-list (attributes or expressions), SQL-like syntax - function SetSelect ( $select ) - { - assert ( is_string ( $select ) ); - $this->_select = $select; - } - - ////////////////////////////////////////////////////////////////////////////// - - /// clear all filters (for multi-queries) - function ResetFilters () - { - $this->_filters = array(); - $this->_anchor = array(); - } - - /// clear groupby settings (for multi-queries) - function ResetGroupBy () - { - $this->_groupby = ""; - $this->_groupfunc = SPH_GROUPBY_DAY; - $this->_groupsort = "@group desc"; - $this->_groupdistinct= ""; - } - - /// clear all attribute value overrides (for multi-queries) - function ResetOverrides () - { - $this->_overrides = array (); - } - - ////////////////////////////////////////////////////////////////////////////// - - /// connect to searchd server, run given search query through given indexes, - /// and return the search results - function Query ( $query, $index="*", $comment="" ) - { - assert ( empty($this->_reqs) ); - - $this->AddQuery ( $query, $index, $comment ); - $results = $this->RunQueries (); - $this->_reqs = array (); // just in case it failed too early - - if ( !is_array($results) ) - return false; // probably network error; error message should be already filled - - $this->_error = $results[0]["error"]; - $this->_warning = $results[0]["warning"]; - if ( $results[0]["status"]==SEARCHD_ERROR ) - return false; - else - return $results[0]; - } - - /// helper to pack floats in network byte order - function _PackFloat ( $f ) - { - $t1 = pack ( "f", $f ); // machine order - list(,$t2) = unpack ( "L*", $t1 ); // int in machine order - return pack ( "N", $t2 ); - } - - /// add query to multi-query batch - /// returns index into results array from RunQueries() call - function AddQuery ( $query, $index="*", $comment="" ) - { - // mbstring workaround - $this->_MBPush (); - - // build request - $req = pack ( "NNNNN", $this->_offset, $this->_limit, $this->_mode, $this->_ranker, $this->_sort ); // mode and limits - $req .= pack ( "N", strlen($this->_sortby) ) . $this->_sortby; - $req .= pack ( "N", strlen($query) ) . $query; // query itself - $req .= pack ( "N", count($this->_weights) ); // weights - foreach ( $this->_weights as $weight ) - $req .= pack ( "N", (int)$weight ); - $req .= pack ( "N", strlen($index) ) . $index; // indexes - $req .= pack ( "N", 1 ); // id64 range marker - $req .= sphPackU64 ( $this->_min_id ) . sphPackU64 ( $this->_max_id ); // id64 range - - // filters - $req .= pack ( "N", count($this->_filters) ); - foreach ( $this->_filters as $filter ) - { - $req .= pack ( "N", strlen($filter["attr"]) ) . $filter["attr"]; - $req .= pack ( "N", $filter["type"] ); - switch ( $filter["type"] ) - { - case SPH_FILTER_VALUES: - $req .= pack ( "N", count($filter["values"]) ); - foreach ( $filter["values"] as $value ) { - var_dump($value); - $req .= sphPackI64 ( $value ); - } - break; - - case SPH_FILTER_RANGE: - $req .= sphPackI64 ( $filter["min"] ) . sphPackI64 ( $filter["max"] ); - break; - - case SPH_FILTER_FLOATRANGE: - $req .= $this->_PackFloat ( $filter["min"] ) . $this->_PackFloat ( $filter["max"] ); - break; - - default: - assert ( 0 && "internal error: unhandled filter type" ); - } - $req .= pack ( "N", $filter["exclude"] ); - } - - // group-by clause, max-matches count, group-sort clause, cutoff count - $req .= pack ( "NN", $this->_groupfunc, strlen($this->_groupby) ) . $this->_groupby; - $req .= pack ( "N", $this->_maxmatches ); - $req .= pack ( "N", strlen($this->_groupsort) ) . $this->_groupsort; - $req .= pack ( "NNN", $this->_cutoff, $this->_retrycount, $this->_retrydelay ); - $req .= pack ( "N", strlen($this->_groupdistinct) ) . $this->_groupdistinct; - - // anchor point - if ( empty($this->_anchor) ) - { - $req .= pack ( "N", 0 ); - } else - { - $a =& $this->_anchor; - $req .= pack ( "N", 1 ); - $req .= pack ( "N", strlen($a["attrlat"]) ) . $a["attrlat"]; - $req .= pack ( "N", strlen($a["attrlong"]) ) . $a["attrlong"]; - $req .= $this->_PackFloat ( $a["lat"] ) . $this->_PackFloat ( $a["long"] ); - } - - // per-index weights - $req .= pack ( "N", count($this->_indexweights) ); - foreach ( $this->_indexweights as $idx=>$weight ) - $req .= pack ( "N", strlen($idx) ) . $idx . pack ( "N", $weight ); - - // max query time - $req .= pack ( "N", $this->_maxquerytime ); - - // per-field weights - $req .= pack ( "N", count($this->_fieldweights) ); - foreach ( $this->_fieldweights as $field=>$weight ) - $req .= pack ( "N", strlen($field) ) . $field . pack ( "N", $weight ); - - // comment - $req .= pack ( "N", strlen($comment) ) . $comment; - - // attribute overrides - $req .= pack ( "N", count($this->_overrides) ); - foreach ( $this->_overrides as $key => $entry ) - { - $req .= pack ( "N", strlen($entry["attr"]) ) . $entry["attr"]; - $req .= pack ( "NN", $entry["type"], count($entry["values"]) ); - foreach ( $entry["values"] as $id=>$val ) - { - assert ( is_numeric($id) ); - assert ( is_numeric($val) ); - - $req .= sphPackU64 ( $id ); - switch ( $entry["type"] ) - { - case SPH_ATTR_FLOAT: $req .= $this->_PackFloat ( $val ); break; - case SPH_ATTR_BIGINT: $req .= sphPackI64 ( $val ); break; - default: $req .= pack ( "N", $val ); break; - } - } - } - - // select-list - $req .= pack ( "N", strlen($this->_select) ) . $this->_select; - - // mbstring workaround - $this->_MBPop (); - - // store request to requests array - $this->_reqs[] = $req; - return count($this->_reqs)-1; - } - - /// connect to searchd, run queries batch, and return an array of result sets - function RunQueries () - { - if ( empty($this->_reqs) ) - { - $this->_error = "no queries defined, issue AddQuery() first"; - return false; - } - - // mbstring workaround - $this->_MBPush (); - - if (!( $fp = $this->_Connect() )) - { - $this->_MBPop (); - return false; - } - - // send query, get response - $nreqs = count($this->_reqs); - $req = join ( "", $this->_reqs ); - $len = 4+strlen($req); - $req = pack ( "nnNN", SEARCHD_COMMAND_SEARCH, VER_COMMAND_SEARCH, $len, $nreqs ) . $req; // add header - - if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || - !( $response = $this->_GetResponse ( $fp, VER_COMMAND_SEARCH ) ) ) - { - $this->_MBPop (); - return false; - } - // query sent ok; we can reset reqs now - $this->_reqs = array (); - - // parse and return response - return $this->_ParseSearchResponse ( $response, $nreqs ); - } - - /// parse and return search query (or queries) response - function _ParseSearchResponse ( $response, $nreqs ) - { - $p = 0; // current position - $max = strlen($response); // max position for checks, to protect against broken responses - - $results = array (); - for ( $ires=0; $ires<$nreqs && $p<$max; $ires++ ) - { - $results[] = array(); - $result =& $results[$ires]; - - $result["error"] = ""; - $result["warning"] = ""; - - // extract status - list(,$status) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - $result["status"] = $status; - if ( $status!=SEARCHD_OK ) - { - list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - $message = substr ( $response, $p, $len ); $p += $len; - - if ( $status==SEARCHD_WARNING ) - { - $result["warning"] = $message; - } else - { - $result["error"] = $message; - continue; - } - } - - // read schema - $fields = array (); - $attrs = array (); - - list(,$nfields) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - while ( $nfields-->0 && $p<$max ) - { - list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - $fields[] = substr ( $response, $p, $len ); $p += $len; - } - $result["fields"] = $fields; - - list(,$nattrs) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - while ( $nattrs-->0 && $p<$max ) - { - list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - $attr = substr ( $response, $p, $len ); $p += $len; - list(,$type) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - $attrs[$attr] = $type; - } - $result["attrs"] = $attrs; - - // read match count - list(,$count) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - list(,$id64) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - - // read matches - $idx = -1; - while ( $count-->0 && $p<$max ) - { - // index into result array - $idx++; - - // parse document id and weight - if ( $id64 ) - { - $doc = sphUnpackU64 ( substr ( $response, $p, 8 ) ); $p += 8; - list(,$weight) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - } - else - { - list ( $doc, $weight ) = array_values ( unpack ( "N*N*", - substr ( $response, $p, 8 ) ) ); - $p += 8; - - if ( PHP_INT_SIZE>=8 ) - { - // x64 route, workaround broken unpack() in 5.2.2+ - if ( $doc<0 ) $doc += (1<<32); - } else - { - // x32 route, workaround php signed/unsigned braindamage - $doc = sprintf ( "%u", $doc ); - } - } - $weight = sprintf ( "%u", $weight ); - - // create match entry - if ( $this->_arrayresult ) - $result["matches"][$idx] = array ( "id"=>$doc, "weight"=>$weight ); - else - $result["matches"][$doc]["weight"] = $weight; - - // parse and create attributes - $attrvals = array (); - foreach ( $attrs as $attr=>$type ) - { - // handle 64bit ints - if ( $type==SPH_ATTR_BIGINT ) - { - $attrvals[$attr] = sphUnpackI64 ( substr ( $response, $p, 8 ) ); $p += 8; - continue; - } - - // handle floats - if ( $type==SPH_ATTR_FLOAT ) - { - list(,$uval) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - list(,$fval) = unpack ( "f*", pack ( "L", $uval ) ); - $attrvals[$attr] = $fval; - continue; - } - - // handle everything else as unsigned ints - list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - if ( $type & SPH_ATTR_MULTI ) - { - $attrvals[$attr] = array (); - $nvalues = $val; - while ( $nvalues-->0 && $p<$max ) - { - list(,$val) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - $attrvals[$attr][] = sprintf ( "%u", $val ); - } - } else if ( $type==SPH_ATTR_STRING ) - { - $attrvals[$attr] = substr ( $response, $p, $val ); - $p += $val; - } else - { - $attrvals[$attr] = sprintf ( "%u", $val ); - } - } - - if ( $this->_arrayresult ) - $result["matches"][$idx]["attrs"] = $attrvals; - else - $result["matches"][$doc]["attrs"] = $attrvals; - } - - list ( $total, $total_found, $msecs, $words ) = - array_values ( unpack ( "N*N*N*N*", substr ( $response, $p, 16 ) ) ); - $result["total"] = sprintf ( "%u", $total ); - $result["total_found"] = sprintf ( "%u", $total_found ); - $result["time"] = sprintf ( "%.3f", $msecs/1000 ); - $p += 16; - - while ( $words-->0 && $p<$max ) - { - list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - $word = substr ( $response, $p, $len ); $p += $len; - list ( $docs, $hits ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8; - $result["words"][$word] = array ( - "docs"=>sprintf ( "%u", $docs ), - "hits"=>sprintf ( "%u", $hits ) ); - } - } - - $this->_MBPop (); - return $results; - } - - ///////////////////////////////////////////////////////////////////////////// - // excerpts generation - ///////////////////////////////////////////////////////////////////////////// - - /// connect to searchd server, and generate exceprts (snippets) - /// of given documents for given query. returns false on failure, - /// an array of snippets on success - function BuildExcerpts ( $docs, $index, $words, $opts=array() ) - { - assert ( is_array($docs) ); - assert ( is_string($index) ); - assert ( is_string($words) ); - assert ( is_array($opts) ); - - $this->_MBPush (); - - if (!( $fp = $this->_Connect() )) - { - $this->_MBPop(); - return false; - } - - ///////////////// - // fixup options - ///////////////// - - if ( !isset($opts["before_match"]) ) $opts["before_match"] = ""; - if ( !isset($opts["after_match"]) ) $opts["after_match"] = ""; - if ( !isset($opts["chunk_separator"]) ) $opts["chunk_separator"] = " ... "; - if ( !isset($opts["limit"]) ) $opts["limit"] = 256; - if ( !isset($opts["around"]) ) $opts["around"] = 5; - if ( !isset($opts["exact_phrase"]) ) $opts["exact_phrase"] = false; - if ( !isset($opts["single_passage"]) ) $opts["single_passage"] = false; - if ( !isset($opts["use_boundaries"]) ) $opts["use_boundaries"] = false; - if ( !isset($opts["weight_order"]) ) $opts["weight_order"] = false; - if ( !isset($opts["query_mode"]) ) $opts["query_mode"] = false; - - ///////////////// - // build request - ///////////////// - - // v.1.0 req - $flags = 1; // remove spaces - if ( $opts["exact_phrase"] ) $flags |= 2; - if ( $opts["single_passage"] ) $flags |= 4; - if ( $opts["use_boundaries"] ) $flags |= 8; - if ( $opts["weight_order"] ) $flags |= 16; - if ( $opts["query_mode"] ) $flags |= 32; - $req = pack ( "NN", 0, $flags ); // mode=0, flags=$flags - $req .= pack ( "N", strlen($index) ) . $index; // req index - $req .= pack ( "N", strlen($words) ) . $words; // req words - - // options - $req .= pack ( "N", strlen($opts["before_match"]) ) . $opts["before_match"]; - $req .= pack ( "N", strlen($opts["after_match"]) ) . $opts["after_match"]; - $req .= pack ( "N", strlen($opts["chunk_separator"]) ) . $opts["chunk_separator"]; - $req .= pack ( "N", (int)$opts["limit"] ); - $req .= pack ( "N", (int)$opts["around"] ); - - // documents - $req .= pack ( "N", count($docs) ); - foreach ( $docs as $doc ) - { - assert ( is_string($doc) ); - $req .= pack ( "N", strlen($doc) ) . $doc; - } - - //////////////////////////// - // send query, get response - //////////////////////////// - - $len = strlen($req); - $req = pack ( "nnN", SEARCHD_COMMAND_EXCERPT, VER_COMMAND_EXCERPT, $len ) . $req; // add header - if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || - !( $response = $this->_GetResponse ( $fp, VER_COMMAND_EXCERPT ) ) ) - { - $this->_MBPop (); - return false; - } - - ////////////////// - // parse response - ////////////////// - - $pos = 0; - $res = array (); - $rlen = strlen($response); - for ( $i=0; $i $rlen ) - { - $this->_error = "incomplete reply"; - $this->_MBPop (); - return false; - } - $res[] = $len ? substr ( $response, $pos, $len ) : ""; - $pos += $len; - } - - $this->_MBPop (); - return $res; - } - - - ///////////////////////////////////////////////////////////////////////////// - // keyword generation - ///////////////////////////////////////////////////////////////////////////// - - /// connect to searchd server, and generate keyword list for a given query - /// returns false on failure, - /// an array of words on success - function BuildKeywords ( $query, $index, $hits ) - { - assert ( is_string($query) ); - assert ( is_string($index) ); - assert ( is_bool($hits) ); - - $this->_MBPush (); - - if (!( $fp = $this->_Connect() )) - { - $this->_MBPop(); - return false; - } - - ///////////////// - // build request - ///////////////// - - // v.1.0 req - $req = pack ( "N", strlen($query) ) . $query; // req query - $req .= pack ( "N", strlen($index) ) . $index; // req index - $req .= pack ( "N", (int)$hits ); - - //////////////////////////// - // send query, get response - //////////////////////////// - - $len = strlen($req); - $req = pack ( "nnN", SEARCHD_COMMAND_KEYWORDS, VER_COMMAND_KEYWORDS, $len ) . $req; // add header - if ( !( $this->_Send ( $fp, $req, $len+8 ) ) || - !( $response = $this->_GetResponse ( $fp, VER_COMMAND_KEYWORDS ) ) ) - { - $this->_MBPop (); - return false; - } - - ////////////////// - // parse response - ////////////////// - - $pos = 0; - $res = array (); - $rlen = strlen($response); - list(,$nwords) = unpack ( "N*", substr ( $response, $pos, 4 ) ); - $pos += 4; - for ( $i=0; $i<$nwords; $i++ ) - { - list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4; - $tokenized = $len ? substr ( $response, $pos, $len ) : ""; - $pos += $len; - - list(,$len) = unpack ( "N*", substr ( $response, $pos, 4 ) ); $pos += 4; - $normalized = $len ? substr ( $response, $pos, $len ) : ""; - $pos += $len; - - $res[] = array ( "tokenized"=>$tokenized, "normalized"=>$normalized ); - - if ( $hits ) - { - list($ndocs,$nhits) = array_values ( unpack ( "N*N*", substr ( $response, $pos, 8 ) ) ); - $pos += 8; - $res [$i]["docs"] = $ndocs; - $res [$i]["hits"] = $nhits; - } - - if ( $pos > $rlen ) - { - $this->_error = "incomplete reply"; - $this->_MBPop (); - return false; - } - } - - $this->_MBPop (); - return $res; - } - - function EscapeString ( $string ) - { - $from = array ( '\\', '(',')','|','-','!','@','~','"','&', '/', '^', '$', '=' ); - $to = array ( '\\\\', '\(','\)','\|','\-','\!','\@','\~','\"', '\&', '\/', '\^', '\$', '\=' ); - - return str_replace ( $from, $to, $string ); - } - - ///////////////////////////////////////////////////////////////////////////// - // attribute updates - ///////////////////////////////////////////////////////////////////////////// - - /// batch update given attributes in given rows in given indexes - /// returns amount of updated documents (0 or more) on success, or -1 on failure - function UpdateAttributes ( $index, $attrs, $values, $mva=false ) - { - // verify everything - assert ( is_string($index) ); - assert ( is_bool($mva) ); - - assert ( is_array($attrs) ); - foreach ( $attrs as $attr ) - assert ( is_string($attr) ); - - assert ( is_array($values) ); - foreach ( $values as $id=>$entry ) - { - assert ( is_numeric($id) ); - assert ( is_array($entry) ); - assert ( count($entry)==count($attrs) ); - foreach ( $entry as $v ) - { - if ( $mva ) - { - assert ( is_array($v) ); - foreach ( $v as $vv ) - assert ( is_int($vv) ); - } else - assert ( is_int($v) ); - } - } - - // build request - $req = pack ( "N", strlen($index) ) . $index; - - $req .= pack ( "N", count($attrs) ); - foreach ( $attrs as $attr ) - { - $req .= pack ( "N", strlen($attr) ) . $attr; - $req .= pack ( "N", $mva ? 1 : 0 ); - } - - $req .= pack ( "N", count($values) ); - foreach ( $values as $id=>$entry ) - { - $req .= sphPackU64 ( $id ); - foreach ( $entry as $v ) - { - $req .= pack ( "N", $mva ? count($v) : $v ); - if ( $mva ) - foreach ( $v as $vv ) - $req .= pack ( "N", $vv ); - } - } - - // connect, send query, get response - if (!( $fp = $this->_Connect() )) - return -1; - - $len = strlen($req); - $req = pack ( "nnN", SEARCHD_COMMAND_UPDATE, VER_COMMAND_UPDATE, $len ) . $req; // add header - if ( !$this->_Send ( $fp, $req, $len+8 ) ) - return -1; - - if (!( $response = $this->_GetResponse ( $fp, VER_COMMAND_UPDATE ) )) - return -1; - - // parse response - list(,$updated) = unpack ( "N*", substr ( $response, 0, 4 ) ); - return $updated; - } - - ///////////////////////////////////////////////////////////////////////////// - // persistent connections - ///////////////////////////////////////////////////////////////////////////// - - function Open() - { - if ( $this->_socket !== false ) - { - $this->_error = 'already connected'; - return false; - } - if ( !$fp = $this->_Connect() ) - return false; - - // command, command version = 0, body length = 4, body = 1 - $req = pack ( "nnNN", SEARCHD_COMMAND_PERSIST, 0, 4, 1 ); - if ( !$this->_Send ( $fp, $req, 12 ) ) - return false; - - $this->_socket = $fp; - return true; - } - - function Close() - { - if ( $this->_socket === false ) - { - $this->_error = 'not connected'; - return false; - } - - fclose ( $this->_socket ); - $this->_socket = false; - - return true; - } - - ////////////////////////////////////////////////////////////////////////// - // status - ////////////////////////////////////////////////////////////////////////// - - function Status () - { - $this->_MBPush (); - if (!( $fp = $this->_Connect() )) - { - $this->_MBPop(); - return false; - } - - $req = pack ( "nnNN", SEARCHD_COMMAND_STATUS, VER_COMMAND_STATUS, 4, 1 ); // len=4, body=1 - if ( !( $this->_Send ( $fp, $req, 12 ) ) || - !( $response = $this->_GetResponse ( $fp, VER_COMMAND_STATUS ) ) ) - { - $this->_MBPop (); - return false; - } - - $res = substr ( $response, 4 ); // just ignore length, error handling, etc - $p = 0; - list ( $rows, $cols ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8; - - $res = array(); - for ( $i=0; $i<$rows; $i++ ) - for ( $j=0; $j<$cols; $j++ ) - { - list(,$len) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; - $res[$i][] = substr ( $response, $p, $len ); $p += $len; - } - - $this->_MBPop (); - return $res; - } - - ////////////////////////////////////////////////////////////////////////// - // flush - ////////////////////////////////////////////////////////////////////////// - - function FlushAttrs () - { - $this->_MBPush (); - if (!( $fp = $this->_Connect() )) - { - $this->_MBPop(); - return false; - } - - $req = pack ( "nnN", SEARCHD_COMMAND_FLUSHATTRS, VER_COMMAND_FLUSHATTRS, 0 ); // len=0 - if ( !( $this->_Send ( $fp, $req, 8 ) ) || - !( $response = $this->_GetResponse ( $fp, VER_COMMAND_FLUSHATTRS ) ) ) - { - $this->_MBPop (); - return false; - } - - $tag = -1; - if ( strlen($response)==4 ) - list(,$tag) = unpack ( "N*", $response ); - - $this->_MBPop (); - return $tag; - } - -} - -// -// $Id$ -// \ No newline at end of file diff --git a/src/old/library/Zend/Controller/Request/Http.php b/src/old/library/Zend/Controller/Request/Http.php index bd8804aef..e4dcfe839 100755 --- a/src/old/library/Zend/Controller/Request/Http.php +++ b/src/old/library/Zend/Controller/Request/Http.php @@ -1,4 +1,5 @@ valid()) { - $path = $uri->getPath(); + $path = $uri->getPath(); $query = $uri->getQuery(); if (!empty($query)) { $path .= '?' . $query; @@ -148,9 +149,9 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract return $_POST[$key]; case isset($_COOKIE[$key]): return $_COOKIE[$key]; - case ($key == 'REQUEST_URI'): + case $key == 'REQUEST_URI': return $this->getRequestUri(); - case ($key == 'PATH_INFO'): + case $key == 'PATH_INFO': return $this->getPathInfo(); case isset($_SERVER[$key]): return $_SERVER[$key]; @@ -187,7 +188,9 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract public function __set($key, $value) { require_once 'Zend/Controller/Request/Exception.php'; - throw new Zend_Controller_Request_Exception('Setting values in superglobals not allowed; please use setParam()'); + throw new Zend_Controller_Request_Exception( + 'Setting values in superglobals not allowed; please use setParam()', + ); } /** @@ -248,11 +251,13 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract */ public function setQuery($spec, $value = null) { - if ((null === $value) && !is_array($spec)) { + if (null === $value && !is_array($spec)) { require_once 'Zend/Controller/Exception.php'; - throw new Zend_Controller_Exception('Invalid value passed to setQuery(); must be either array of values or key/value pair'); + throw new Zend_Controller_Exception( + 'Invalid value passed to setQuery(); must be either array of values or key/value pair', + ); } - if ((null === $value) && is_array($spec)) { + if (null === $value && is_array($spec)) { foreach ($spec as $key => $value) { $this->setQuery($key, $value); } @@ -278,7 +283,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract return $_GET; } - return (isset($_GET[$key])) ? $_GET[$key] : $default; + return isset($_GET[$key]) ? $_GET[$key] : $default; } /** @@ -290,11 +295,13 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract */ public function setPost($spec, $value = null) { - if ((null === $value) && !is_array($spec)) { + if (null === $value && !is_array($spec)) { require_once 'Zend/Controller/Exception.php'; - throw new Zend_Controller_Exception('Invalid value passed to setPost(); must be either array of values or key/value pair'); + throw new Zend_Controller_Exception( + 'Invalid value passed to setPost(); must be either array of values or key/value pair', + ); } - if ((null === $value) && is_array($spec)) { + if (null === $value && is_array($spec)) { foreach ($spec as $key => $value) { $this->setPost($key, $value); } @@ -320,7 +327,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract return $_POST; } - return (isset($_POST[$key])) ? $_POST[$key] : $default; + return isset($_POST[$key]) ? $_POST[$key] : $default; } /** @@ -339,7 +346,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract return $_COOKIE; } - return (isset($_COOKIE[$key])) ? $_COOKIE[$key] : $default; + return isset($_COOKIE[$key]) ? $_COOKIE[$key] : $default; } /** @@ -357,7 +364,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract return $_SERVER; } - return (isset($_SERVER[$key])) ? $_SERVER[$key] : $default; + return isset($_SERVER[$key]) ? $_SERVER[$key] : $default; } /** @@ -375,7 +382,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract return $_ENV; } - return (isset($_ENV[$key])) ? $_ENV[$key] : $default; + return isset($_ENV[$key]) ? $_ENV[$key] : $default; } /** @@ -392,11 +399,11 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract if ($requestUri === null) { if ( // IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem) - isset($_SERVER['IIS_WasUrlRewritten']) - && $_SERVER['IIS_WasUrlRewritten'] == '1' - && isset($_SERVER['UNENCODED_URL']) - && $_SERVER['UNENCODED_URL'] != '' - ) { + isset($_SERVER['IIS_WasUrlRewritten']) && + $_SERVER['IIS_WasUrlRewritten'] == '1' && + isset($_SERVER['UNENCODED_URL']) && + $_SERVER['UNENCODED_URL'] != '' + ) { $requestUri = $_SERVER['UNENCODED_URL']; } elseif (isset($_SERVER['REQUEST_URI'])) { $requestUri = $_SERVER['REQUEST_URI']; @@ -466,12 +473,12 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract */ public function setBaseUrl($baseUrl = null) { - if ((null !== $baseUrl) && !is_string($baseUrl)) { + if (null !== $baseUrl && !is_string($baseUrl)) { return $this; } if ($baseUrl === null) { - $filename = (isset($_SERVER['SCRIPT_FILENAME'])) ? basename($_SERVER['SCRIPT_FILENAME']) : ''; + $filename = isset($_SERVER['SCRIPT_FILENAME']) ? basename($_SERVER['SCRIPT_FILENAME']) : ''; if (isset($_SERVER['SCRIPT_NAME']) && basename($_SERVER['SCRIPT_NAME']) === $filename) { $baseUrl = $_SERVER['SCRIPT_NAME']; @@ -482,18 +489,18 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract } else { // Backtrack up the script_filename to find the portion matching // php_self - $path = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : ''; - $file = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : ''; - $segs = explode('/', trim($file, '/')); - $segs = array_reverse($segs); - $index = 0; - $last = count($segs); + $path = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : ''; + $file = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : ''; + $segs = explode('/', trim($file, '/')); + $segs = array_reverse($segs); + $index = 0; + $last = count($segs); $baseUrl = ''; do { - $seg = $segs[$index]; + $seg = $segs[$index]; $baseUrl = '/' . $seg . $baseUrl; ++$index; - } while (($last > $index) && (false !== ($pos = strpos($path, $baseUrl))) && (0 != $pos)); + } while ($last > $index && false !== ($pos = strpos($path, $baseUrl)) && 0 != $pos); } // Does the baseUrl have anything in common with the request_uri? @@ -526,9 +533,10 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract // If using mod_rewrite or ISAPI_Rewrite strip the script filename // out of baseUrl. $pos !== 0 makes sure it is not matching a value // from PATH_INFO or QUERY_STRING - if ((strlen($requestUri) >= strlen($baseUrl)) - && ((false !== ($pos = strpos($requestUri, $baseUrl))) && ($pos !== 0))) - { + if ( + strlen($requestUri) >= strlen($baseUrl) && + false !== ($pos = strpos($requestUri, $baseUrl)) && $pos !== 0 + ) { $baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl)); } } @@ -549,7 +557,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract $this->setBaseUrl(); } - return (($raw == false) ? urldecode($this->_baseUrl) : $this->_baseUrl); + return $raw == false ? urldecode($this->_baseUrl) : $this->_baseUrl; } /** @@ -561,9 +569,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract public function setBasePath($basePath = null) { if ($basePath === null) { - $filename = (isset($_SERVER['SCRIPT_FILENAME'])) - ? basename($_SERVER['SCRIPT_FILENAME']) - : ''; + $filename = isset($_SERVER['SCRIPT_FILENAME']) ? basename($_SERVER['SCRIPT_FILENAME']) : ''; $baseUrl = $this->getBaseUrl(); if (empty($baseUrl)) { @@ -636,7 +642,6 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract } else { $pathInfo = $requestUri; } - } $this->_pathInfo = (string) $pathInfo; @@ -695,7 +700,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract */ public function setParam($key, $value) { - $key = (null !== ($alias = $this->getAlias($key))) ? $alias : $key; + $key = null !== ($alias = $this->getAlias($key)) ? $alias : $key; parent::setParam($key, $value); return $this; } @@ -715,14 +720,14 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract */ public function getParam($key, $default = null) { - $keyName = (null !== ($alias = $this->getAlias($key))) ? $alias : $key; + $keyName = null !== ($alias = $this->getAlias($key)) ? $alias : $key; $paramSources = $this->getParamSources(); if (isset($this->_params[$keyName])) { return $this->_params[$keyName]; - } elseif (in_array('_GET', $paramSources) && (isset($_GET[$keyName]))) { + } elseif (in_array('_GET', $paramSources) && isset($_GET[$keyName])) { return $_GET[$keyName]; - } elseif (in_array('_POST', $paramSources) && (isset($_POST[$keyName]))) { + } elseif (in_array('_POST', $paramSources) && isset($_POST[$keyName])) { return $_POST[$keyName]; } @@ -740,18 +745,12 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract */ public function getParams() { - $return = $this->_params; + $return = $this->_params; $paramSources = $this->getParamSources(); - if (in_array('_GET', $paramSources) - && isset($_GET) - && is_array($_GET) - ) { + if (in_array('_GET', $paramSources) && isset($_GET) && is_array($_GET)) { $return += $_GET; } - if (in_array('_POST', $paramSources) - && isset($_POST) - && is_array($_POST) - ) { + if (in_array('_POST', $paramSources) && isset($_POST) && is_array($_POST)) { $return += $_POST; } return $return; @@ -934,7 +933,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract */ public function isXmlHttpRequest() { - return ($this->getHeader('X_REQUESTED_WITH') == 'XMLHttpRequest'); + return $this->getHeader('X_REQUESTED_WITH') == 'XMLHttpRequest'; } /** @@ -945,7 +944,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract public function isFlashRequest() { $header = strtolower($this->getHeader('USER_AGENT')); - return (strstr($header, ' flash')) ? true : false; + return strstr($header, ' flash') ? true : false; } /** @@ -955,7 +954,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract */ public function isSecure() { - return ($this->getScheme() === self::SCHEME_HTTPS); + return $this->getScheme() === self::SCHEME_HTTPS; } /** @@ -1003,9 +1002,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract * Try to get it from the $_SERVER array on POST request or CGI environment * @see https://www.ietf.org/rfc/rfc3875 (4.1.2. and 4.1.3.) */ - if (isset($_SERVER[$temp]) - && in_array($temp, ['CONTENT_TYPE', 'CONTENT_LENGTH']) - ) { + if (isset($_SERVER[$temp]) && in_array($temp, ['CONTENT_TYPE', 'CONTENT_LENGTH'])) { return $_SERVER[$temp]; } @@ -1034,7 +1031,7 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract */ public function getScheme() { - return ($this->getServer('HTTPS') == 'on') ? self::SCHEME_HTTPS : self::SCHEME_HTTP; + return $this->getServer('HTTPS') == 'on' ? self::SCHEME_HTTPS : self::SCHEME_HTTP; } /** @@ -1054,19 +1051,18 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract } $scheme = $this->getScheme(); - $name = $this->getServer('SERVER_NAME'); - $port = $this->getServer('SERVER_PORT'); + $name = $this->getServer('SERVER_NAME'); + $port = $this->getServer('SERVER_PORT'); - if(null === $name) { + if (null === $name) { return ''; } - if (($scheme == self::SCHEME_HTTP && $port == 80) || ($scheme == self::SCHEME_HTTPS && $port == 443)) { + if ($scheme == self::SCHEME_HTTP && $port == 80 || $scheme == self::SCHEME_HTTPS && $port == 443) { return $name; } return $name . ':' . $port; - } /** diff --git a/src/old/library/Zend/Controller/Router/Rewrite.php b/src/old/library/Zend/Controller/Router/Rewrite.php index 54396e9db..58eb2a4d9 100755 --- a/src/old/library/Zend/Controller/Router/Rewrite.php +++ b/src/old/library/Zend/Controller/Router/Rewrite.php @@ -1,4 +1,5 @@ hasRoute('default')) { $dispatcher = $this->getFrontController()->getDispatcher(); - $request = $this->getFrontController()->getRequest(); + $request = $this->getFrontController()->getRequest(); require_once 'Zend/Controller/Router/Route/Module.php'; $compat = new Zend_Controller_Router_Route_Module([], $dispatcher, $request); @@ -177,7 +177,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract if ($route instanceof Zend_Controller_Router_Route_Chain) { if (!isset($info->chain)) { require_once 'Zend/Controller/Router/Exception.php'; - throw new Zend_Controller_Router_Exception("No chain defined"); + throw new Zend_Controller_Router_Exception('No chain defined'); } if ($info->chain instanceof Zend_Config) { @@ -210,18 +210,16 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract */ protected function _getRouteFromConfig(Zend_Config $info) { - $class = (isset($info->type)) ? $info->type : 'Zend_Controller_Router_Route'; + $class = isset($info->type) ? $info->type : 'Zend_Controller_Router_Route'; if (!class_exists($class)) { require_once 'Zend/Loader.php'; Zend_Loader::loadClass($class); } - $route = call_user_func( - [ - $class, - 'getInstance' - ], $info - ); + $route = call_user_func([ + $class, + 'getInstance', + ], $info); if (isset($info->abstract) && $info->abstract && method_exists($route, 'isAbstract')) { $route->isAbstract(true); @@ -241,13 +239,12 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract protected function _addChainRoutesFromConfig( $name, Zend_Controller_Router_Route_Interface $route, - Zend_Config $childRoutesInfo - ) - { + Zend_Config $childRoutesInfo, + ) { foreach ($childRoutesInfo as $childRouteName => $childRouteInfo) { if (is_string($childRouteInfo)) { $childRouteName = $childRouteInfo; - $childRoute = $this->getRoute($childRouteName); + $childRoute = $this->getRoute($childRouteName); } else { $childRoute = $this->_getRouteFromConfig($childRouteInfo); } @@ -280,7 +277,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract { if (!isset($this->_routes[$name])) { require_once 'Zend/Controller/Router/Exception.php'; - throw new Zend_Controller_Router_Exception("Route $name is not defined"); + throw new Zend_Controller_Router_Exception("Route {$name} is not defined"); } unset($this->_routes[$name]); @@ -322,7 +319,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract { if (!isset($this->_routes[$name])) { require_once 'Zend/Controller/Router/Exception.php'; - throw new Zend_Controller_Router_Exception("Route $name is not defined"); + throw new Zend_Controller_Router_Exception("Route {$name} is not defined"); } return $this->_routes[$name]; @@ -338,7 +335,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract { if (!isset($this->_currentRoute)) { require_once 'Zend/Controller/Router/Exception.php'; - throw new Zend_Controller_Router_Exception("Current route is not defined"); + throw new Zend_Controller_Router_Exception('Current route is not defined'); } return $this->getRoute($this->_currentRoute); @@ -354,7 +351,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract { if (!isset($this->_currentRoute)) { require_once 'Zend/Controller/Router/Exception.php'; - throw new Zend_Controller_Router_Exception("Current route is not defined"); + throw new Zend_Controller_Router_Exception('Current route is not defined'); } return $this->_currentRoute; @@ -380,10 +377,10 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract */ public function route(Zend_Controller_Request_Abstract $request) { - if (!$request instanceof Zend_Controller_Request_Http) { + if (!($request instanceof Zend_Controller_Request_Http)) { require_once 'Zend/Controller/Router/Exception.php'; throw new Zend_Controller_Router_Exception( - 'Zend_Controller_Router_Rewrite requires a Zend_Controller_Request_Http-based request object' + 'Zend_Controller_Router_Rewrite requires a Zend_Controller_Request_Http-based request object', ); } @@ -410,7 +407,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract if ($params = $route->match($match)) { $this->_setRequestParams($request, $params); $this->_currentRoute = $name; - $routeMatched = true; + $routeMatched = true; break; } } @@ -441,7 +438,6 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract protected function _setRequestParams($request, $params) { foreach ($params as $param => $value) { - $request->setParam($param, $value); if ($param === $request->getModuleKey()) { @@ -485,7 +481,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract $params = $userParams + $this->_globalParams; $route = $this->getRoute($name); - $url = $route->assemble($params, $reset, $encode); + $url = $route->assemble($params, $reset, $encode); if (!preg_match('|^[a-z]+://|', $url)) { $url = rtrim($this->getFrontController()->getBaseUrl(), self::URI_DELIMITER) . self::URI_DELIMITER . $url; @@ -548,7 +544,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract return $this->_useCurrentParamsAsGlobal; } - $this->_useCurrentParamsAsGlobal = (bool)$use; + $this->_useCurrentParamsAsGlobal = (bool) $use; return $this; } diff --git a/src/old/library/Zend/Controller/Router/Route.php b/src/old/library/Zend/Controller/Router/Route.php index cda88c6b2..aa3ccb3a1 100755 --- a/src/old/library/Zend/Controller/Router/Route.php +++ b/src/old/library/Zend/Controller/Router/Route.php @@ -1,4 +1,5 @@ _urlDelimiter); - $this->_defaults = (array)$defaults; - $this->_requirements = (array)$reqs; - $this->_translator = $translator; - $this->_locale = $locale; + $route, + $defaults = [], + $reqs = [], + null|Zend_Translate $translator = null, + $locale = null, + ) { + $route = trim($route, $this->_urlDelimiter); + $this->_defaults = (array) $defaults; + $this->_requirements = (array) $reqs; + $this->_translator = $translator; + $this->_locale = $locale; if ($route !== '') { foreach (explode($this->_urlDelimiter, $route) as $pos => $part) { @@ -186,12 +189,12 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract $name = substr($part, 1); if (substr($name, 0, 1) === '@' && substr($name, 1, 1) !== '@') { - $name = substr($name, 1); + $name = substr($name, 1); $this->_translatable[] = $name; - $this->_isTranslated = true; + $this->_isTranslated = true; } - $this->_parts[$pos] = (isset($reqs[$name]) ? $reqs[$name] : $this->_defaultRegex); + $this->_parts[$pos] = isset($reqs[$name]) ? $reqs[$name] : $this->_defaultRegex; $this->_variables[$pos] = $name; } else { if (substr($part, 0, 1) == $this->_urlVariable) { @@ -228,8 +231,8 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract } $path = strtolower($path); $pathStaticCount = 0; - $values = []; - $matchedPath = ''; + $values = []; + $matchedPath = ''; if (!$partial) { $path = trim($path, $this->_urlDelimiter); @@ -255,10 +258,12 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract $count = count($path); for ($i = $pos; $i < $count; $i += 2) { $var = urldecode($path[$i]); - if (!isset($this->_wildcardData[$var]) && !isset($this->_defaults[$var]) - && !isset($values[$var]) + if ( + !isset($this->_wildcardData[$var]) && + !isset($this->_defaults[$var]) && + !isset($values[$var]) ) { - $this->_wildcardData[$var] = (isset($path[$i + 1])) ? urldecode($path[$i + 1]) : null; + $this->_wildcardData[$var] = isset($path[$i + 1]) ? urldecode($path[$i + 1]) : null; } } @@ -266,16 +271,18 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract break; } - $name = isset($this->_variables[$pos]) ? $this->_variables[$pos] : null; + $name = isset($this->_variables[$pos]) ? $this->_variables[$pos] : null; $pathPart = urldecode($pathPart); // Translate value if required $part = $this->_parts[$pos]; - if ($this->_isTranslated - && $part !== null - && (substr($part, 0, 1) === '@' && substr($part, 1, 1) !== '@' - && $name === null) - || $name !== null && in_array($name, $this->_translatable) + if ( + $this->_isTranslated && + $part !== null && + substr($part, 0, 1) === '@' && + substr($part, 1, 1) !== '@' && + $name === null || + $name !== null && in_array($name, $this->_translatable) ) { if ($part !== null && substr($part, 0, 1) === '@') { $part = substr($part, 1); @@ -296,10 +303,12 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract } // If it's a variable with requirement, match a regex. If not - everything matches - if ($part !== null - && !preg_match( - $this->_regexDelimiter . '^' . $part . '$' . $this->_regexDelimiter . 'iu', $pathPart - ) + if ( + $part !== null && + !preg_match( + $this->_regexDelimiter . '^' . $part . '$' . $this->_regexDelimiter . 'iu', + $pathPart, + ) ) { return false; } @@ -360,7 +369,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract } } - $url = []; + $url = []; $flag = false; foreach ($this->_parts as $key => $part) { @@ -414,7 +423,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract if ($value !== null && (!isset($defaults[$var]) || $value != $defaults[$var])) { $url[$key++] = $var; $url[$key++] = $value; - $flag = true; + $flag = true; } } } @@ -428,8 +437,10 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract if (isset($this->_variables[$key])) { $defaultValue = $this->getDefault($this->_variables[$key]); - if ($this->_isTranslated && $defaultValue !== null - && isset($this->_translatable[$this->_variables[$key]]) + if ( + $this->_isTranslated && + $defaultValue !== null && + isset($this->_translatable[$this->_variables[$key]]) ) { $defaultValue = $translator->translate($defaultValue, $locale); } @@ -440,7 +451,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract $value = urlencode($value); } $return = $this->_urlDelimiter . $value . $return; - $flag = true; + $flag = true; } } @@ -488,7 +499,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract * @param Zend_Translate $translator * @return void */ - public static function setDefaultTranslator(Zend_Translate $translator = null) + public static function setDefaultTranslator(null|Zend_Translate $translator = null) { self::$_defaultTranslator = $translator; } diff --git a/src/old/library/Zend/Controller/Router/Route/Chain.php b/src/old/library/Zend/Controller/Router/Route/Chain.php index 58de590ed..26ac69a94 100755 --- a/src/old/library/Zend/Controller/Router/Route/Chain.php +++ b/src/old/library/Zend/Controller/Router/Route/Chain.php @@ -1,4 +1,5 @@ _routes[] = $route; + $this->_routes[] = $route; $this->_separators[] = $separator; return $this; @@ -91,18 +91,14 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab */ public function match($request, $partial = null) { - $rawPath = $request->getPathInfo(); - $path = trim($request->getPathInfo(), self::URI_DELIMITER); - $subPath = $path; - $values = []; + $rawPath = $request->getPathInfo(); + $path = trim($request->getPathInfo(), self::URI_DELIMITER); + $subPath = $path; + $values = []; $matchedPath = null; foreach ($this->_routes as $key => $route) { - if ($key > 0 - && $matchedPath !== null - && $subPath !== '' - && $subPath !== false - ) { + if ($key > 0 && $matchedPath !== null && $subPath !== '' && $subPath !== false) { $separator = substr($subPath, 0, strlen($this->_separators[$key])); if ($separator !== $this->_separators[$key]) { @@ -130,7 +126,7 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab $matchedPath = $route->getMatchedPath(); if ($matchedPath !== null) { - $subPath = substr($subPath, strlen($matchedPath)); + $subPath = substr($subPath, strlen($matchedPath)); } $values = $res + $values; @@ -155,7 +151,7 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab */ public function assemble($data = [], $reset = false, $encode = false) { - $value = ''; + $value = ''; $numRoutes = count($this->_routes); foreach ($this->_routes as $key => $route) { @@ -163,7 +159,7 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab $value .= $this->_separators[$key]; } - $value .= $route->assemble($data, $reset, $encode, (($numRoutes - 1) > $key)); + $value .= $route->assemble($data, $reset, $encode, ($numRoutes - 1) > $key); if (method_exists($route, 'getVariables')) { $variables = $route->getVariables(); @@ -183,7 +179,7 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab * @param Zend_Controller_Request_Abstract|null $request * @return void */ - public function setRequest(Zend_Controller_Request_Abstract $request = null) + public function setRequest(null|Zend_Controller_Request_Abstract $request = null) { $this->_request = $request; diff --git a/src/old/public/index.php b/src/old/public/index.php index d7d2fc884..46b46105f 100755 --- a/src/old/public/index.php +++ b/src/old/public/index.php @@ -1,39 +1,32 @@ bootstrap(array('Autoload', 'Db', 'Cli', 'ArticleQueues'))->run(); -}else{ - try{ + $application->bootstrap(['Autoload', 'Db', 'Cli', 'ArticleQueues'])->run(); +} else { + try { $application->bootstrap()->run(); - Zend_Registry::get('log')->debug("ENDE"); - } catch (Exception $e) { + Zend_Registry::get('log')->debug('ENDE'); + } catch (Exception $e) { Zend_Registry::get('log')->debug($e->getMessage()); } } diff --git a/src/old/public/temp/693ee015ef5c1.pdf.png b/src/old/public/temp/693ee015ef5c1.pdf.png new file mode 100644 index 000000000..d02beac2d Binary files /dev/null and b/src/old/public/temp/693ee015ef5c1.pdf.png differ diff --git a/src/old/public/temp/693ee3d44d501.pdf.png b/src/old/public/temp/693ee3d44d501.pdf.png new file mode 100644 index 000000000..238677b41 Binary files /dev/null and b/src/old/public/temp/693ee3d44d501.pdf.png differ diff --git a/src/old/public/temp/693eea0a96431.pdf.png b/src/old/public/temp/693eea0a96431.pdf.png new file mode 100644 index 000000000..d7178453a Binary files /dev/null and b/src/old/public/temp/693eea0a96431.pdf.png differ diff --git a/src/old/public/temp/693eeb4300d55.pdf.png b/src/old/public/temp/693eeb4300d55.pdf.png new file mode 100644 index 000000000..330c7a656 Binary files /dev/null and b/src/old/public/temp/693eeb4300d55.pdf.png differ