PHP Classes

File: tests/classes/Acme/Components/ExampleComponent.php

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

Contents

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

/**
 * @inject.provider Acme\Providers\ExampleProvider
 */
class ExampleComponent {
    private
$name;
    private
$env;
   
   
/**
     * @inject.service logger
     */
   
private $logger;
   
   
/**
     * @inject.service conn
     */
   
private $connection;
   
   
/**
     * @inject.param $env environment
     */
   
public function __construct($name, $env) {
       
$this->name = $name;
       
$this->env = $env;
    }
   
    public function
getName() {
        return
$this->name;
    }
   
    public function
getEnvironment() {
        return
$this->env;
    }
   
    public function
getLogger() {
        return
$this->logger;
    }
   
    public function
getConnection() {
        return
$this->connection;
    }
}
?>