@param string $name

@return CountryInterface
555555
private function createCountryNamed($name)
    {
        /** @var CountryInterface $country */
        $country = $this->countryFactory->createNew();
        $country->setCode($this->countryNameConverter->convertToCode($name));

        return $country;
    }
767775
public function ofCountry($country)
    {
        $countries = is_array($country) ? $country : func_get_args();

        $instance = clone $this;
        $instance->countries = array_unique(
            array_merge($instance->countries, static::parseCountries($countries))
        );

        return $instance;
    }
429360
public function find(string $name)
    {
        if (! \array_key_exists($name, $this->keyMap)) {
            throw new InvalidArgumentException("Name [{$name}] is not available.");
        }

        return $this->controls[$this->keyMap[$name]];
    }
10036
protected function getGroupByRoleName(string $name) : ?EntityInterface
    {
        $result = TableRegistry::get('Groups.Groups')->find()
            ->enableHydration(true)
            ->where(['name' => $name])
            ->first();

        Assert::nullOrIsInstanceOf($result, EntityInterface::class);

        return $result;
    }
1264447
public function getServer($name)
    {

        // try to match one of the server names with the passed name
        /** @var \AppserverIo\Appserver\Core\Api\Node\ServerNodeInterface $server */
        foreach ($this->getServers() as $server) {
            if ($name === $server->getName()) {
                return $server;
            }
        }
    }
934309
public static function get($name)
    {
        if (!isset(static::$types[$name])) {
            if (!static::has($name)) {
                throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
            }

            static::$types[$name] = new static::$map[$name];
        }

        return static::$types[$name];
    }
647845
public function setCountry($country)
    {
        $this->set('country', $country);

        $vat = $this->getService('repos:subscriptions.vat')->find(array('country' => $country));

        if ($vat) {
            $this->setVat($vat);
        }

        return $this;
    }
61907
protected function getFromGlobal(string $name)
    {
        if (isset($GLOBALS[$name])) {
            return $GLOBALS[$name];
        }

        throw new \ErrorException(
            sprintf("Undefined global variable (%s) called!", $name));
    }
217672
public function get(string $name)
    {
        if (!isset($this->services[$name])) {
            throw new \LogicException(\sprintf('Global variable %s could not be located. You should define it.', \json_encode($name)));
        }

        return $this->services[$name];
    }
97964
protected function createComponent(string $name)
    {
        $definition = $this->components[$name];
        $params = $this->getComponentParams($name);

        return \Yii::createObject($definition, $params);
    }
918461
public function country($country = null)
  {
    if (null === $country)
    {
      return $this->responseConfig['country'];
    }

    if (false === in_array(strtolower($country), $this->possibleLocations))
    {
      throw new InvalidArgumentException(sprintf(
        "Invalid Country-Code: %s! Possible Country-Codes: %s",
        $country,
        implode(', ', $this->possibleLocations)
      ));
    }

    $this->responseConfig['country'] = strtolower($country);

    return $this;
  }
1086902
public function getComponentDomain($name)
    {
        $result = null;

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

        return $result;
    }
254611
final public function get(string $name)
    {
        $service_selected = null;
        foreach ($this->services as $one => $val) {
            if ($val['name'] === $name) {
                if (!in_array($val['content']->status, array("enabled", "disabled"))) {
                    throw new Server500(new \ArrayObject(array("explain" =>
                        "Undefined status [ ".$val['content']->status." ] for ".$val['name']." service",
                        "solution" => "Please set the status [disabled] or [enabled]")));
                }
                if ($val['content']->status == "disabled") {
                    throw new Server500(new \ArrayObject(array("explain" =>
                        "The service [ ".$val['name']." ] is currently disabled ",
                        "solution" => "Please set the status [enabled] to enable the service")));
                }
                $i = $val['content']->namespace;
                $container = FrameworkContainer::getInstance();
                return ($container->get($i));
            }
        }

        throw new Server500(new \ArrayObject(array("explain" =>
            "Undefined service : $name", "solution" => "Please register the [$name] service")));
    }
876625
public function table(string $name) : Table\TableDefiner
    {
        return new TableDefiner($name, function (ITableDisplay $table) {
            $this->tables[$table->getName()] = $table;
        }, $this->tables);
    }
1012416
public static function create($name): SurnameTraditionInterface
    {
        switch ($name) {
            case 'paternal':
                return new PaternalSurnameTradition();
            case 'patrilineal':
                return new PatrilinealSurnameTradition();
            case 'matrilineal':
                return new MatrilinealSurnameTradition();
            case 'portuguese':
                return new PortugueseSurnameTradition();
            case 'spanish':
                return new SpanishSurnameTradition();
            case 'polish':
                return new PolishSurnameTradition();
            case 'lithuanian':
                return new LithuanianSurnameTradition();
            case 'icelandic':
                return new IcelandicSurnameTradition();
            default:
                return new DefaultSurnameTradition();
        }
    }
635612
public function getType($name)
    {
        if (false === $this->hasType($name)) {
            throw new InvalidArgumentException(sprintf('The type "%s" was not found.', $name));
        }
        if (isset($this->loaded[$name])) {
            return $this->loaded[$name];
        }
        $fqcn = $this->types[$name];
        $type = new $fqcn;

        if (!$type instanceof TypeInterface) {
            throw new InvalidArgumentException(sprintf('The class "%s" must implement the "%s\\Types\TypeInterface"', $fqcn, __NAMESPACE__));
        }

        return $this->loaded[$name] = new $fqcn;
    }
371868
public function createBatchActionForm($name)
    {
        /** @var AbstractAdmin $admin */
        $admin = $this->getAdmin();

        $container = $admin->getContainer();

        return $container->get('form.factory')->createNamedBuilder($name, 'form', [], [
            'label_format' => 'form.label_%name%',
            'translation_domain' => $admin->getTranslationDomain(),
        ]);
    }