Is there any way in PHP to read a php source file which contains one or more classes and then create a prototype class (similar to interface)
Original class looks like this:
class Math {
private $a;
private $b;
public function set_a($a) {
$this -> a = $a;
}
public function set_b($b) {
$this -> b = $b;
}
public function sum() {
return $a + $b;
}
}
The prototype file must look like this:
class Math {
public function set_a($a) { }
public function set_b($b) { }
public function sum() { }
}
I want to do this dynamically by reading the class files at runtime and generating prototype classes. Is there any library in PHP through which I can read class meta information from file without including.
EDIT: I need to create a PHP file listing all prototype classes. The reason is that I have created a PHAR file for my library. And whenever I need to use any code from within the PHAR file i just include it using the following syntax.
require_once("phar://mylibrary.phar/math.php");
But the problem is that the code hints and intelli-sense does not work. I am using zend studio. So I thought, if I create a single file with all prototype classes and then include into new project then code hinting will work.