PHP Classes

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

Recommend this page to a friend!
  Classes of Emmanuel Antico   Injector   tests/classes/Acme/Components/TestComponentJ.php   Download  
File: tests/classes/Acme/Components/TestComponentJ.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: 9 years ago
Size: 542 bytes
 

Contents

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

use
Acme\Services\HTTPService;

/**
 * @inject.provider Acme\Providers\AllServiceProvider
 */
class TestComponentJ {
    public
$name;
   
    public
$id;
   
   
/**
     * @inject.service mail
     */
   
private $mail;
   
    protected
$http;
   
   
/**
     * @inject.param $http http
     */
   
public function __construct($name, HTTPService $http, $id = 1) {
       
$this->name = $name;
       
$this->http = $http;
       
$this->id = $id;
    }
   
    public function
getMail() {
        return
$this->mail;
    }
   
    public function
getHttp() {
        return
$this->http;
    }
}