@param null $type

@return array
321640
public static function getEditableFields($type = null)
    {
        $fields = array(
            'preferredPayment',
            'paymentStatus',
            'paymentMethodIdentifier',
            'nameOnAccount',
            'addressLine1',
            'addressLine2',
            'city',
            'stateProvince',
            'zipPostalCode',
        );

        $ccOnly = array(
            'expirationDate',
            'country',
        );

        $achOnly = array(
            'telephoneIndicator',
            'accountHolderYob',
            'driversLicenseState',
            'driversLicenseNumber',
            'socialSecurityNumberLast4',
        );

        switch ($type) {
            case HpsPayPlanPaymentMethodType::ACH:
                return array_merge($fields, $achOnly);
                break;
            case HpsPayPlanPaymentMethodType::CREDIT_CARD:
                return array_merge($fields, $ccOnly);
                break;
            default:
                return array_merge($fields, $achOnly, $ccOnly);
                break;
        }
    }
91273
public static function getTypeName($type)
    {
        return isset(self::$names[$type])
            ? self::$names[$type]
            : null;
    }
859905
protected function getFunctions($type = null)
    {
        $funcs = \get_defined_functions();

        if ($type) {
            return $funcs[$type];
        } else {
            return \array_merge($funcs['internal'], $funcs['user']);
        }
    }
362829
public function getStructure(string $type = null): array
    {
        if ($type === HCFormTypeEnum::edit()->id()) {
            return $this->getStructureEdit();
        }

        return $this->getStructureNew();
    }
1044642
public function getMapping($index, $type)
    {
        $mappings = $this->getMappings($index);

        if (!isset($mappings[$type])) {
            return null;
        }

        if (!isset($mappings[$type]['properties'])) {
            return [];
        }

        return $mappings[$type]['properties'];
    }
806982
private function getParameters($type, $index = null)
    {
        // If the type is invalid, return an empty array
        if ( ! in_array($type, ['dataset', 'messageset', 'ruleset'])) return [];

        return array_get($this->{$type}, $index, []);
    }
304677
private function resolveTypes($type)
    {
        $sortTypes = [];

        do {
            $sortTypes[] = $sortType = $this->sortRegistry[$type];
        } while (($type = $sortType->getParent()) !== null);

        return $sortTypes;
    }
669520
public function getUnitNames($type = null)
    {
        $names = array();
        foreach ($this->getUnits($type) as $key => $value) {
            $names[$key] = $value['name'];
        }

        return $names;
    }
92223
public function warm($type = null)
    {
        if (false === $this->mf->hasCache()) {
            return [];
        }
        return $this->doWarm($this->getTypes($type));
    }
10107
public function get_present_plugins($type) {
        $this->load_present_plugins();
        if (isset($this->presentplugins[$type])) {
            return $this->presentplugins[$type];
        }
        return null;
    }
241024
public function clear($type = null)
    {
        if (false === $this->mf->hasCache()) {
            return [];
        }
        return $this->doClear($this->getTypes($type));
    }
1150582
public function getUnits($type = null)
    {
        if (!isset($type)) {
            return $this->units;
        }

        $filtered = array();
        foreach ($this->units as $key => $value) {
            if (isset($value['type']) && $value['type'] === $type) {
                $filtered[$key] = $value;
            }
        }

        return $filtered;
    }
591517
public function getTags(int $type = null): array
    {
        if ($type === null) {
            return $this->tags;
        }

        return array_filter($this->tags, function (Tag $tag) use ($type): bool {
            return $tag->getType() === $type;
        });
    }
721924
public function getClear($type = null)
    {
        $messages = $this->get($type);
        $this->clear($type);
        return $messages;
    }
775042
public function copy($type = null)
    {
        $builder = new Builder($this->type, $this->dogmatist, $this->parent, $this->strict);
        $this->copyData($builder);

        if ($type !== null) {
            $builder->setType($type);
        }

        return $builder;
    }
1205420
public static function getStackByType($type)
    {
        foreach (self::getStacks() as $stack) {
            if ($stack->isType($type)) {
                return $stack;
            }
        }
        return new Stacks\NullStack();
    }
538281
public function returnType($type = null)
  {
    if (null === $type)
    {
      return $this->responseConfig['returnType'];
    }

    $this->responseConfig['returnType'] = $type;

    return $this;
  }