Skip to content

Commit

Permalink
NEXT-25051 - Add missing package attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Jan 25, 2023
1 parent 9ab99bf commit a0b83bd
Show file tree
Hide file tree
Showing 178 changed files with 69 additions and 1,080 deletions.
16 changes: 1 addition & 15 deletions rector.php
Expand Up @@ -3,12 +3,6 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Symfony\Rector\MethodCall\ContainerGetToConstructorInjectionRector;
use Rector\Symfony\Set\SymfonyLevelSetList;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
use Shopware\Core\DevOps\StaticAnalyze\Rector\ClassPackageRector;

return static function (RectorConfig $rectorConfig): void {
Expand All @@ -27,16 +21,8 @@

$rectorConfig->skip([
__DIR__ . '/src/Core/Framework/Script/ServiceStubs.php',
ReturnNeverTypeRector::class,
AddLiteralSeparatorToNumberRector::class,
ContainerGetToConstructorInjectionRector::class,
__DIR__ . '/src/Recovery'
]);

$rectorConfig->rule(ClassPackageRector::class);
$rectorConfig->rule(AnnotationToAttributeRector::class);

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
SymfonyLevelSetList::UP_TO_SYMFONY_62,
]);
};
Expand Up @@ -9,7 +9,6 @@
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\RequestCriteriaBuilder;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\Framework\Util\Random;
use Shopware\Core\PlatformRequest;
use Shopware\Core\System\SalesChannel\Context\SalesChannelContextServiceInterface;
Expand All @@ -30,9 +29,6 @@ public function __construct(private readonly ProductDefinition $productDefinitio
{
}

/**
* @Since("6.4.6.1")
*/
#[Route(path: '/api/_admin/product-stream-preview/{salesChannelId}', name: 'api.admin.product-stream-preview', defaults: ['_routeScope' => ['administration']], methods: ['POST'])]
public function productStreamPreview(string $salesChannelId, Request $request, Context $context): JsonResponse
{
Expand Down
4 changes: 0 additions & 4 deletions src/Administration/Controller/AdminSearchController.php
Expand Up @@ -14,7 +14,6 @@
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\RequestCriteriaBuilder;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -32,9 +31,6 @@ public function __construct(private readonly RequestCriteriaBuilder $requestCrit
{
}

/**
* @Since("6.4.5.0")
*/
#[Route(path: '/api/_admin/search', name: 'api.admin.search', defaults: ['_routeScope' => ['administration']], methods: ['POST'])]
public function search(Request $request, Context $context): Response
{
Expand Down
4 changes: 0 additions & 4 deletions src/Administration/Controller/AdminTagController.php
Expand Up @@ -5,7 +5,6 @@
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\System\Tag\Service\FilterTagIdsService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
Expand All @@ -23,9 +22,6 @@ public function __construct(private readonly FilterTagIdsService $filterTagIdsSe
{
}

/**
* @Since("6.4.10.1")
*/
#[Route(path: '/api/_admin/tag-filter-ids', name: 'api.admin.tag-filter-ids', defaults: ['_acl' => ['tag:read'], '_entity' => 'tag'], methods: ['POST'])]
public function filterIds(Request $request, Criteria $criteria, Context $context): JsonResponse
{
Expand Down
7 changes: 0 additions & 7 deletions src/Administration/Controller/NotificationController.php
Expand Up @@ -10,7 +10,6 @@
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\RateLimiter\Exception\RateLimitExceededException;
use Shopware\Core\Framework\RateLimiter\RateLimiter;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\Framework\Uuid\Uuid;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
Expand All @@ -33,9 +32,6 @@ public function __construct(private readonly RateLimiter $rateLimiter, private r
{
}
/**
* @Since("6.4.7.0")
*/
#[Route(path: '/api/notification', name: 'api.notification', defaults: ['_acl' => ['notification:create']], methods: ['POST'])]
public function saveNotification(Request $request, Context $context): Response
{
Expand Down Expand Up @@ -81,9 +77,6 @@ public function saveNotification(Request $request, Context $context): Response
return new JsonResponse(['id' => $notificationId]);
}

/**
* @Since("6.4.7.0")
*/
#[Route(path: '/api/notification/message', name: 'api.notification.message', methods: ['GET'])]
public function fetchNotification(Request $request, Context $context): Response
{
Expand Down
7 changes: 0 additions & 7 deletions src/Administration/Controller/UserConfigController.php
Expand Up @@ -15,7 +15,6 @@
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsAnyFilter;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\Framework\Uuid\Uuid;
use Shopware\Core\System\User\Aggregate\UserConfig\UserConfigDefinition;
use Shopware\Core\System\User\Aggregate\UserConfig\UserConfigEntity;
Expand All @@ -35,9 +34,6 @@ public function __construct(private readonly EntityRepository $userConfigReposit
{
}

/**
* @Since("6.4.5.0")
*/
#[Route(path: '/api/_info/config-me', name: 'api.config_me.get', defaults: ['auth_required' => true, '_routeScope' => ['administration']], methods: ['GET'])]
public function getConfigMe(Context $context, Request $request): Response
{
Expand All @@ -51,9 +47,6 @@ public function getConfigMe(Context $context, Request $request): Response
return new JsonResponse(['data' => $data]);
}

/**
* @Since("6.4.5.0")
*/
#[Route(path: '/api/_info/config-me', name: 'api.config_me.update', defaults: ['auth_required' => true, '_routeScope' => ['administration']], methods: ['POST'])]
public function updateConfigMe(Context $context, Request $request): Response
{
Expand Down
4 changes: 0 additions & 4 deletions src/Core/Checkout/Cart/Order/Api/OrderConverterController.php
Expand Up @@ -11,7 +11,6 @@
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -27,9 +26,6 @@ public function __construct(private readonly OrderConverter $orderConverter, pri
{
}

/**
* @Since("6.0.0.0")
*/
#[Route(path: '/api/_action/order/{orderId}/convert-to-cart/', name: 'api.action.order.convert-to-cart', methods: ['POST'])]
public function convertToCart(string $orderId, Context $context): JsonResponse
{
Expand Down
22 changes: 0 additions & 22 deletions src/Core/Checkout/Cart/Order/Api/OrderRecalculationController.php
Expand Up @@ -11,7 +11,6 @@
use Shopware\Core\Checkout\Cart\SalesChannel\CartResponse;
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\Framework\Routing\Exception\InvalidRequestParameterException;
use Shopware\Core\Framework\Rule\Rule;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
Expand All @@ -31,9 +30,6 @@ public function __construct(protected RecalculationService $recalculationService
{
}

/**
* @Since("6.0.0.0")
*/
#[Route(path: '/api/_action/order/{orderId}/recalculate', name: 'api.action.order.recalculate', methods: ['POST'])]
public function recalculateOrder(string $orderId, Context $context): Response
{
Expand All @@ -42,9 +38,6 @@ public function recalculateOrder(string $orderId, Context $context): Response
return new Response(null, Response::HTTP_NO_CONTENT);
}

/**
* @Since("6.0.0.0")
*/
#[Route(path: '/api/_action/order/{orderId}/product/{productId}', name: 'api.action.order.add-product', methods: ['POST'])]
public function addProductToOrder(string $orderId, string $productId, Request $request, Context $context): Response
{
Expand All @@ -54,9 +47,6 @@ public function addProductToOrder(string $orderId, string $productId, Request $r
return new Response(null, Response::HTTP_NO_CONTENT);
}

/**
* @Since("6.0.0.0")
*/
#[Route(path: '/api/_action/order/{orderId}/creditItem', name: 'api.action.order.add-credit-item', methods: ['POST'])]
public function addCreditItemToOrder(string $orderId, Request $request, Context $context): Response
{
Expand Down Expand Up @@ -98,9 +88,6 @@ public function addCreditItemToOrder(string $orderId, Request $request, Context
return new Response(null, Response::HTTP_NO_CONTENT);
}

/**
* @Since("6.0.0.0")
*/
#[Route(path: '/api/_action/order/{orderId}/lineItem', name: 'api.action.order.add-line-item', methods: ['POST'])]
public function addCustomLineItemToOrder(string $orderId, Request $request, Context $context): Response
{
Expand All @@ -118,9 +105,6 @@ public function addCustomLineItemToOrder(string $orderId, Request $request, Cont
return new Response(null, Response::HTTP_NO_CONTENT);
}

/**
* @Since("6.4.4.0")
*/
#[Route(path: '/api/_action/order/{orderId}/promotion-item', name: 'api.action.order.add-promotion-item', methods: ['POST'])]
public function addPromotionItemToOrder(string $orderId, Request $request, Context $context): Response
{
Expand All @@ -131,9 +115,6 @@ public function addPromotionItemToOrder(string $orderId, Request $request, Conte
return new CartResponse($cart);
}

/**
* @Since("6.4.4.0")
*/
#[Route(path: '/api/_action/order/{orderId}/toggleAutomaticPromotions', name: 'api.action.order.toggle-automatic-promotions', methods: ['POST'])]
public function toggleAutomaticPromotions(string $orderId, Request $request, Context $context): Response
{
Expand All @@ -144,9 +125,6 @@ public function toggleAutomaticPromotions(string $orderId, Request $request, Con
return new CartResponse($cart);
}

/**
* @Since("6.0.0.0")
*/
#[Route(path: '/api/_action/order-address/{orderAddressId}/customer-address/{customerAddressId}', name: 'api.action.order.replace-order-address', methods: ['POST'])]
public function replaceOrderAddressWithCustomerAddress(string $orderAddressId, string $customerAddressId, Context $context): JsonResponse
{
Expand Down
7 changes: 0 additions & 7 deletions src/Core/Checkout/Cart/PriceActionController.php
Expand Up @@ -13,7 +13,6 @@
use Shopware\Core\Framework\DataAbstractionLayer\Pricing\CashRoundingConfig;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\System\Tax\TaxEntity;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
Expand All @@ -31,9 +30,6 @@ public function __construct(private readonly EntityRepository $taxRepository, pr
{
}

/**
* @Since("6.0.0.0")
*/
#[Route(path: 'api/_action/calculate-price', name: 'api.action.calculate-price', methods: ['POST'])]
public function calculate(Request $request, Context $context): JsonResponse
{
Expand Down Expand Up @@ -63,9 +59,6 @@ public function calculate(Request $request, Context $context): JsonResponse
);
}

/**
* @Since("6.4.9.0")
*/
#[Route(path: 'api/_action/calculate-prices', name: 'api.action.calculate-prices', methods: ['POST'])]
public function calculatePrices(Request $request, Context $context): JsonResponse
{
Expand Down
4 changes: 0 additions & 4 deletions src/Core/Checkout/Cart/SalesChannel/CartDeleteRoute.php
Expand Up @@ -6,7 +6,6 @@
use Shopware\Core\Checkout\Cart\Event\CartDeletedEvent;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Plugin\Exception\DecorationPatternException;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\System\SalesChannel\NoContentResponse;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -28,9 +27,6 @@ public function getDecorated(): AbstractCartDeleteRoute
throw new DecorationPatternException(self::class);
}

/**
* @Since("6.3.0.0")
*/
#[Route(path: '/store-api/checkout/cart', name: 'store-api.checkout.cart.delete', methods: ['DELETE'])]
public function delete(SalesChannelContext $context): NoContentResponse
{
Expand Down
3 changes: 0 additions & 3 deletions src/Core/Checkout/Cart/SalesChannel/CartItemAddRoute.php
Expand Up @@ -13,7 +13,6 @@
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Plugin\Exception\DecorationPatternException;
use Shopware\Core\Framework\RateLimiter\RateLimiter;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -36,8 +35,6 @@ public function getDecorated(): AbstractCartItemAddRoute
}

/**
* @Since("6.3.0.0")
*
* @param array<LineItem> $items
*/
#[Route(path: '/store-api/checkout/cart/line-item', name: 'store-api.checkout.cart.add', methods: ['POST'])]
Expand Down
4 changes: 0 additions & 4 deletions src/Core/Checkout/Cart/SalesChannel/CartItemRemoveRoute.php
Expand Up @@ -11,7 +11,6 @@
use Shopware\Core\Checkout\Cart\Event\CartChangedEvent;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Plugin\Exception\DecorationPatternException;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -33,9 +32,6 @@ public function getDecorated(): AbstractCartItemRemoveRoute
throw new DecorationPatternException(self::class);
}

/**
* @Since("6.3.0.0")
*/
#[Route(path: '/store-api/checkout/cart/line-item', name: 'store-api.checkout.cart.remove-item', methods: ['DELETE'])]
public function remove(Request $request, Cart $cart, SalesChannelContext $context): CartResponse
{
Expand Down
4 changes: 0 additions & 4 deletions src/Core/Checkout/Cart/SalesChannel/CartItemUpdateRoute.php
Expand Up @@ -10,7 +10,6 @@
use Shopware\Core\Checkout\Cart\LineItemFactoryRegistry;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Plugin\Exception\DecorationPatternException;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -32,9 +31,6 @@ public function getDecorated(): AbstractCartItemUpdateRoute
throw new DecorationPatternException(self::class);
}

/**
* @Since("6.3.0.0")
*/
#[Route(path: '/store-api/checkout/cart/line-item', name: 'store-api.checkout.cart.update-lineitem', methods: ['PATCH'])]
public function change(Request $request, Cart $cart, SalesChannelContext $context): CartResponse
{
Expand Down
4 changes: 0 additions & 4 deletions src/Core/Checkout/Cart/SalesChannel/CartLoadRoute.php
Expand Up @@ -10,7 +10,6 @@
use Shopware\Core\Checkout\Cart\TaxProvider\TaxProviderProcessor;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Plugin\Exception\DecorationPatternException;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -36,9 +35,6 @@ public function getDecorated(): AbstractCartLoadRoute
throw new DecorationPatternException(self::class);
}

/**
* @Since("6.3.0.0")
*/
#[Route(path: '/store-api/checkout/cart', name: 'store-api.checkout.cart.read', methods: ['GET', 'POST'])]
public function load(Request $request, SalesChannelContext $context): CartResponse
{
Expand Down
4 changes: 0 additions & 4 deletions src/Core/Checkout/Cart/SalesChannel/CartOrderRoute.php
Expand Up @@ -18,7 +18,6 @@
use Shopware\Core\Framework\DataAbstractionLayer\Search\Sorting\FieldSorting;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Plugin\Exception\DecorationPatternException;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\Framework\Validation\DataBag\DataBag;
use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
use Shopware\Core\Profiling\Profiler;
Expand All @@ -42,9 +41,6 @@ public function getDecorated(): AbstractCartOrderRoute
throw new DecorationPatternException(self::class);
}

/**
* @Since("6.3.0.0")
*/
#[Route(path: '/store-api/checkout/order', name: 'store-api.checkout.cart.order', methods: ['POST'], defaults: ['_loginRequired' => true, '_loginRequiredAllowGuest' => true])]
public function order(Cart $cart, SalesChannelContext $context, RequestDataBag $data): CartOrderRouteResponse
{
Expand Down
Expand Up @@ -10,7 +10,6 @@
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Core\System\SalesChannel\Context\SalesChannelContextRestorer;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -30,8 +29,6 @@ public function __construct(private readonly EntityRepository $customerRepositor

/**
* @throws Exception
*
* @Since("6.3.1.0")
*/
#[Route(path: '/api/_action/customer-group-registration/accept', name: 'api.customer-group.accept', methods: ['POST'], requirements: ['version' => '\d+'])]
public function accept(Request $request, Context $context): JsonResponse
Expand Down Expand Up @@ -80,8 +77,6 @@ public function accept(Request $request, Context $context): JsonResponse

/**
* @throws Exception
*
* @Since("6.3.1.0")
*/
#[Route(path: '/api/_action/customer-group-registration/decline', name: 'api.customer-group.decline', methods: ['POST'], requirements: ['version' => '\d+'])]
public function decline(Request $request, Context $context): JsonResponse
Expand Down

0 comments on commit a0b83bd

Please sign in to comment.