Skip to content

Instantly share code, notes, and snippets.

@thunderer
Created January 7, 2016 15:47
Show Gist options
  • Save thunderer/59d5eb66eff5e0c7348e to your computer and use it in GitHub Desktop.
Save thunderer/59d5eb66eff5e0c7348e to your computer and use it in GitHub Desktop.
<?php
interface IFoo {
public function getValue();
}
trait FooTrait {
private $value;
public function __construct($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
}
final class TypeA implements IFoo { use FooTrait; }
final class TypeB implements IFoo { use FooTrait; }
final class TypeC implements IFoo { use FooTrait; }
final class TypeD implements IFoo { use FooTrait; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment