Mutagenesis\Utility\Runkit::getMethodFlags PHP Method

getMethodFlags() public method

Get the appropriate ext/runkit method flag value to use during a replacement via the runkit methods
public getMethodFlags ( array $mutation ) : integer
$mutation array
return integer
    public function getMethodFlags(array $mutation)
    {
        $reflectionClass = new \ReflectionClass($mutation['class']);
        $reflectionMethod = $reflectionClass->getMethod($mutation['method'] . $this->_methodPreserveCode);
        $static = null;
        $access = null;
        if ($reflectionMethod->isPublic()) {
            $access = RUNKIT_ACC_PUBLIC;
        } elseif ($reflectionMethod->isProtected()) {
            $access = RUNKIT_ACC_PROTECTED;
        } elseif ($reflectionMethod->isPrivate()) {
            $access = RUNKIT_ACC_PRIVATE;
        }
        if (defined('RUNKIT_ACC_STATIC') && $reflectionMethod->isStatic()) {
            $static = RUNKIT_ACC_STATIC;
        }
        if (!is_null($static)) {
            return $access | $static;
        }
        return $access;
    }