<?xml version="1.0" encoding="UTF-8"?>
<pmd-cpd version="phpcpd 1.3.2">
  <duplication lines="84" tokens="119">
    <file path="/home/www-data/stubbles/1.7.x/src/main/php/net/stubbles/reflection/stubReflectionObject.php" line="153"/>
    <file path="/home/www-data/stubbles/1.7.x/src/main/php/net/stubbles/reflection/stubReflectionClass.php" line="136"/>
    <codefragment>    public function getConstructor()
    {
        return $this-&gt;getMethod('__construct');
    }

    /**
     * returns the specified method or null if it does not exist
     *
     * @param   string                $name  name of method to return
     * @return  stubReflectionMethod
     */
    public function getMethod($name)
    {
        if (parent::hasMethod($name) == false) {
            return null;
        }
        
        $stubRefMethod = new stubReflectionMethod($this, $name);
        return $stubRefMethod;
    }

    /**
     * returns a list of all methods
     *
     * @return  array&lt;stubReflectionMethod&gt;
     */
    public function getMethods()
    {
        $methods    = parent::getMethods();
        $stubMethods = array();
        foreach ($methods as $method) {
            $stubMethods[] = new stubReflectionMethod($this, $method-&gt;getName());
        }
        
        return $stubMethods;
    }

    /**
     * returns a list of all methods which satify the given matcher
     *
     * @param   stubMethodMatcher            $methodMatcher
     * @return  array&lt;stubReflectionMethod&gt;
     */
    public function getMethodsByMatcher(stubMethodMatcher $methodMatcher)
    {
        $methods     = parent::getMethods();
        $stubMethods = array();
        foreach ($methods as $method) {
            if ($methodMatcher-&gt;matchesMethod($method) === true) {
                $stubMethod = new stubReflectionMethod($this, $method-&gt;getName());
                if ($methodMatcher-&gt;matchesAnnotatableMethod($stubMethod) === true) {
                    $stubMethods[] = $stubMethod;
                }
            }
        }
        
        return $stubMethods;
    }

    /**
     * returns the specified property or null if it does not exist
     *
     * @param   string                  $name  name of property to return
     * @return  stubReflectionProperty
     */
    public function getProperty($name)
    {
        if (parent::hasProperty($name) == false) {
            return null;
        }
        
        $stubRefProperty = new stubReflectionProperty($this, $name);
        return $stubRefProperty;
    }

    /**
     * returns a list of all properties
     *
     * @return  array&lt;stubReflectionProperty&gt;
     */
    public function getProperties()
    {
        $properties     = parent::getProperties();
        $stubProperties = array();
</codefragment>
  </duplication>
  <duplication lines="59" tokens="59">
    <file path="/home/www-data/stubbles/1.7.x/src/main/php/net/stubbles/lang/exceptions/stubRuntimeException.php" line="20"/>
    <file path="/home/www-data/stubbles/1.7.x/src/main/php/net/stubbles/lang/exceptions/stubException.php" line="15"/>
    <codefragment>class stubRuntimeException extends Exception implements stubThrowable
{
    /**
     * returns class informations
     *
     * @return  stubReflectionObject
     * @XMLIgnore
     */
    public function getClass()
    {
        stubClassLoader::load('net::stubbles::reflection::stubReflectionObject');
        $refObject = new stubReflectionObject($this);
        return $refObject;
    }

    /**
     * returns package informations
     *
     * @return  stubReflectionPackage
     * @XMLIgnore
     */
    public function getPackage()
    {
         stubClassLoader::load('net::stubbles::reflection::stubReflectionPackage');
         $refPackage = new stubReflectionPackage(stubClassLoader::getPackageName($this-&gt;getClassName()));
         return $refPackage;
    }

    /**
     * returns the full qualified class name
     *
     * @return  string
     * @XMLIgnore
     */
    public function getClassName()
    {
        return stubClassLoader::getFullQualifiedClassName(get_class($this));
    }

    /**
     * returns the name of the package where the class is inside
     *
     * @return  string
     * @XMLIgnore
     */
    public function getPackageName()
    {
        return stubClassLoader::getPackageName($this-&gt;getClassName());
    }

    /**
     * returns a unique hash code for the class
     *
     * @return  string
     * @XMLIgnore
     */
    public function hashCode()
    {
        return spl_object_hash($this);
</codefragment>
  </duplication>
</pmd-cpd>

