abstract class MatchObject in Bibliography Module 7.2
MatchObject Abstract Class
Hierarchy
- class \Nametools\MatchObject
Expanded class hierarchy of MatchObject
1 file declares its use of MatchObject
- ContributorObject.php in lib/
msrc-authortool/ src/ Analyzer/ ContributorObject.php
File
- lib/
msrc-authortool/ src/ Nametools/ MatchObject.php, line 14
Namespace
NametoolsView source
abstract class MatchObject {
// --------------------------------------------------------------
/**
* Factory method
*
* @return MatchObject
*/
public static function factory() {
$classname = get_called_class();
return new $classname();
}
// --------------------------------------------------------------
/**
* Set magic method prevents setting undefined variables
*
* @param string $item
* @param string $value
*/
public function __set($item, $val) {
if (!in_array($item, array_keys(get_object_vars($this)))) {
throw new \InvalidArgumentException("Undefined Property: {$item}");
}
}
// --------------------------------------------------------------
/**
* To string magic method
*
* @return string
*/
public function __toString() {
return json_encode(get_object_vars($this));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MatchObject:: |
public static | function | Factory method | |
MatchObject:: |
public | function | Set magic method prevents setting undefined variables | |
MatchObject:: |
public | function | To string magic method |