Getd/Setd stubs for methods or get stubbed methods array.

@param  array    $name An array of method names.
@return Method[]       Return the array of stubbed methods.
518228
public function methods($name = [])
    {
        if (!func_num_args()) {
            return $this->_methods;
        }
        foreach ($name as $method => $returns) {
            if (is_callable($returns)) {
                $this->method($method, $returns);
            } elseif (is_array($returns)) {
                $stub = $this->method($method);
                call_user_func_array([$stub, 'andReturn'], $returns);
            } else {
                $error = "Stubbed method definition for `{$method}` must be a closure or an array of returned value(s).";
                throw new InvalidArgumentException($error);
            }
        }
    }
28089
protected function buildClass($name)
    {
        $stub = parent::buildClass($name);

        $this->createJsonConfig($name);

        return $stub;
    }
857785
protected function getList($name)
    {
        if (null === ($list = $this->cache->get($name)) || !\is_array($list)) {
            return [];
        }

        return $list;
    }
507200
public function getErrors($name)
    {
        $field  = $this->getField($name);
        $errors = (null !== $field) ? $field->getErrors() : [];
        return $errors;
    }
1159099
private function getQueryNode($name)
    {
        $queries = new ArrayNodeDefinition($name);
        $queries
            ->info('Query configuration')
            ->useAttributeAsKey('key')
            ->prototype('array')
                ->beforeNormalization()
                    // String value is a shortcut to the named query
                    ->ifString()
                    ->then(function ($v) {return ['named_query' => $v];})
                ->end()
                ->children()
                    ->scalarNode('query_type')
                        ->info('Name of the QueryType implementation')
                    ->end()
                    ->scalarNode('use_filter')
                        ->info('Whether to use FilterService of FindService')
                    ->end()
                    ->scalarNode('max_per_page')
                        ->info('Number of results per page when using pager')
                    ->end()
                    ->scalarNode('page')
                        ->info('Current page when using pager')
                    ->end()
                    ->arrayNode('parameters')
                        ->info('Parameters for the QueryType implementation')
                        ->useAttributeAsKey('key')
                        ->prototype('variable')->end()
                    ->end()
                    ->scalarNode('named_query')
                        ->info('Name of the configured query')
                    ->end()
                ->end()
                ->validate()
                    ->ifTrue(function ($v) {
                        return array_key_exists('named_query', $v) && array_key_exists('query_type', $v);
                    })
                    ->thenInvalid(
                        'You cannot use both "named_query" and "query_type" at the same time.'
                    )
                ->end()
                ->validate()
                    ->ifTrue(function ($v) {
                        return !array_key_exists('named_query', $v) && !array_key_exists('query_type', $v);
                    })
                    ->thenInvalid(
                        'One of "named_query" or "query_type" must be set.'
                    )
                ->end()
                ->validate()
                    ->ifTrue(function ($v) {return array_key_exists('query_type', $v);})
                    ->then(function ($v) {
                        if (!array_key_exists('use_filter', $v)) {
                            $v['use_filter'] = true;
                        }

                        if (!array_key_exists('max_per_page', $v)) {
                            $v['max_per_page'] = 25;
                        }

                        if (!array_key_exists('page', $v)) {
                            $v['page'] = 1;
                        }

                        if (!array_key_exists('parameters', $v)) {
                            $v['parameters'] = [];
                        }

                        return $v;
                    })
                ->end()
            ->end()
            ->validate()
                ->ifTrue(function ($v) {
                    foreach (array_keys($v) as $key) {
                        if (!is_string($key) || !preg_match(Twig_Lexer::REGEX_NAME, $key)) {
                            return true;
                        }
                    }

                    return false;
                })
                ->thenInvalid(
                    'Query keys must be strings conforming to a valid Twig variable names.'
                );

        return $queries;
    }
1279785
public function getBlocks($name)
    {
        $result = array();

        if(isset($this->__blocks[$name])) {
            $result = $this->__blocks[$name];
        }

        return $result;
    }
1239836
public function getHeaderAsArray(string $name) : array
    {
        $name = strtolower($name);

        return isset($this->headers[$name]) ? $this->headers[$name] : [];
    }
810977
public function & getMethod( $name )
	{
		if( isset( $this->methods[$name] ) )
			return $this->methods[$name];
		throw new RuntimeException( "Method '$name' is unknown" );
	}
1200714
public function getColumnRaw($name)
    {
        $results = [];
        foreach ($this->entities as $entity) {
            $results[] = $entity->getRaw($name);
        }

        return $results;
    }
1296896
public function getErrors($name = null)
    {
        if (!$name) {
            $errors = array();
            //flatten the errors array into a single array
            array_walk_recursive($this->errors, function ($error) use (&$errors) {
                    $errors[] = $error;
                }
            );

            return $errors;
        }

        return isset($this->errors[$name]) ? $this->errors[$name] : array();
    }
1322355
public static function getSet(string $name): array
    {
        $obj = new RedisSet(self::handle(), $name);
        return $obj->all();
    }
442652
public function getArray($name)
    {
        return isset($this->arguments[$name]) ? $this->arguments[$name]->values() : [];
    }
1308903
protected function replaceClass($stub, $name)
    {
        $stub = parent::replaceClass($stub, $name);

        return str_replace(
            [
                'DummyModelNamespace',
                'DummyModel',
                'DummyGrid',
                'DummyShow',
                'DummyForm',
            ],
            [
                $this->option('model'),
                class_basename($this->option('model')),
                $this->indentCodes($this->generator->generateGrid()),
                $this->indentCodes($this->generator->generateShow()),
                $this->indentCodes($this->generator->generateForm()),
            ],
            $stub
        );
    }
831543
public function getParametersWithKey($name)
    {
        $parameters = array();

        /** @var Parameter $parameter */
        foreach ($this->parameters as $parameter) {
            if ($parameter->getKey() == $name) {
                $parameters[] = $parameter;
            }
        }

        return $parameters;
    }
1081800
protected function findOwnMethod($name) {
    $method = $this->getMethod($name);
    if ($this->qcn === $method->getDeclaringClassName()) {
      return $method;
    }
    return NULL;
  }
319513
public function get($name)
	{
		$namespaced = $this->namespace.':'.$name;

		$queued   = $this->length($namespaced, 'list');
		$delayed  = $this->length($namespaced.':delayed', 'zset');
		$reserved = $this->length($namespaced.':reserved', 'zset');

		return array('queued' => $queued, 'delayed' => $delayed, 'reserved' => $reserved);
	}
434974
public function getMethod($name) {
    $methods = $this
      ->getMethods()
      ->filter(function (InterfaceMethodNode $method) use ($name) {
        return $method->getName()->getText() === $name;
      });
    return $methods->isEmpty() ? NULL : $methods[0];
  }