Author: fmenge
Date: Thu Nov 15 23:57:00 2007
New Revision: 6747

Log:
- Filters for getProperties() and getMethods() implemented
- Doc block indentation fixed
- carriage returns removed

Modified:
    experimental/Reflection/src/class.php

Modified: experimental/Reflection/src/class.php
==============================================================================
--- experimental/Reflection/src/class.php [iso-8859-1] (original)
+++ experimental/Reflection/src/class.php [iso-8859-1] Thu Nov 15 23:57:00 2007
@@ -1,32 +1,32 @@
-<?php
-/**
- * File containing the ezcReflectionClass class.
- *
- * @package Reflection
- * @version //autogentag//
- * @copyright Copyright (C) 2007 eZ systems as. All rights reserved.
- * @license http://ez.no/licenses/new_bsd New BSD License
- */
-
-/**
- * Extends the ReflectionClass using PHPDoc comments to provide
- * type information
- * 
- * @package Reflection
- * @version //autogentag//
- * @author Stefan Marr <[EMAIL PROTECTED]>
- * @author Falko Menge <[EMAIL PROTECTED]>
+<?php
+/**
+ * File containing the ezcReflectionClass class.
+ *
+ * @package Reflection
+ * @version //autogentag//
+ * @copyright Copyright (C) 2007 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
  */
-class ezcReflectionClass extends ReflectionClass
+
+/**
+ * Extends the ReflectionClass using PHPDoc comments to provide
+ * type information
+ * 
+ * @package Reflection
+ * @version //autogentag//
+ * @author Stefan Marr <[EMAIL PROTECTED]>
+ * @author Falko Menge <[EMAIL PROTECTED]>
+ */
+class ezcReflectionClass extends ReflectionClass
 {
     /**
-    * @var ezcReflectionDocParser
-    */
+     * @var ezcReflectionDocParser
+     */
     protected $docParser;
 
     /**
-    * @param string $name
-    */
+     * @param string $name
+     */
     public function __construct($name) {
         try {
             parent::__construct($name);
@@ -39,16 +39,16 @@
     }
 
     /**
-    * @param string $name
-    * @return ezcReflectionMethod
-    */
+     * @param string $name
+     * @return ezcReflectionMethod
+     */
     public function getMethod($name) {
         return new ezcReflectionMethod($this->getName(), $name);
     }
 
     /**
-    * @return ezcReflectionMethod
-    */
+     * @return ezcReflectionMethod
+     */
     public function getConstructor() {
         $con = parent::getConstructor();
         if ($con != null) {
@@ -61,20 +61,27 @@
     }
 
     /**
-    * @return ezcReflectionMethod[]
-    */
-    public function getMethods() {
-        $extMethodes = array();
-        $methodes = parent::getMethods();
-        foreach ($methodes as $method) {
-            $extMethodes[] = new ezcReflectionMethod($this->getName(), 
$method->getName());
+     * @param integer $filter a combination of ReflectionMethod::IS_STATIC,
+     * ReflectionMethod::IS_PUBLIC, ReflectionMethod::IS_PROTECTED, 
ReflectionMethod::IS_PRIVATE,
+     * ReflectionMethod::IS_ABSTRACT and ReflectionMethod::IS_FINAL
+     * @return ezcReflectionMethod[]
+     */
+    public function getMethods($filter = 0) {
+        $extMethods = array();
+        if ($filter > 0) {
+            $methods = parent::getMethods($filter);
+        } else {
+            $methods = parent::getMethods();
         }
-        return $extMethodes;
+        foreach ($methods as $method) {
+            $extMethods[] = new ezcReflectionMethod($this->getName(), 
$method->getName());
+        }
+        return $extMethods;
     }
 
     /**
-    * @return ezcReflectionClassType
-    */
+     * @return ezcReflectionClassType
+     */
     public function getParentClass() {
         $class = parent::getParentClass();
         if (is_object($class)) {
@@ -86,20 +93,27 @@
     }
 
     /**
-    * @param string $name
-    * @return ezcReflectionProperty
-    * @throws RelectionException if property doesn't exists
-    */
+     * @param string $name
+     * @return ezcReflectionProperty
+     * @throws RelectionException if property doesn't exists
+     */
     public function getProperty($name) {
         $pro = parent::getProperty($name);
         return new ezcReflectionProperty($this->getName(), $name);
     }
 
     /**
-    * @return ezcReflectionProperty[]
-    */
-    public function getProperties() {
-        $props = parent::getProperties();
+     * @param integer $filter a combination of ReflectionProperty::IS_STATIC,
+     * ReflectionProperty::IS_PUBLIC, ReflectionProperty::IS_PROTECTED,
+     * ReflectionProperty::IS_PRIVATE
+     * @return ezcReflectionProperty[]
+     */
+    public function getProperties($filter = 0) {
+        if ($filter > 0) {
+            $props = parent::getProperties($filter);
+        } else {
+            $props = parent::getProperties();
+        }
         $extProps = array();
         foreach ($props as $prop) {
             $extProps[] = new ezcReflectionProperty($this->getName(),
@@ -109,39 +123,39 @@
     }
 
     /**
-    * Check whether this class has been tagged with @webservice
-    * @return boolean
-    */
+     * Check whether this class has been tagged with @webservice
+     * @return boolean
+     */
     public function isWebService() {
         return $this->docParser->isTagged("webservice");
     }
 
     /**
-    * @return string
-    */
+     * @return string
+     */
     public function getShortDescription() {
         return $this->docParser->getShortDescription();
     }
 
     /**
-    * @return string
-    */
+     * @return string
+     */
     public function getLongDescription() {
         return $this->docParser->getLongDescription();
     }
 
     /**
-    * @param string $with
-    * @return boolean
-    */
+     * @param string $with
+     * @return boolean
+     */
     public function isTagged($with) {
         return $this->docParser->isTagged($with);
     }
 
     /**
-    * @param string $name
-    * @return ezcReflectionDocTag[]
-    */
+     * @param string $name
+     * @return ezcReflectionDocTag[]
+     */
     public function getTags($name = '') {
         if ($name == '') {
             return $this->docParser->getTags();
@@ -152,8 +166,8 @@
     }
 
     /**
-    * @return ezcReflectionExtension
-    */
+     * @return ezcReflectionExtension
+     */
     public function getExtension() {
         $name = $this->getExtensionName();
         if (!empty($name)) {
@@ -164,4 +178,4 @@
         }
     }
 }
-?>
+?>


-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to