miniMVC/sys/r.php

64 lines
1.4 KiB
PHP
Raw Normal View History

2012-01-10 12:45:04 -05:00
<?php
/**
* MiniMVC
*
* Convention-based micro-framework for PHP
*
* @author Timothy J. Warren
* @copyright Copyright (c) 2011 - 2012
* @link https://github.com/timw4mail/miniMVC
* @license http://philsturgeon.co.uk/code/dbad-license
*/
// --------------------------------------------------------------------------
/**
* Class for examining other classes
*
* @extends ReflectionClass
*/
class R extends ReflectionClass {
public $methods, $properties, $doc_comments, $parent_class, $static_properties, $internal;
/**
* ReflectionClass Constructor
*
* @param mixed $var
*/
public function __construct($var)
{
parent::__construct($var);
}
/**
* Attempt to run static functions in non-static context
*/
public function __call($name, $args)
{
if(is_callable($this->$name))
{
//Add $this object to args
array_push($args, $this);
//Call the dynamic function
return call_user_func_array($this->$name, $args);
}
}
/**
* Retrieve as much information about the class as possible
*/
public function get_all()
{
$this->methods = $this->getMethods();
$this->properties = $this->getProperties();
$this->doc_comments = $this->getDocComment();
$this->parent_class = $this->getParentClass();
$this->static_properties = $this->getStaticProperties();
$this->internal = (int)$this->isInternal();
2012-01-11 12:21:52 -05:00
2012-01-10 12:45:04 -05:00
return $this;
}
}