Skip to content

Instantly share code, notes, and snippets.

@elmarputz
Last active March 4, 2017 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elmarputz/a5a6c07e86ce96af15875208e9062c71 to your computer and use it in GitHub Desktop.
Save elmarputz/a5a6c07e86ce96af15875208e9062c71 to your computer and use it in GitHub Desktop.
BaseObject
<?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