Skip to content

Instantly share code, notes, and snippets.

@shin1x1
Created February 16, 2014 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shin1x1/9028821 to your computer and use it in GitHub Desktop.
Save shin1x1/9028821 to your computer and use it in GitHub Desktop.
<?php
require __DIR__.'/vendor/autoload.php';
class Hello
{
/**
*
*/
public function greet()
{
echo 'Hello';
}
}
class Bar
{
/**
* @var Greetable
*/
protected $greeter;
/**
* @param Hello $greeter
*/
public function __construct(Hello $greeter)
{
$this->greeter = $greeter;
}
/**
*
*/
public function say()
{
$this->greeter->greet();
echo PHP_EOL;
}
}
$app = new \Illuminate\Foundation\Application();
$app->make('Bar')->say();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment