Skip to content

Events

PostUpdateCheckEvent

Reference

This event is being dispatched once the update check process is complete. It provides the complete UpdateCheckResult object and allows further handling of outdated packages.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

declare(strict_types=1);

namespace My\Vendor;

use Composer\EventDispatcher\EventSubscriberInterface;
use Composer\Plugin\PluginInterface;
use EliasHaeussler\ComposerUpdateCheck\Event\PostUpdateCheckEvent;

class Plugin implements PluginInterface, EventSubscriberInterface
{
    // ...

    public static function getSubscribedEvents(): array
    {
        return [
            PostUpdateCheckEvent::NAME => [
                ['onPostUpdateCheck']
            ],
        ];
    }

    public function onPostUpdateCheck(PostUpdateCheckEvent $event): void
    {
        $updateCheckResult = $event->getUpdateCheckResult();

        // ...
    }
}