PHP code example of hco / auto-wiring-bundle

1. Go to this page and download the library: Download hco/auto-wiring-bundle 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/ */

    

hco / auto-wiring-bundle example snippets


class ServiceWithDependency
{
    public $stdObject;

    public function __construct(StdClass $stdObject)
    {
        $this->stdObject = $stdObject;
    }
}

use HCO\AutoWiringBundle\Annotation\RequireQualifier;

class ServiceWithDependency
{
    public $stdObject;

    /**
     * @RequireQualifier(param="stdObject", qualifier="readonly")
     */
    public function __construct(StdClass $stdObject)
    {
        $this->stdObject = $stdObject;
    }
}