PHP code example of pine3ree / pine3ree-params-resolver

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

    

pine3ree / pine3ree-params-resolver example snippets


// API (pseudo-code)

use My\Container;
use pine3ree\Container\ParamsResolver;

$params = new ParamsResolver($container);
$params->resolve($callable, array $resolvedParams);

// For a constructor the $callable argument would be:
$callable = [My\Class::class, '__construct'];

// or in general for any method:
$callable = [string $fqcn, string $methodName];




use My\DataMapper;
use My\Db;
use My\Hydrator;
use pine3ree\Container\ParamsResolver;

class MyDataMapper
{
    private Db $db;
    private Hydrator $hydrator;
    private array $config;
    private array $options;

    public function__construct(
        Db $db,
        Hydrator $hydrator, 
        array $config,
        array $options = []
    ) {
        $this->db       = $db;
        $this->hydrator = $hydrator;
        $this->config   = $config;
        $this->options  = $options;
    }

    //... Rest of data-mapper code here
}

//...
//