PHP Classes

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

Recommend this page to a friend!
  Classes of Emmanuel Antico  >  Injector  >  tests/classes/Acme/Providers/AllServiceProvider.php  >  Download  
File: tests/classes/Acme/Providers/AllServiceProvider.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: 415 bytes
 

Contents

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

use
Pimple\ServiceProviderInterface;
use
Pimple\Container;
use
Acme\Services\MailService;
use
Acme\Services\HTTPService;

class
AllServiceProvider implements ServiceProviderInterface {
    public function
register(Container $pimple) {
       
$pimple['mail'] = function ($c) {
            return new
MailService();
        };
       
       
$pimple['http'] = function ($c) {
            return new
HTTPService();
        };
    }
}
?>