Skip to content

Instantly share code, notes, and snippets.

@TomHAnderson
Last active December 11, 2015 02:48
Show Gist options
  • Save TomHAnderson/4533098 to your computer and use it in GitHub Desktop.
Save TomHAnderson/4533098 to your computer and use it in GitHub Desktop.
<?php
namespace Db\Form\InputFilter;
trait Field
{
abstract public function inputFilterInput();
}
namespace Db\Field;
trait Username
{
use \Db\Form\InputFilter\Field { inputFilterInput as inputFilterInputUsername; }
private function inputFilterInputUsername($inputFilter = null) {
if (!$inputFilter) $inputFilter = new InputFilter();
return $inputFilter->getFactory()->createInput(array(
'name' => 'displayName',
'required' => true,
'validators' => array(),
));
}
}
results in
Class Db\Entity\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Db\Entity\User::inputFilterInput)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment