Skip to content

Commit

Permalink
Merge pull request #6245 from ci-wataru-kashii/fix/deprecate_required…
Browse files Browse the repository at this point in the history
…_annotation_Symfony64

【Symfony6.3より非推奨になったエラー】@required アノテーションの修正
  • Loading branch information
ji-eunsoo authored Aug 14, 2024
2 parents 5de0c7f + f603160 commit ecdda58
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/Eccube/Command/PluginCommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
use Symfony\Contracts\Service\Attribute\Required;

trait PluginCommandTrait
{
Expand All @@ -33,17 +34,17 @@ trait PluginCommandTrait

/**
* @param PluginService $pluginService
* @required
*/
#[Required]
public function setPluginService(PluginService $pluginService)
{
$this->pluginService = $pluginService;
}

/**
* @param PluginRepository $pluginRepository
* @required
*/
#[Required]
public function setPluginRepository(PluginRepository $pluginRepository)
{
$this->pluginRepository = $pluginRepository;
Expand Down
15 changes: 8 additions & 7 deletions src/Eccube/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Contracts\Service\Attribute\Required;
use Symfony\Contracts\Translation\TranslatorInterface;

class AbstractController extends Controller
Expand Down Expand Up @@ -65,53 +66,53 @@ class AbstractController extends Controller

/**
* @param EccubeConfig $eccubeConfig
* @required
*/
#[Required]
public function setEccubeConfig(EccubeConfig $eccubeConfig)
{
$this->eccubeConfig = $eccubeConfig;
}

/**
* @param EntityManagerInterface $entityManager
* @required
*/
#[Required]
public function setEntityManager(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
}

/**
* @param TranslatorInterface $translator
* @required
*/
#[Required]
public function setTranslator(TranslatorInterface $translator)
{
$this->translator = $translator;
}

/**
* @param Session $session
* @required
*/
#[Required]
public function setSession(Session $session)
{
$this->session = $session;
}

/**
* @param FormFactoryInterface $formFactory
* @required
*/
#[Required]
public function setFormFactory(FormFactoryInterface $formFactory)
{
$this->formFactory = $formFactory;
}

/**
* @param EventDispatcherInterface $eventDispatcher
* @required
*/
#[Required]
public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)
{
$this->eventDispatcher = $eventDispatcher;
Expand All @@ -120,8 +121,8 @@ public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)
/**
* @param RouterInterface $router
* @return void
* @required
*/
#[Required]
public function setRouter(RouterInterface $router)
{
$this->router = $router;
Expand Down
3 changes: 2 additions & 1 deletion src/Eccube/Controller/AbstractShoppingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Eccube\Service\PurchaseFlow\PurchaseFlow;
use Eccube\Service\PurchaseFlow\PurchaseFlowResult;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Contracts\Service\Attribute\Required;

class AbstractShoppingController extends AbstractController
{
Expand All @@ -28,8 +29,8 @@ class AbstractShoppingController extends AbstractController

/**
* @param PurchaseFlow $shoppingPurchaseFlow
* @required
*/
#[Required]
public function setPurchaseFlow(PurchaseFlow $shoppingPurchaseFlow)
{
$this->purchaseFlow = $shoppingPurchaseFlow;
Expand Down

0 comments on commit ecdda58

Please sign in to comment.