<?xml version="1.0" encoding="UTF-8"?>
<pmd-cpd version="phpcpd 1.3.1">
  <duplication lines="84" tokens="119">
    <file path="1.3.x/src/main/php/net/stubbles/reflection/stubReflectionObject.php" line="154"/>
    <file path="1.3.x/src/main/php/net/stubbles/reflection/stubReflectionClass.php" line="137"/>
    <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="1.3.x/src/main/php/net/stubbles/lang/exceptions/stubRuntimeException.php" line="21"/>
    <file path="1.3.x/src/main/php/net/stubbles/lang/exceptions/stubException.php" line="16"/>
    <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>
  <duplication lines="68" tokens="85">
    <file path="1.3.x/src/main/php/net/stubbles/ipo/request/stubAbstractRequest.php" line="210"/>
    <file path="1.3.x/src/main/php/net/stubbles/ipo/request/stubRequestPrefixDecorator.php" line="174"/>
    <codefragment>        return isset($this-&gt;unsecureCookies[$cookieName]);
    }

    /**
     * add a value error for a request value
     *
     * @param  stubRequestValueError  $valueError
     * @param  string                 $valueName
     * @param  int                    $source
     * @deprecated  use *Errors()-&gt;add() instead, will be removed with 1.4.0
     */
    public function addValueError(stubRequestValueError $valueError, $valueName, $source = self::SOURCE_PARAM)
    {
        $this-&gt;getErrors($source)-&gt;add($valueError, $valueName);
    }

    /**
     * checks whether a request value has any error after a filter was applied
     *
     * @param   string  $valueName  name of request value
     * @param   int     $source     optional  source type: cookie, header, param
     * @return  bool
     * @deprecated  use *Errors()-&gt;existFor() instead, will be removed with 1.4.0
     */
    public function hasValueError($valueName, $source = stubRequest::SOURCE_PARAM)
    {
        return $this-&gt;getErrors($source)-&gt;existFor($valueName);
    }

    /**
     * checks whether a request value has a specific error after a filter was applied
     *
     * @param   string  $valueName  name of request value
     * @param   string  $errorId    id of error to check for
     * @param   int     $source     optional  source type: cookie, header, param
     * @return  bool
     * @deprecated  use *Errors()-&gt;existForWithId() instead, will be removed with 1.4.0
     */
    public function hasValueErrorWithId($valueName, $errorId, $source = stubRequest::SOURCE_PARAM)
    {
        return $this-&gt;getErrors($source)-&gt;existForWithId($valueName, $errorId);
    }
    
    /**
     * returns a request value error with a specific id
     *
     * @param   string  $valueName  name of request value
     * @param   string  $errorId    id of error to check for
     * @param   int     $source     optional  source type: cookie, header, param
     * @return  stubRequestValueError|null
     * @deprecated  use *Errors()-&gt;getForWithId() instead, will be removed with 1.4.0
     */
    public function getValueErrorWithId($valueName, $errorId, $source = stubRequest::SOURCE_PARAM)
    {
        return $this-&gt;getErrors($source)-&gt;getForWithId($valueName, $errorId);
    }

    /**
     * returns a list of errors for given request value
     *
     * @param   string  $valueName  name of request value
     * @param   int     $source     optional  source type: cookie, header, param
     * @return  array&lt;stubRequestValueError&gt;
     * @deprecated  use *Errors()-&gt;getFor() instead, will be removed with 1.4.0
     */
    public function getValueError($valueName, $source = stubRequest::SOURCE_PARAM)
    {
        return $this-&gt;getErrors($source)-&gt;getFor($valueName);
</codefragment>
  </duplication>
</pmd-cpd>

