@param string $type

@return AddressComponent|null
552543
public function findOneComponentByType($type)
    {
        foreach ($this->components as $component) {
            if ($component->hasType($type)) {
                return $component;
            }
        }
    }
50030
public function create(string $type) : ?Controller
    {
        if (\class_exists($type) === false) {
            return $this->fallthrough($type);
        }

        $ref = new \ReflectionClass($type);
        $ctor = $ref->getConstructor();
        if ($ctor === null || $ctor->getNumberOfParameters() === 0) {
            return new $type();
        }

        return $this->fallthrough($type);
    }
1318937
public function setShipping($address, $type = null)
    {
        $param = $address;
        if ($param instanceof PagSeguroShipping) {
            $this->shipping = $param;
        } else {
            $shipping = new PagSeguroShipping();
            if (is_array($param)) {
                $shipping->setAddress(new PagSeguroAddress($param));
            } else {
                if ($param instanceof PagSeguroAddress) {
                    $shipping->setAddress($param);
                }
            }
            if ($type) {
                if ($type instanceof PagSeguroShippingType) {
                    $shipping->setType($type);
                } else {
                    $shipping->setType(new PagSeguroShippingType($type));
                }
            }
            $this->shipping = $shipping;
        }
    }
607247
public function getToolbar($type = 'actionbar')
    {
        return isset($this->_toolbars[$type]) ? $this->_toolbars[$type] : null;
    }
488347
protected function getDefaultAddressOption($type, array $options) {
    $default_option = NULL;

    // Check if any address is a default for this type.
    foreach ($options as $option_id => $option) {
      $key = "default-{$type}";
      if (isset($option[$key]) && $option[$key]) {
        $default_option = $option_id;
        break;
      }
    }

    // Fallback to the first option.
    if (!$default_option || !isset($options[$default_option])) {
      $option_ids = array_keys($options);
      $default_option = reset($option_ids);
    }

    return $default_option;
  }
1121802
protected static function getPositionerInstance($type)
    {
        if (!isset(self::$_positioners[$type])) {
            $class = '\\Dompdf\\Positioner\\'.$type;
            self::$_positioners[$type] = new $class();
        }
        return self::$_positioners[$type];
    }
178006
public function findComponentsByType($type)
    {
        $components = [];
        foreach ($this->components as $component) {
            if ($component->hasType($type)) {
                $components[] = $component;
            }
        }

        return $components;
    }
316371
public function getMachine(string $type)
	{
		foreach ($this->backends as $b => $backend) {
			$m = $backend->getMachine($this, $type);
			if ($m !== null) {
				return $m;
			}
		}
		return null;
	}
540936
public function create($type = null)
    {
        app('antares.asset')->container('antares/foundation::application')->add('ckeditor', '/packages/ckeditor/ckeditor.js', ['webpack_forms_basic']);
        return $this->presenter->create($this->repository->makeModel()->getModel(), $type);
    }
1315337
public function get_enabled_plugins($type) {
        $this->load_enabled_plugins();
        if (isset($this->enabledplugins[$type])) {
            return $this->enabledplugins[$type];
        }
        return null;
    }
62230
public function transport($type = null)
    {

        // Act as setter
        if (!is_null($type)) {
            $this->transport = $type;
        }

        return $this->transport;
    }
1057087
public function getAddress($index)
    {
        if (!isset($this->addresses[$index])) {
            return null;
        }
        return $this->addresses[$index];
    }
1252150
public function select(string $type = null)
    {
        if (empty($type)) {
            $type = $this->provider;
        }

        $providers = $this->mergeProviders();
        if (!isset($providers[$type])) {
            throw new InvalidArgumentException(sprintf('Provider %s does not exist', $type));
        }

        $providerBeanName = $providers[$type];

        return App::getBean($providerBeanName);
    }
1366088
private function _createAddress(array $response, $type)
    {
        switch($type) {
            case AbstractAddress::TYPE_SHIPPING:
                $model = new ShippingAddress();
                break;
            case AbstractAddress::TYPE_BILLING:
                $model = new BillingAddress();
                break;
            default:
                return null;
        }

        $model->setName($response[AbstractAddress::FIELD_NAME])
            ->setStreetAddress($response[AbstractAddress::FIELD_STREET_ADDRESS])
            ->setStreetAddressAddition($response[AbstractAddress::FIELD_STREET_ADDRESS_ADDITION])
            ->setPostalCode($response[AbstractAddress::FIELD_POSTAL_CODE])
            ->setCity($response[AbstractAddress::FIELD_CITY])
            ->setState($response[AbstractAddress::FIELD_STATE])
            ->setCountry($response[AbstractAddress::FIELD_COUNTRY])
            ->setPhone($response[AbstractAddress::FIELD_PHONE]);

        return $model;
    }
1020910
public function setType(Type $type = null)
    {
        if ($this->type !== $type) {
            $this->type = $type;
        }

        return $this;
    }
749745
public function getImportObject($type)
    {
        $this->importType = $type;
        $result = null;
        try {
            $importType = $this->getImportType();
            $result = $this->createImportObject($importType);
        } catch (Exception $e) {
        }

        return $result;
    }
704561
private function getEndpoint($type)
    {
        if (!array_key_exists($type, $this->endpoints)) {
            $this->endpoints[$type] = SearchEndpointFactory::get($type);
        }

        return $this->endpoints[$type];
    }