PHP code example of wizcodepl / outdated-packages-health-check

1. Go to this page and download the library: Download wizcodepl/outdated-packages-health-check library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wizcodepl / outdated-packages-health-check example snippets


use Spatie\Health\Facades\Health;
use WizcodePl\OutdatedPackagesHealthCheck\OutdatedPackagesCheck;

Health::checks([
    OutdatedPackagesCheck::new()
        ->direct()
        ->

// Alert only on major bumps (1.x.x → 2.0.0). Patch and minor still appear in `meta`,
// but they don't drive the check status.
OutdatedPackagesCheck::new()->onlyMajor();

// Alert on minor and major (e.g. 1.2.x → 1.3.0 or 2.0.0).
OutdatedPackagesCheck::new()->minorAndAbove();

// Or pick the exact set yourself:
OutdatedPackagesCheck::new()->alertOnLevels([
    OutdatedPackagesCheck::LEVEL_MAJOR,
    OutdatedPackagesCheck::LEVEL_MINOR,
]);

[
    'outdated_total' => 7,
    'outdated_by_level' => ['major' => 1, 'minor' => 2, 'patch' => 4, 'unknown' => 0],
    'alert_levels' => ['major', 'unknown'],
    'alerting_packages' => [
        ['name' => 'vendor/x', 'version' => '1.2.3', 'latest' => '2.0.0', 'level' => 'major'],
    ],
]