Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function __callStatic($name, array $args = array())
- {
- $name = strtolower($name);
- switch($name):
- case 'equals':
- if(FALSE === isset($args[0]))
- throw new Exception('Missing argument 1.');
- if(FALSE === isset($args[1]))
- throw new Exception('Missing argument 2.');
- if(FALSE === ($args[0] instanceOf Object))
- throw new Exception('Argument 1 is not a Object');
- if(FALSE === ($args[1] instanceOf Object))
- throw new Exception('Argument 2 is not a Object');
- return $args[0]->getHashCode() === $args[1]->getHashCode();
- break;
- endswitch;
- throw new \Exception('STATIC Method '.get_called_class().'::'.$name.'() is not implemented.');
- }
- public function __call($name, array $args = array())
- {
- $name = strtolower($name);
- switch($name):
- case 'equals':
- if(FALSE === isset($args[0]))
- throw new Exception('Missing argument 1.');
- if(FALSE === ($args[0] instanceOf Object))
- throw new Exception('Argument 1 is not a Object');
- return $this->getHashCode() === $args[0]->getHashCode();
- break;
- endswitch;
- throw new \Exception('Method '.get_called_class().'::'.$name.'() is not implemented.');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement