public function checkPackageUpdates(PackageEvent $event)
    {
        $operation = $event->getOperation();
        if ($operation instanceof UpdateOperation) {
            $this->_packageUpdates[$operation->getInitialPackage()->getName()] = [
                'from' => $operation->getInitialPackage()->getVersion(),
                'fromPretty' => $operation->getInitialPackage()->getPrettyVersion(),
                'to' => $operation->getTargetPackage()->getVersion(),
                'toPretty' => $operation->getTargetPackage()->getPrettyVersion(),
                'direction' => $event->getPolicy()->versionCompare(
                    $operation->getInitialPackage(),
                    $operation->getTargetPackage(),
                    '<'
                ) ? 'up' : 'down',
            ];
        }
    }
public function checkPackageUpdates(PackageEvent $event)
    {
        $operation = $event->getOperation();
        if ($operation instanceof UpdateOperation) {
            $this->_packageUpdates[$operation->getInitialPackage()->getName()] = [
                'from' => $operation->getInitialPackage()->getVersion(),
                'fromPretty' => $operation->getInitialPackage()->getPrettyVersion(),
                'to' => $operation->getTargetPackage()->getVersion(),
                'toPretty' => $operation->getTargetPackage()->getPrettyVersion(),
                'direction' => $event->getPolicy()->versionCompare(
                    $operation->getInitialPackage(),
                    $operation->getTargetPackage(),
                    '<'
                ) ? 'up' : 'down',
            ];
        }
    }
public function checkPackageUpdates ( PackageEvent $ event ) { $ operation = $ event -> getOperation ( ) ; if ( $ operation instanceof UpdateOperation ) { $ this -> _packageUpdates [ $ operation -> getInitialPackage ( ) -> getName ( ) ] = [ 'from' => $ operation -> getInitialPackage ( ) -> getVersion ( ) , 'fromPretty' => $ operation -> getInitialPackage ( ) -> getPrettyVersion ( ) , 'to' => $ operation -> getTargetPackage ( ) -> getVersion ( ) , 'toPretty' => $ operation -> getTargetPackage ( ) -> getPrettyVersion ( ) , 'direction' => $ event -> getPolicy ( ) -> versionCompare ( $ operation -> getInitialPackage ( ) , $ operation -> getTargetPackage ( ) , '<' ) ? 'up' : 'down' , ] ; } }
Listen to POST_PACKAGE_UPDATE event and take note of the package updates.
@param PackageEvent $event
Listen to POST_PACKAGE_UPDATE event and take note of the package updates .