From 1cc2bc57bab17195f6cba7a3835a62977c2b73cd Mon Sep 17 00:00:00 2001 From: Thomas Peterson Date: Mon, 15 Dec 2025 17:01:07 +0100 Subject: [PATCH] Basket Bundle Attributes --- src/new/config/reference.php | 4 +- .../Controller/DashboardController.php | 2 +- .../Controller/DefaultController.php | 2 +- .../Controller/LoginController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../Controller/Backend/ExporterController.php | 2 +- .../Controller/Backend/ImporterController.php | 2 +- .../Api/Account/GetParentByTitle.php | 75 +- .../PSC/Component/ApiBundle/Api/Cms/Get.php | 63 +- .../Component/ApiBundle/Api/Plugin/Get.php | 80 +- .../PSC/Component/ApiBundle/Api/Shop/Get.php | 72 +- .../ApiBundle/Api/Stockbooking/CreateByNr.php | 70 +- .../ApiBundle/Api/Stockbooking/GetByNr.php | 65 +- .../Component/ApiBundle/Api/System/Info.php | 35 +- .../ApiBundle/Api/System/Version.php | 29 +- .../Dto/Account/GetParentByTitle/Input.php | 11 +- .../Dto/Account/GetParentByTitle/Output.php | 17 +- .../ApiBundle/Dto/Cms/Cms/Output.php | 18 +- .../ApiBundle/Dto/Error/NotFound.php | 9 +- .../ApiBundle/Dto/Error/PersistFailure.php | 9 +- .../ApiBundle/Dto/Plugin/Plugins/Output.php | 18 +- .../ApiBundle/Dto/Shop/Shops/Output.php | 18 +- .../Dto/Stockbooking/CreateByNr/Input.php | 35 +- .../Dto/Stockbooking/CreateByNr/Output.php | 11 +- .../Dto/Stockbooking/GetByNr/Input.php | 11 +- .../Dto/Stockbooking/GetByNr/Output.php | 18 +- .../src/PSC/Component/ApiBundle/Model/Cms.php | 27 +- .../Component/ApiBundle/Model/Instance.php | 29 +- .../PSC/Component/ApiBundle/Model/Plugin.php | 17 +- .../PSC/Component/ApiBundle/Model/Shop.php | 58 +- .../Component/ApiBundle/Model/Shop/Domain.php | 17 +- .../ApiBundle/Model/Stockbooking.php | 33 +- .../PSC/Component/ApiBundle/Model/Version.php | 14 +- .../Controller/StoreController.php | 2 +- .../SteplayouterBundle/Calendar/Type/Hoch.php | 2 +- .../Calendar/Type/Hochvariable.php | 2 +- .../SteplayouterBundle/Calendar/Type/Quer.php | 2 +- .../Controller/CalendarController.php | 2 +- .../Controller/DefaultController.php | 2 +- .../Controller/PdfController.php | 2 +- .../Controller/ProductController.php | 2 +- .../Controller/StoreController.php | 2 +- .../Controller/System/CheckController.php | 2 +- .../Controller/System/SettingsController.php | 2 +- .../PSC/Shop/AccountBundle/Api/AllByShop.php | 2 +- .../Controller/Backend/EditController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../PSC/Shop/AccountBundle/Dto/All/Output.php | 10 +- .../PSC/Shop/AccountBundle/Model/Account.php | 23 +- .../Shop/BasketBundle/Api/Layouter/Save.php | 75 +- .../Shop/BasketBundle/Api/Layouter/Upload.php | 91 + .../Shop/BasketBundle/Dto/Layouter/Input.php | 5 +- .../Controller/Backend/EditController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../Controller/Frontend/ShowController.php | 2 +- .../Controller/Backend/OrderController.php | 2 +- .../Shop/ContactBundle/Api/Address/Crud.php | 2 +- .../Api/Address/GetAllForType.php | 2 +- .../src/PSC/Shop/ContactBundle/Api/All.php | 2 +- .../PSC/Shop/ContactBundle/Api/AllByShop.php | 2 +- .../src/PSC/Shop/ContactBundle/Api/Crud.php | 2 +- .../src/PSC/Shop/ContactBundle/Api/Exists.php | 50 +- .../src/PSC/Shop/ContactBundle/Api/Login.php | 2 +- .../PSC/Shop/ContactBundle/Api/Refresh.php | 2 +- .../Backend/AddressDetailController.php | 2 +- .../Backend/AddressImportController.php | 2 +- .../Controller/Backend/EditController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../Dto/Address/GetAllForType/Output.php | 10 +- .../PSC/Shop/ContactBundle/Dto/All/Output.php | 10 +- .../Shop/ContactBundle/Dto/Exists/Input.php | 9 +- .../Shop/ContactBundle/Dto/Exists/Output.php | 9 +- .../Dto/ExistsWithPassword/Input.php | 15 +- .../Shop/ContactBundle/Dto/Login/Output.php | 9 +- .../Shop/ContactBundle/Dto/Refresh/Output.php | 21 +- .../Controller/Backend/CopyController.php | 2 +- .../Controller/Backend/StartController.php | 2 +- .../EntityBundle/Entity/LayouterSession.php | 83 + .../EntityBundle/Lagacy/TP_Layouter_Item.php | 257 +++ .../Lagacy/TP_Layoutersession.php | 69 + .../Repository/LayouterSessionRepository.php | 10 +- .../Shop/MediaBundle/Api/UploadVariant.php | 9 +- .../Controller/Backend/ChooserController.php | 2 +- .../Controller/Backend/FolderController.php | 2 +- .../Controller/Backend/MediaController.php | 2 +- .../Controller/Backend/UploadController.php | 2 +- .../PSC/Shop/MediaBundle/Document/Media.php | 84 +- .../Controller/Backend/EditController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../OrderBundle/Api/Order/Action/Create.php | 19 +- .../PSC/Shop/OrderBundle/Api/Order/Calc.php | 30 +- .../OrderBundle/Api/Order/ChangeContact.php | 30 +- .../PSC/Shop/OrderBundle/Api/Order/Copy.php | 30 +- .../PSC/Shop/OrderBundle/Api/Order/Create.php | 30 +- .../OrderBundle/Api/Order/GetOneByUuid.php | 30 +- .../Shop/OrderBundle/Api/Order/Package/Nr.php | 30 +- .../OrderBundle/Api/Order/Status/Change.php | 30 +- .../Api/Order/Status/GetAllByStatus.php | 30 +- .../Api/Position/CheckDownload.php | 19 +- .../Api/Position/GetPluginListDisplay.php | 19 +- .../Api/Position/Status/Change.php | 30 +- .../Api/Position/Status/ChangeAll.php | 30 +- .../Api/Position/Upload/Delete.php | 30 +- .../Controller/Backend/DetailController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../Controller/Backend/PackageController.php | 2 +- .../Controller/Backend/PrintController.php | 2 +- .../Controller/Backend/UploadController.php | 2 +- .../Dto/Order/ChangeContact/Input.php | 14 +- .../Shop/OrderBundle/Dto/Order/Copy/Input.php | 14 +- .../Dto/Order/GetOneByUuid/Input.php | 9 +- .../Dto/Order/Package/Nr/Input.php | 15 +- .../Dto/Order/Package/Nr/Output.php | 9 +- .../Dto/Order/Status/Change/Input.php | 15 +- .../Dto/Order/Status/Change/Output.php | 9 +- .../Dto/Order/Status/GetAllByStatus/Input.php | 9 +- .../Order/Status/GetAllByStatus/Output.php | 16 +- .../Dto/Position/Status/Change/Input.php | 15 +- .../Dto/Position/Status/Change/Output.php | 9 +- .../Dto/Position/Status/ChangeAll/Input.php | 15 +- .../Dto/Position/Status/ChangeAll/Output.php | 9 +- .../Dto/Position/Upload/Delete/Input.php | 9 +- .../Dto/Position/Upload/Delete/Output.php | 9 +- .../Shop/OrderBundle/Model/Cancelation.php | 9 +- .../src/PSC/Shop/OrderBundle/Model/Credit.php | 9 +- .../PSC/Shop/OrderBundle/Model/Invoice.php | 9 +- .../src/PSC/Shop/OrderBundle/Model/Offer.php | 9 +- .../src/PSC/Shop/OrderBundle/Model/Order.php | 9 +- .../Model/Order/Position/AdditionalInfo.php | 14 +- .../Model/Order/Position/Upload.php | 32 +- .../OrderBundle/Model/ParcelCancellation.php | 9 +- .../Shop/OrderBundle/Model/ParcelInvoice.php | 9 +- .../src/PSC/Shop/PaymentBundle/Api/One.php | 2 +- .../Controller/Backend/EditController.php | 2 +- .../Controller/Backend/GatewayController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../Controller/Frontend/NotifyController.php | 2 +- .../Controller/Frontend/PayController.php | 2 +- .../PSC/Shop/PaymentBundle/Dto/All/Output.php | 16 +- .../PSC/Shop/PaymentBundle/Model/Payment.php | 31 +- .../Api/Product/GetAllByProductGroup.php | 19 +- .../Api/Product/GetAllByTerm.php | 19 +- .../Api/Product/GetFormAsJson.php | 19 +- .../Shop/ProductBundle/Api/Product/One.php | 19 +- .../ProductBundle/Api/Product/Set/Add.php | 2 +- .../ProductBundle/Api/Product/Set/Delete.php | 2 +- .../ProductBundle/Api/Product/Set/Get.php | 2 +- .../Api/ProductGroup/GetTree.php | 33 +- .../Api/ProductGroup/GetWithProducts.php | 21 +- .../Backend/Product/EditController.php | 2 +- .../Backend/Product/ListController.php | 2 +- .../Backend/Product/SetController.php | 2 +- .../Backend/Product/StockController.php | 2 +- .../Product/TemplateprintController.php | 2 +- .../Backend/Productgroup/EditController.php | 2 +- .../Backend/Productgroup/ListController.php | 2 +- .../Frontend/Product/OfferController.php | 2 +- .../Product/GetAllByProductGroup/Output.php | 16 +- .../ProductGroup/GetWithProducts/Output.php | 16 +- .../Shop/ProductBundle/Model/Lang/Item.php | 27 +- .../Shop/ProductBundle/Model/ProductGroup.php | 40 +- .../Controller/Backend/EditController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../PSC/Shop/SettingsBundle/Api/CheckVat.php | 2 +- .../Shop/SettingsBundle/Api/GetCountry.php | 2 +- .../Controller/Backend/CountryController.php | 2 +- .../Controller/Backend/RoutingController.php | 2 +- .../Controller/Backend/SettingsController.php | 2 +- .../Controller/Json/ShopController.php | 2 +- .../Controller/Backend/EditController.php | 2 +- .../Controller/Backend/GatewayController.php | 2 +- .../Controller/Backend/ImportController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../Controller/Service/CreateController.php | 2 +- .../Controller/Service/DownloadController.php | 2 +- .../Shop/ShippingBundle/Dto/All/Output.php | 16 +- .../Shop/ShippingBundle/Model/Shipping.php | 39 +- .../Controller/Backend/SettingsController.php | 2 +- .../Controller/Backend/EditController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../Controller/Backend/ListController.php | 2 +- .../Controller/Backend/HelpController.php | 2 +- .../Controller/Backend/LogController.php | 2 +- .../Backend/PaperContainerController.php | 2 +- .../Controller/Backend/PaperController.php | 2 +- .../Controller/Backend/SettingsController.php | 2 +- .../Controller/Backend/StatusController.php | 2 +- .../Controller/Backend/TaxController.php | 2 +- .../SettingsBundle/Dto/Paper/All/Output.php | 16 +- .../SettingsBundle/Dto/Status/All/Output.php | 16 +- .../PSC/System/SettingsBundle/Model/Paper.php | 111 +- .../SettingsBundle/Model/Papercontainer.php | 7 +- .../System/SettingsBundle/Model/Status.php | 23 +- .../Controller/MigrationController.php | 2 +- .../PSC/LaufkartenLayouter/Api/Save.php | 35 + .../Controller/DesignerController.php | 10 +- .../PSC/LaufkartenLayouter/Dto/Input.php | 18 + .../Resources/config/routing.yml | 5 + .../Resources/views/designer/start.html.twig | 242 ++- src/new/web/app.php | 1 + .../templates/article/_articlelistitem.phtml | 99 +- .../default/controllers/ArticleController.php | 3 +- src/old/library/SphinxClient.php | 1644 ----------------- .../library/Zend/Controller/Request/Http.php | 126 +- .../Zend/Controller/Router/Rewrite.php | 44 +- .../library/Zend/Controller/Router/Route.php | 77 +- .../Zend/Controller/Router/Route/Chain.php | 26 +- src/old/public/index.php | 41 +- src/old/public/temp/693ee015ef5c1.pdf.png | Bin 0 -> 6310 bytes src/old/public/temp/693ee3d44d501.pdf.png | Bin 0 -> 6310 bytes src/old/public/temp/693eea0a96431.pdf.png | Bin 0 -> 6310 bytes src/old/public/temp/693eeb4300d55.pdf.png | Bin 0 -> 6310 bytes 212 files changed, 2149 insertions(+), 3292 deletions(-) create mode 100644 src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Upload.php create mode 100644 src/new/src/PSC/Shop/EntityBundle/Lagacy/TP_Layouter_Item.php create mode 100644 src/new/src/PSC/Shop/EntityBundle/Lagacy/TP_Layoutersession.php create mode 100644 src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Api/Save.php create mode 100644 src/new/var/plugins/Custom/PSC/LaufkartenLayouter/Dto/Input.php delete mode 100755 src/old/library/SphinxClient.php create mode 100644 src/old/public/temp/693ee015ef5c1.pdf.png create mode 100644 src/old/public/temp/693ee3d44d501.pdf.png create mode 100644 src/old/public/temp/693eea0a96431.pdf.png create mode 100644 src/old/public/temp/693eeb4300d55.pdf.png 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 0000000000000000000000000000000000000000..d02beac2da7b8be4c4ee8f1c6b6502f01e4b673b GIT binary patch literal 6310 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 ZxhE17e*>_C^56gfXhL<=${$#T{ui?httJ2f literal 0 HcmV?d00001 diff --git a/src/old/public/temp/693ee3d44d501.pdf.png b/src/old/public/temp/693ee3d44d501.pdf.png new file mode 100644 index 0000000000000000000000000000000000000000..238677b415cbf5c0ccb60525cb50090ad93f694e GIT binary patch literal 6310 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 UM+)^ZWHvw(s-sr^z&iB50B^poYybcN literal 0 HcmV?d00001 diff --git a/src/old/public/temp/693eea0a96431.pdf.png b/src/old/public/temp/693eea0a96431.pdf.png new file mode 100644 index 0000000000000000000000000000000000000000..d7178453a26d577c09d7b0260183669f69983412 GIT binary patch literal 6310 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 UpO>Bg_x%B&0o7J5dte#zUw|B}*Z=?k literal 0 HcmV?d00001