PHP code example of savinmikhail / add_named_arguments_rector

1. Go to this page and download the library: Download savinmikhail/add_named_arguments_rector 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/ */

    

savinmikhail / add_named_arguments_rector example snippets




declare(strict_types=1);

use Rector\Config\RectorConfig;
use SavinMikhail\AddNamedArgumentsRector\AddNamedArgumentsRector;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->rule(AddNamedArgumentsRector::class);
};



declare(strict_types=1);

use Rector\Config\RectorConfig;
use SavinMikhail\AddNamedArgumentsRector\AddNamedArgumentsRector;
use SavinMikhail\AddNamedArgumentsRector\Config\PhpyhStrategy;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->ruleWithConfiguration(
        AddNamedArgumentsRector::class,
        [PhpyhStrategy::class]
    );
};



declare(strict_types=1);

namespace YourNamespace;

use PhpParser\Node;
use SavinMikhail\AddNamedArgumentsRector\Config\ConfigStrategy;

class CustomStrategy implements ConfigStrategy
{
    public static function shouldApply(Node $node, array $parameters): bool
    {
        // Add your custom logic here
        return true;
    }
}



declare(strict_types=1);

use Rector\Config\RectorConfig;
use SavinMikhail\AddNamedArgumentsRector\AddNamedArgumentsRector;
use YourNamespace\CustomStrategy;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->ruleWithConfiguration(
        AddNamedArgumentsRector::class,
        [CustomStrategy::class]
    );
};