Skip to content

Commit b916368

Browse files
committed
Current status
1 parent 25923b9 commit b916368

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public function __construct(private readonly BookmarkService $bookmarkService, p
2020
}
2121

2222
public function __invoke(
23+
OutputInterface $output,
2324
#[Argument(description: 'Location id')] int $locationId,
24-
#[Option(shortcut: 'd', description: 'Delete the created bookmark?')] bool $delete,
25-
OutputInterface $output
25+
#[Option(shortcut: 'd', description: 'Delete the created bookmark?')] bool $delete = false
2626
): int {
2727
$location = $this->locationService->loadLocation($locationId);
2828

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public function __construct(
2828
}
2929

3030
public function __invoke(
31+
OutputInterface $output,
3132
#[Argument(description: 'Parent Location ID')] int $parentLocationId,
3233
#[Argument(description: 'Identifier of a content type with a Name and Description Field')] string $contentType,
3334
#[Argument(description: 'Content for the Name field')] string $name,
34-
#[Option(shortcut: 'p', description: 'Do you want to publish the content item?')] bool $publish,
35-
OutputInterface $output
35+
#[Option(shortcut: 'p', description: 'Do you want to publish the content item?')] bool $publish = true
3636
): int {
3737
$user = $this->userService->loadUserByLogin('admin');
3838
$this->permissionResolver->setCurrentUserReference($user);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ public function __construct(
2525
}
2626

2727
public function __invoke(
28+
OutputInterface $output,
2829
#[Argument(description: 'Content type identifier')] string $identifier,
2930
#[Argument(description: 'Content type group identifier')] string $group_identifier,
3031
#[Argument(description: 'Identifier of the CT copy')] ?string $copy_identifier,
31-
#[Option(shortcut: 'c', description: 'Do you want to make a copy of the content type?')] bool $copy,
32-
OutputInterface $output
32+
#[Option(shortcut: 'c', description: 'Do you want to make a copy of the content type?')] bool $copy = false
3333
): int {
3434
$user = $this->userService->loadUserByLogin('admin');
3535
$this->permissionResolver->setCurrentUserReference($user);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ public function __construct(
2929
}
3030

3131
public function __invoke(
32+
OutputInterface $output,
3233
#[Argument(description: 'Content for the Name field')] string $name,
3334
#[Argument(description: 'Content for the Image field')] string $file,
34-
#[Option(shortcut: 'p', description: 'Do you want to publish the content item?')] bool $publish,
35-
OutputInterface $output
35+
#[Option(shortcut: 'p', description: 'Do you want to publish the content item?')] bool $publish = true
3636
): int {
3737
$user = $this->userService->loadUserByLogin('admin');
3838
$this->permissionResolver->setCurrentUserReference($user);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public function __construct(
2626
}
2727

2828
public function __invoke(
29+
OutputInterface $output,
2930
#[Argument(description: 'Location to trash')] int $locationId,
3031
#[Argument(description: 'New Location to restore under')] ?int $newParentId,
31-
#[Option(shortcut: 'r', description: 'Do you want to restore the content item?')] bool $restore,
32-
OutputInterface $output
32+
#[Option(shortcut: 'r', description: 'Do you want to restore the content item?')] bool $restore = false
3333
): int {
3434
$user = $this->userService->loadUserByLogin('admin');
3535
$this->permissionResolver->setCurrentUserReference($user);

code_samples/front/render_content_in_php/src/Command/ViewCommand.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@ public function __construct(private readonly ContentViewBuilder $contentViewBuil
1919
}
2020

2121
public function __invoke(
22-
#[Option] int $content_id,
23-
#[Option] int $location_id,
24-
#[Option] string $view_type,
25-
OutputInterface $output
22+
OutputInterface $output,
23+
#[Option(name: 'content_id')] int $contentId = 52,
24+
#[Option(name: 'location_id')] int $locationId = 2,
25+
#[Option(name: 'view_type')] string $viewType = 'embed'
2626
): int {
27-
$contentId = $content_id;
28-
$locationId = $location_id;
2927
if (empty($contentId) && empty($locationId)) {
3028
throw new \InvalidArgumentException('No Content ID nor Location ID given');
3129
}
3230

3331
$viewParameters = [
34-
'viewType' => $view_type,
32+
'viewType' => $viewType,
3533
'_controller' => 'ibexa_content:viewAction',
3634
];
3735

0 commit comments

Comments
 (0)