PHP code example of unloc / composer-compatibility-enforcer

1. Go to this page and download the library: Download unloc/composer-compatibility-enforcer 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/ */

    

unloc / composer-compatibility-enforcer example snippets




add_filter('composer_compatibility_enforcer_rules', static function (array $rules): array {
    $rules[] = [
        'plugin_file' => 'google-listings-and-ads/google-listings-and-ads.php',
        'namespaces'  => ['Psr\\Log\\', 'Monolog\\'],
    ];

    return $rules;
});

$rules[] = [
    'plugin_file' => 'google-listings-and-ads/google-listings-and-ads.php',
    'namespaces' => ['Psr\\Log\\', 'Monolog\\'],
];

$rules[] = [
    'plugin_file' => 'boekuwzending-for-woocommerce/boekuwzending-for-woocommerce.php',
    'namespaces'  => ['Psr\\Log\\'],
];