Skip to content

Commit f4f74f9

Browse files
committed
fixup! Commands
1 parent dd0670a commit f4f74f9

21 files changed

+118
-20
lines changed

code_samples/api/commerce/src/Command/PaymentCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7171
$paymentIdentifier = '4ac4b8a0-eed8-496d-87d9-32a960a10629';
7272
$payment = $this->paymentService->getPaymentByIdentifier($paymentIdentifier);
7373

74+
$context = $payment->getContext();
75+
7476
$output->writeln(sprintf('Your payment for transaction has status %s', $payment->getStatus()));
7577

7678
// Query for payments

code_samples/api/commerce/src/Command/PaymentMethodCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ public function __construct(
3535
UserService $userService,
3636
PaymentMethodServiceInterface $paymentMethodService
3737
) {
38-
parent::__construct();
3938
$this->paymentMethodService = $paymentMethodService;
4039
$this->permissionResolver = $permissionResolver;
4140
$this->userService = $userService;
41+
42+
parent::__construct();
4243
}
4344

4445
protected function execute(InputInterface $input, OutputInterface $output): int

code_samples/api/product_catalog/src/Command/ProductPriceCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616
use Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\LogicalOr;
1717
use Ibexa\Contracts\ProductCatalog\Values\Price\Query\Criterion\Product;
1818
use Money;
19+
use Symfony\Component\Console\Attribute\AsCommand;
1920
use Symfony\Component\Console\Command\Command;
2021
use Symfony\Component\Console\Input\InputArgument;
2122
use Symfony\Component\Console\Input\InputInterface;
2223
use Symfony\Component\Console\Output\OutputInterface;
2324

