PHP Classes

File: tests/classes/Acme/Providers/ExampleProvider.php

Recommend this page to a friend!
  Classes of Emmanuel Antico  >  Injector  >  tests/classes/Acme/Providers/ExampleProvider.php  >  Download  
File: tests/classes/Acme/Providers/ExampleProvider.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: Injector
Inject dependencies defined in annotation comments
Author: By
Last change:
Date: 8 years ago
Size: 469 bytes
 

Contents

Class file image Download
<?php
namespace Acme\Providers;

use
Pimple\ServiceProviderInterface;
use
Pimple\Container;
use
Acme\Services\MySQLConnection;
use
Acme\Services\Logger;

class
ExampleProvider implements ServiceProviderInterface {
    public function
register(Container $pimple) {
       
$pimple['conn'] = function ($c) {
            return new
MySQLConnection('usr', 'psw');
        };
       
       
$pimple['logger'] = function ($c) {
            return new
Logger();
        };
       
       
$pimple['environment'] = 'development';
    }
}
?>