Skip to content

Instantly share code, notes, and snippets.

@ezzatron
Created August 11, 2012 04:36
Show Gist options
  • Save ezzatron/3320962 to your computer and use it in GitHub Desktop.
Save ezzatron/3320962 to your computer and use it in GitHub Desktop.
Options for Typhoon validator design
<?php
namespace Foo\Bar;
use Typhoon\Foo\Bar\BazTyphoon;
class Baz
{
public function __construct()
{
$this->typhoon = Typhoon::getValidator(__CLASS__, func_get_args());
}
/**
* @param string $doom
* @param integer $splat
*/
public function qux($doom, $splat = null)
{
$this->typhoon->qux(func_get_args());
}
public function pip()
{
$this->typhoon->pip(func_get_args());
}
private $typhoon;
}
<?php
namespace Foo\Bar;
use Typhoon\Foo\Bar\BazTyphoon;
class Baz
{
public function __construct()
{
Typhoon::validate(__METHOD__, func_get_args());
}
/**
* @param string $doom
* @param integer $splat
*/
public function qux($doom, $splat = null)
{
Typhoon::validate(__METHOD__, func_get_args());
}
public function pip()
{
Typhoon::validate(__METHOD__, func_get_args());
}
private $typhoon;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment