PHP code example of symplify / auto-bind-parameter

1. Go to this page and download the library: Download symplify/auto-bind-parameter 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/ */

    

symplify / auto-bind-parameter example snippets


 declare(strict_types=1);

namespace App;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
use Symplify\AutoBindParameter\DependencyInjection\CompilerPass\AutoBindParameterCompilerPass;

class AppKernel extends Kernel
{
    protected function build(ContainerBuilder $containerBuilder): void
    {
        $containerBuilder->addCompilerPass(new AutoBindParameterCompilerPass());
    }
}

 declare(strict_types=1);

class SomeClass
{
    /**
     * @var string
     */
    private $entityRepositoryClass;

    public function __construct(string $entityRepositoryClass)
    {
        $this->entityRepositoryClass = $entityRepositoryClass;
    }
}