Return the getter/isser method if any valid one exists

@param mixed $source
@param string $name

@return null|ReflectionMethod
195298
private function getGetter($source, string $name): ?ReflectionMethod
    {
        if (!preg_match('~^(is|has)[A-Z]~', $name)) {
            $name = 'get' . ucfirst($name);
        }

        $class = new ReflectionClass($source);
        if ($class->hasMethod($name)) {
            $method = $class->getMethod($name);
            if ($method->getModifiers() & ReflectionMethod::IS_PUBLIC) {
                return $method;
            }
        }

        return null;
    }
46159
public static function getTypeByName($name)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $typeRec = static::whereName($name)->get(['type'])->first();

        return (isset($typeRec, $typeRec['type'])) ? $typeRec['type'] : null;
    }
1111610
public function get(string $name)
    {
        if ($this->isSingleton($name)) {
            /*
             * Object is instantiated as
             * singleton already. Just fetch it.
             */
            return $this->singletonObjects[$name];
        } elseif ($this->isDefined($name)) {
            /*
             * Creates a new instance
             * using map information.
             */
            return $this->build($name);
        } elseif (class_exists($name)) {
            /*
             * Class exists but it is
             * not mapped yet.
             */
            $this->set(
                $name,
                method_exists($name, '__construct') ?
                    $this->generateArgumentsMap($name) : []
            );

            return $this->get($name);
        }

        throw new \Exception("Couldn't create '$name'");
    }
1244947
public static function getLevelValue($name)
    {
        $name = strtoupper($name);
        $map = (new \ReflectionClass(self::class))->getConstants();

        return (isset($map[$name]))? $map[$name] : null;
    }
332916
public function offsetGet($name)
	{
		$name = $this->resolveAlias($name);

		if (!$this->offsetExists($name))
		{
			return null;
		}

		return parent::offsetGet($name);
	}
1216834
public function get($name)
    {
        if ($this->argument->defined($name)) {
            return $this->argument->get($name);
        }
        return null;
    }
537437
static function getAnnotation($name, $class, $method = NULL, $nullable = TRUE)
	{
		try {
			NULL === $method or $annotation = self::getMethodAnnotation($method, $name, $class);
			isset($annotation) or $annotation = self::getClassAnnotation($class, $name);
		} catch (ReflectionException $e) {
			$annotation = NULL;
		}

		return !$nullable && NULL === $annotation
			? self::annotationClass($name)
			: $annotation;
	}
1086665
public function getParameterByName($name)
    {
        foreach ($this->parameters as $parameter) {
            if ($parameter->getName() === $name) {
                return $parameter;
            }
        }

        return null;
    }
703397
public function _get($name)
    {
        $getMethod = 'get' . ucfirst($name);
        if (method_exists($this, $getMethod)) {
            return $this->$getMethod();
        }
        throw new \InvalidArgumentException(sprintf('Getter does not exist for "%s" property', $name));
    }
629901
protected function findMethod($name) {
    if ($method = $this->ownBody->getOwnMethod($name)) {
      return $method;
    }
    if (NULL !== $parentClass = $this->extends->getParentClass()) {
      if ($method = $this->extends->getParentClass()->getOwnMethod($name)) {
        return $method;
      }
    }
    foreach ($this->interfacesAll->getAllInterfaces(FALSE) as $interface) {
      $method = $interface->getOwnMethod($name);
      if (FALSE !== $method) {
        return $method;
      }
    }
    return NULL;
  }
52734
public static function get($name)
	{
		return isset(self::$configParams[$name])
			? self::$configParams[$name]
			: null;
	}
685004
protected function getArrayValue($source, $name)
    {
        if (false === strpos($name, '[')) {
            return isset($source[$name]) ? $source[$name] : null;
        }
        $name = explode('[', $name, 2);
        return isset($source[$name[0]]) ? $this->getArrayValue($source[$name[0]], substr($name[1], 0, strlen($name[1]) - 1)) : null;
    }
1060396
protected function findPaymentMethodMapperByName($name)
    {
        if (array_key_exists($name, $this->registeredMethodMappers)) {
            return $this->registeredMethodMappers[$name];
        }

        return null;
    }
764166
protected function determineLoader($source): LoaderInterface
    {
        expect_type($source, ['object', 'string']);

        return is_object($source)
            ? $this->determineLoaderFromClass($source)
            : $this->determineLoaderFromPath($source);
    }
691345
function getMethod($name) {
    if (isset($this->methods[$name])) {
      return $this->methods[$name];
    }
    if ($this->methodsComplete) {
      return NULL;
    }
    if (array_key_exists($name, $this->methodsNotFound)) {
      return NULL;
    }
    $methodObj = $this->findMethod($name);
    if (NULL === $methodObj) {
      $this->methodsNotFound[$name] = TRUE;
      return NULL;
    }
    $this->methods[$name] = $methodObj;
    return $methodObj;
  }
606347
public function getByName($name)
    {
        return isset($this->loggers[$name]) ? $this->loggers[$name] : null;
    }
630942
public static function get($name = '')
    {
        empty(self::$init) && self::init();

        return empty($name) ? $_SESSION : (isset($_SESSION[$name]) ? $_SESSION[$name] : false);
    }