25+
#[AsCommand(
26+
name: 'doc:price'
27+
)]
2428
final class ProductPriceCommand extends Command
2529
{
2630
private ProductPriceServiceInterface $productPriceService;
@@ -50,7 +54,7 @@ public function __construct(
5054
$this->userService = $userService;
5155
$this->permissionResolver = $permissionResolver;
5256

53-
parent::__construct('doc:price');
57+
parent::__construct();
5458
}
5559

5660
public function configure(): void

code_samples/api/product_catalog/src/Command/ProductTypeCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
use Ibexa\Contracts\Core\Repository\PermissionResolver;
66
use Ibexa\Contracts\Core\Repository\UserService;
77
use Ibexa\Contracts\ProductCatalog\ProductTypeServiceInterface;
8+
use Symfony\Component\Console\Attribute\AsCommand;
89
use Symfony\Component\Console\Command\Command;
910
use Symfony\Component\Console\Input\InputArgument;
1011
use Symfony\Component\Console\Input\InputInterface;
1112
use Symfony\Component\Console\Output\OutputInterface;
1213

14+
#[AsCommand(
15+
name: 'doc:product_type'
16+
)]
1317
final class ProductTypeCommand extends Command
1418
{
1519
private UserService $userService;
@@ -23,7 +27,8 @@ public function __construct(UserService $userService, PermissionResolver $permis
2327
$this->userService = $userService;
2428
$this->permissionResolver = $permissionResolver;
2529
$this->productTypeService = $productTypeService;
26-
parent::__construct('doc:product_type');
30+
31+
parent::__construct();
2732
}
2833

2934
public function configure(): void

code_samples/api/product_catalog/src/Command/ProductVariantCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
use Ibexa\Contracts\ProductCatalog\Local\Values\Product\ProductVariantCreateStruct;
1111
use Ibexa\Contracts\ProductCatalog\ProductServiceInterface;
1212
use Ibexa\Contracts\ProductCatalog\Values\Product\ProductVariantQuery;
13+
use Symfony\Component\Console\Attribute\AsCommand;
1314
use Symfony\Component\Console\Command\Command;
1415
use Symfony\Component\Console\Input\InputArgument;
1516
use Symfony\Component\Console\Input\InputInterface;
1617
use Symfony\Component\Console\Output\OutputInterface;
1718

19+
#[AsCommand(
20+
name: 'doc:product_variant'
21+
)]
1822
final class ProductVariantCommand extends Command
1923
{
2024
private UserService $userService;
@@ -35,7 +39,8 @@ public function __construct(
3539
$this->permissionResolver = $permissionResolver;
3640
$this->productService = $productService;
3741
$this->localProductService = $localProductService;
38-
parent::__construct('doc:product_variant');
42+
43+
parent::__construct();
3944
}
4045

4146
public function configure(): void

code_samples/api/product_catalog/src/Command/VatCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
use Ibexa\Contracts\Core\Repository\UserService;
77
use Ibexa\Contracts\ProductCatalog\RegionServiceInterface;
88
use Ibexa\Contracts\ProductCatalog\VatServiceInterface;
9+
use Symfony\Component\Console\Attribute\AsCommand;
910
use Symfony\Component\Console\Command\Command;
1011
use Symfony\Component\Console\Input\InputArgument;
1112
use Symfony\Component\Console\Input\InputInterface;
1213
use Symfony\Component\Console\Output\OutputInterface;
1314

15+
#[AsCommand(
16+
name: 'doc:vat'
17+
)]
1418
final class VatCommand extends Command
1519
{
1620
private UserService $userService;
@@ -31,7 +35,8 @@ public function __construct(
3135
$this->permissionResolver = $permissionResolver;
3236
$this->vatService = $vatService;
3337
$this->regionService = $regionService;
34-
parent::__construct('doc:vat');
38+
39+
parent::__construct();
3540
}
3641

3742
public function configure(): void

code_samples/api/public_php_api/src/Command/AddLanguageCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
use Symfony\Component\Console\Command\Command;
99
use Symfony\Component\Console\Input\InputInterface;
1010
use Symfony\Component\Console\Output\OutputInterface;
11+
use Symfony\Component\Console\Attribute\AsCommand;
1112

13+
#[AsCommand(
14+
name: 'doc:add_language'
15+
)]
1216
class AddLanguageCommand extends Command
1317
{
1418
private LanguageService $languageService;
@@ -22,7 +26,8 @@ public function __construct(LanguageService $languageService, UserService $userS
2226
$this->languageService = $languageService;
2327
$this->userService = $userService;
2428
$this->permissionResolver = $permissionResolver;
25-
parent::__construct('doc:add_language');
29+
30+
parent::__construct();
2631
}
2732

2833
protected function configure(): void

code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
use Symfony\Component\Console\Input\InputArgument;
1111
use Symfony\Component\Console\Input\InputInterface;
1212
use Symfony\Component\Console\Output\OutputInterface;
13+
use Symfony\Component\Console\Attribute\AsCommand;
1314

15+
#[AsCommand(
16+
name: 'doc:add_location'
17+
)]
1418
class AddLocationToContentCommand extends Command
1519
{
1620
private ContentService $contentService;
@@ -27,7 +31,8 @@ public function __construct(ContentService $contentService, LocationService $loc
2731
$this->locationService = $locationService;
2832
$this->userService = $userService;
2933
$this->permissionResolver = $permissionResolver;
30-
parent::__construct('doc:add_location');
34+
35+
parent::__construct();
3136
}
3237

3338
protected function configure(): void

code_samples/api/public_php_api/src/Command/BookmarkCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
use Symfony\Component\Console\Input\InputInterface;
1010
use Symfony\Component\Console\Input\InputOption;
1111
use Symfony\Component\Console\Output\OutputInterface;
12+
use Symfony\Component\Console\Attribute\AsCommand;
1213

14+
#[AsCommand(
15+
name: 'doc:bookmark'
16+
)]
1317
class BookmarkCommand extends Command
1418
{
1519
private BookmarkService $bookmarkService;
@@ -20,7 +24,8 @@ public function __construct(BookmarkService $bookmarkService, LocationService $l
2024
{
2125
$this->bookmarkService = $bookmarkService;
2226
$this->locationService = $locationService;
23-
parent::__construct('doc:bookmark');
27+
28+
parent::__construct();
2429
}
2530

2631
protected function configure(): void

code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@
88
use Symfony\Component\Console\Input\InputArgument;
99
use Symfony\Component\Console\Input\InputInterface;
1010
use Symfony\Component\Console\Output\OutputInterface;
11+
use Symfony\Component\Console\Attribute\AsCommand;
1112

13+
#[AsCommand(
14+
name: 'doc:browse_locations'
15+
)]
1216
class BrowseLocationsCommand extends Command
1317
{
1418
private LocationService $locationService;
1519

1620
public function __construct(LocationService $locationService)
1721
{
1822
$this->locationService = $locationService;
19-
parent::__construct('doc:browse_locations');
23+
24+
parent::__construct();
2025
}
2126

2227
protected function configure(): void

0 commit comments

Comments
 (0)