Last active
March 4, 2017 09:20
-
-
Save elmarputz/a5a6c07e86ce96af15875208e9062c71 to your computer and use it in GitHub Desktop.
BaseObject
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Bookshop; | |
/** | |
* BaseObject | |
* | |
* handles magic functions | |
*/ | |
class BaseObject { | |
/** | |
* | |
* @param string $name | |
* @param array $arguments | |
* @throws Exception | |
*/ | |
public function __call(string $name, array $arguments) { | |
throw new \Exception('method ' . $name . ' is not declared'); | |
} | |
/** | |
* | |
* @param string $name | |
* @param $value | |
* @throws Exception | |
*/ | |
public function __set(string $name, $value) { | |
throw new \Exception('attribute ' . $name . ' is not declared'); | |
} | |
/** | |
* | |
* @param string $name | |
* @throws Exception | |
*/ | |
public function __get(string $name) { | |
throw new \Exception('Attribute ' . $name . ' is not declared'); | |
} | |
/** | |
* | |
* @param string $name | |
* @param array $arguments | |
* @throws Exception | |
*/ | |
public static function __callStatic(string $name, array $arguments) { | |
throw new \Exception('Static method ' . $name . ' is not declared'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment