private function getDocBlockFromMethod($class, $ucFirstProperty, $type)
    {
        $prefixes = $type === self::ACCESSOR ? ReflectionExtractor::$accessorPrefixes : ReflectionExtractor::$mutatorPrefixes;

        foreach ($prefixes as $prefix) {
            $methodName = $prefix.$ucFirstProperty;

            try {
                $reflectionMethod = new \ReflectionMethod($class, $methodName);

                if (
                    (self::ACCESSOR === $type && 0 === $reflectionMethod->getNumberOfRequiredParameters()) ||
                    (self::MUTATOR === $type && $reflectionMethod->getNumberOfParameters() >= 1)
                ) {
                    break;
                }
            } catch (\ReflectionException $reflectionException) {
                // Try the next prefix if the method doesn't exist
            }
        }

        if (!isset($reflectionMethod)) {
            return;
        }

        $reflectionClass = $reflectionMethod->getDeclaringClass();
        $fileReflector = $this->getFileReflector($reflectionClass);

        if (!$fileReflector) {
            return;
        }

        foreach ($fileReflector->getClasses() as $classReflector) {
            $className = $this->getClassName($classReflector);

            if ($className === $reflectionClass->name) {
                if ($methodReflector = $classReflector->getMethod($methodName)) {
                    return array($methodReflector->getDocBlock(), $prefix);
                }
            }
        }
    }
private function getDocBlockFromMethod($class, $ucFirstProperty, $type)
    {
        $prefixes = $type === self::ACCESSOR ? ReflectionExtractor::$accessorPrefixes : ReflectionExtractor::$mutatorPrefixes;

        foreach ($prefixes as $prefix) {
            $methodName = $prefix.$ucFirstProperty;

            try {
                $reflectionMethod = new \ReflectionMethod($class, $methodName);

                if (
                    (self::ACCESSOR === $type && 0 === $reflectionMethod->getNumberOfRequiredParameters()) ||
                    (self::MUTATOR === $type && $reflectionMethod->getNumberOfParameters() >= 1)
                ) {
                    break;
                }
            } catch (\ReflectionException $reflectionException) {
                // Try the next prefix if the method doesn't exist
            }
        }

        if (!isset($reflectionMethod)) {
            return;
        }

        $reflectionClass = $reflectionMethod->getDeclaringClass();
        $fileReflector = $this->getFileReflector($reflectionClass);

        if (!$fileReflector) {
            return;
        }

        foreach ($fileReflector->getClasses() as $classReflector) {
            $className = $this->getClassName($classReflector);

            if ($className === $reflectionClass->name) {
                if ($methodReflector = $classReflector->getMethod($methodName)) {
                    return array($methodReflector->getDocBlock(), $prefix);
                }
            }
        }
    }
private function getDocBlockFromMethod ( $ class , $ ucFirstProperty , $ type ) { $ prefixes = $ type === self :: ACCESSOR ? ReflectionExtractor :: $ accessorPrefixes : ReflectionExtractor :: $ mutatorPrefixes ; foreach ( $ prefixes as $ prefix ) { $ methodName = $ prefix . $ ucFirstProperty ; try { $ reflectionMethod = new \ ReflectionMethod ( $ class , $ methodName ) ; if ( ( self :: ACCESSOR === $ type && 0 === $ reflectionMethod -> getNumberOfRequiredParameters ( ) ) || ( self :: MUTATOR === $ type && $ reflectionMethod -> getNumberOfParameters ( ) >= 1 ) ) { break ; } } catch ( \ ReflectionException $ reflectionException ) { // Try the next prefix if the method doesn't exist } } if ( ! isset ( $ reflectionMethod ) ) { return ; } $ reflectionClass = $ reflectionMethod -> getDeclaringClass ( ) ; $ fileReflector = $ this -> getFileReflector ( $ reflectionClass ) ; if ( ! $ fileReflector ) { return ; } foreach ( $ fileReflector -> getClasses ( ) as $ classReflector ) { $ className = $ this -> getClassName ( $ classReflector ) ; if ( $ className === $ reflectionClass -> name ) { if ( $ methodReflector = $ classReflector -> getMethod ( $ methodName ) ) { return array ( $ methodReflector -> getDocBlock ( ) , $ prefix ) ; } } } }
Gets DocBlock from accessor or mutator method.

@param string $class
@param string $ucFirstProperty
@param int    $type

@return DocBlock|null
Gets DocBlock from accessor or mutator method .