Skip to content

Commit 2fdc531

Browse files
committed
Use PHP attributes
1 parent be54290 commit 2fdc531

3 files changed

Lines changed: 5 additions & 14 deletions

File tree

Classes/Command/UpdateMetadataCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
namespace Ayacoo\AyacooSoundcloud\Command;
66

77
use Ayacoo\AyacooSoundcloud\Service\UpdateMetadataService;
8+
use Symfony\Component\Console\Attribute\AsCommand;
89
use Symfony\Component\Console\Command\Command;
910
use Symfony\Component\Console\Input\InputInterface;
1011
use Symfony\Component\Console\Input\InputOption;
1112
use Symfony\Component\Console\Output\OutputInterface;
1213
use Symfony\Component\Console\Style\SymfonyStyle;
1314

15+
#[AsCommand('soundcloud:updateMetadata', 'Updates the Soundcloud metadata')]
1416
class UpdateMetadataCommand extends Command
1517
{
1618
protected function configure(): void

Classes/EventListener/ModifyIconForResourcePropertiesListener.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Ayacoo\AyacooSoundcloud\EventListener;
66

7+
use TYPO3\CMS\Core\Attribute\AsEventListener;
78
use TYPO3\CMS\Core\Imaging\Event\ModifyIconForResourcePropertiesEvent;
89
use TYPO3\CMS\Core\Resource\File;
910

@@ -12,6 +13,7 @@
1213
*/
1314
final class ModifyIconForResourcePropertiesListener
1415
{
16+
#[AsEventListener]
1517
public function __invoke(ModifyIconForResourcePropertiesEvent $event): void
1618
{
1719
$resource = $event->getResource();

Configuration/Services.yaml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,4 @@ services:
88
resource: '../Classes/*'
99
exclude:
1010
- '../Classes/Domain/Model/*'
11-
- '../Classes/Helper/*'
12-
13-
Ayacoo\AyacooSoundcloud\Command\UpdateMetadataCommand:
14-
tags:
15-
- name: 'console.command'
16-
command: 'soundcloud:updateMetadata'
17-
description: 'Updates the Soundcloud metadata'
18-
schedulable: true
19-
20-
Ayacoo\AyacooSoundcloud\EventListener\ModifyIconForResourcePropertiesListener:
21-
tags:
22-
- name: 'event.listener'
23-
identifier: 'ayacoo-soundcloud/modify-icon-for-resource'
24-
event: 'TYPO3\CMS\Core\Imaging\Event\ModifyIconForResourcePropertiesEvent'
11+
- '../Classes/Helper/*'

0 commit comments

Comments
 (0)