1
0
Fork 0

fix indentation

This commit is contained in:
Jonathan Treffler 2024-04-05 20:30:30 +02:00
parent 104d278c06
commit d09254523f
5 changed files with 31 additions and 31 deletions

View file

@ -21,10 +21,10 @@ class Application extends App implements IBootstrap {
parent::__construct(self::APP_ID); parent::__construct(self::APP_ID);
} }
public function register(IRegistrationContext $context): void { public function register(IRegistrationContext $context): void {
$context->registerEventListener(SabrePluginAddEvent::class, SabrePluginAddListener::class); $context->registerEventListener(SabrePluginAddEvent::class, SabrePluginAddListener::class);
} }
public function boot(IBootContext $context): void { public function boot(IBootContext $context): void {
} }
} }

View file

@ -17,9 +17,9 @@ class SabrePluginAddListener implements IEventListener {
public function handle(Event $event): void { public function handle(Event $event): void {
if ($event instanceof SabrePluginAddEvent) { if ($event instanceof SabrePluginAddEvent) {
$serviceDetectionPlugin = $this->container->get(ServiceDetectionPlugin::class); $serviceDetectionPlugin = $this->container->get(ServiceDetectionPlugin::class);
$event->getServer()->addPlugin($serviceDetectionPlugin); $event->getServer()->addPlugin($serviceDetectionPlugin);
} }
} }
} }

View file

@ -7,5 +7,5 @@ namespace OCA\DavPush\PushTransports;
use OCA\DavPush\Transport\Transport; use OCA\DavPush\Transport\Transport;
class WebPushTransport extends Transport { class WebPushTransport extends Transport {
protected $id = "web-push"; protected $id = "web-push";
} }

View file

@ -5,13 +5,13 @@ declare(strict_types=1);
namespace OCA\DavPush\Transport; namespace OCA\DavPush\Transport;
abstract class Transport { abstract class Transport {
protected $id; protected $id;
public function getId() { public function getId() {
return $this->id; return $this->id;
} }
public function getAdditionalInformation() { public function getAdditionalInformation() {
return []; return [];
} }
} }

View file

@ -10,28 +10,28 @@ use OCA\DavPush\Event\RegisterTransportsEvent;
use OCA\DavPush\PushTransports\WebPushTransport; use OCA\DavPush\PushTransports\WebPushTransport;
class TransportManager { class TransportManager {
/** /**
* @var Transport[] * @var Transport[]
*/ */
private array $transports = []; private array $transports = [];
public function __construct(IEventDispatcher $dispatcher) { public function __construct(IEventDispatcher $dispatcher) {
// register integrated transports // register integrated transports
$this->registerTransport(new WebPushTransport()); $this->registerTransport(new WebPushTransport());
// register transports provided by other apps // register transports provided by other apps
$event = new RegisterTransportsEvent($this); $event = new RegisterTransportsEvent($this);
$dispatcher->dispatchTyped($event); $dispatcher->dispatchTyped($event);
} }
/** /**
* @return Transport[] * @return Transport[]
*/ */
public function getTransports(): array { public function getTransports(): array {
return $this->transports; return $this->transports;
} }
public function registerTransport(Transport $transport): self { public function registerTransport(Transport $transport): self {
$this->transports[] = $transport; $this->transports[] = $transport;
return $this; return $this;
} }