Skip to content

Instantly share code, notes, and snippets.

@piwi91
Last active September 22, 2015 12:04
Show Gist options
  • Save piwi91/bca76aa41ee0c7e1c1a0 to your computer and use it in GitHub Desktop.
Save piwi91/bca76aa41ee0c7e1c1a0 to your computer and use it in GitHub Desktop.
<?php
interface WebserviceInterface
{
public function getFoo();
}
class Webservice implements WebserviceInterface
{
public function getFoo()
{
return 'bar';
}
}
class WebserviceImplementation
{
public function __construct(WebserviceInterface $webservice)
{
$this->webservice = $webservice;
}
public function doSomethingWithFoo()
{
$this->webservice->getFoo();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment