7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
16 * @package Zend_Reflection
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
23 * @see Zend_Reflection_Class
25 require_once 'Zend/Reflection/Class.php';
28 * @see Zend_Reflection_Function
30 require_once 'Zend/Reflection/Function.php';
34 * @package Zend_Reflection
35 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
36 * @license http://framework.zend.com/license/new-bsd New BSD License
38 class Zend_Reflection_Extension
extends ReflectionExtension
41 * Get extension function reflection objects
43 * @param string $reflectionClass Name of reflection class to use
44 * @return array Array of Zend_Reflection_Function objects
46 public function getFunctions($reflectionClass = 'Zend_Reflection_Function')
48 $phpReflections = parent
::getFunctions();
49 $zendReflections = array();
50 while ($phpReflections && ($phpReflection = array_shift($phpReflections))) {
51 $instance = new $reflectionClass($phpReflection->getName());
52 if (!$instance instanceof Zend_Reflection_Function
) {
53 require_once 'Zend/Reflection/Exception.php';
54 throw new Zend_Reflection_Exception('Invalid reflection class provided; must extend Zend_Reflection_Function');
56 $zendReflections[] = $instance;
57 unset($phpReflection);
59 unset($phpReflections);
60 return $zendReflections;
64 * Get extension class reflection objects
66 * @param string $reflectionClass Name of reflection class to use
67 * @return array Array of Zend_Reflection_Class objects
69 public function getClasses($reflectionClass = 'Zend_Reflection_Class')
71 $phpReflections = parent
::getClasses();
72 $zendReflections = array();
73 while ($phpReflections && ($phpReflection = array_shift($phpReflections))) {
74 $instance = new $reflectionClass($phpReflection->getName());
75 if (!$instance instanceof Zend_Reflection_Class
) {
76 require_once 'Zend/Reflection/Exception.php';
77 throw new Zend_Reflection_Exception('Invalid reflection class provided; must extend Zend_Reflection_Class');
79 $zendReflections[] = $instance;
80 unset($phpReflection);
82 unset($phpReflections);
83 return $zendReflections;