@param $authorization
@param string $name
@param array $data

@return $this
@internal param $condition
432559
public function viewIfCan($authorization, string $name, array $data = null)
    {
        return $this->addIfCan($authorization, View::create($name, $data));
    }
680151
public static function createFromArray(array $data, SecuritySettingsInterface $sourceSettings = null)
    {
        if ($sourceSettings && !$sourceSettings instanceof self) {
            throw new \InvalidArgumentException('Provide an instance of OAuth1SecuritySettings for $sourceSettings');
        }

        $settings = $sourceSettings ? clone $sourceSettings : new static();
        \assert($settings instanceof self);

        if (isset($data['tokenCredentialsUri'])) {
            $settings->setTokenCredentialsUri($data['tokenCredentialsUri']);
        }

        if (isset($data['requestTokenUri'])) {
            $settings->setRequestTokenUri($data['requestTokenUri']);
        }

        if (isset($data['authorizationUri'])) {
            $settings->setAuthorizationUri($data['authorizationUri']);
        }

        return $settings;
    }
1147534
public static function createFromArray($name, array $data = [])
    {
        $type = parent::createFromArray($name, $data);
        \assert($type instanceof self);

        foreach ($data as $key => $value) {
            switch ($key) {
                case 'pattern':
                    $type->setPattern($value);

                    break;
                case 'minLength':
                    $type->setMinLength($value);

                    break;
                case 'maxLength':
                    $type->setMaxLength($value);

                    break;
            }
        }

        return $type;
    }
647447
public static function createFromArray($name, array $data = [])
    {
        $proxy = new static($name);
        $proxy->setDefinition($data);
        if (!isset($data['type'])) {
            throw new \InvalidArgumentException('Missing "type" key in $data param to determine datatype!');
        }
        if (isset($data['properties'])) {
            $proxy->properties = $data['properties'];
        }

        $proxy->setType($data['type']);
        if ($name !== $data['type']) {
            $proxy->setParent($data['type']);
        }

        return $proxy;
    }
726487
public function doReAuthorization($authorization_id, $amount, $data = [])
    {
        $this->setRequestData(
            array_merge($data, [
                'AUTHORIZATIONID' => $authorization_id,
                'AMOUNT'          => $amount,
            ])
        );

        return $this->doPayPalRequest('DoReauthorization');
    }
516123
public static function factory($resource, $data, $name = null)
    {
        $instance = new static();

        $instance->id = (string) Uuid::uuid4();

        $instance->name = self::makeName($data, $name);

        $instance->display = $instance->name;

        $instance->resource = $resource;

        $instance->importProperties($data);

        return $instance;
    }
34727
public function deleteRoleAssignment(
        RoleAssignmentDeleteData $data,
        ?string $name = null
    ): FormInterface {
        $role = $data->getRoleAssignment()->getRole()->id;
        $limitation = !empty($data->getRoleAssignment()->getRoleLimitation())
            ? $data->getRoleAssignment()->getRoleLimitation()->getIdentifier()
            : 'none';

        $name = $name ?: sprintf('delete-role-assignment-%s', md5(
            implode('/', [$role, $limitation])
        ));

        return $this->formFactory->createNamed($name, RoleAssignmentDeleteType::class, $data);
    }
1221040
protected function _newInput(array $data, $name = null)
    {
        $options = array();
        foreach (array_keys($this->_inputProperties) as $key) {
            if (isset($data[$key])) {
                $options[$key] = $data[$key];
            }
        }
        $input = new Input($name, $options);

        if (isset($data['filters'])) {
            $this->_addFilters($input, $data['filters']);
        }

        if (isset($data['validation'])) {
            $this->_addValidators($input, $data['validation']);
        }
        return $input;
    }
451343
public function set($data, $scope, $name)
    {
        $scope = $this->sanitizeInput($scope);
        $name = $this->sanitizeInput($name);

        if (empty($scope) || empty($name)) {
            return false;
        }

        $this->changedData[$scope][$name] = $data;
    }
975446
public function createPolicyWithLimitation(
        ?PolicyCreateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(PolicyCreateWithLimitationType::class);

        return $this->formFactory->createNamed($name, PolicyCreateWithLimitationType::class, $data);
    }
327360
public function template($name, $data = null)
  {
    $t = $this->getTemplatesEngine()->make($name);

    if ($data) {
      $t->data($data);
    }

    return $t;
  }
237209
public function viewIf($condition, string $name, array $data = null)
    {
        return $this->addIf($condition, View::create($name, $data));
    }
1329130
public function render($name, array $data = [])
    {
        if (!isset($this->response)) {
            throw new \LogicException(
                sprintf('Invalid %s object instance', ResponseInterface::class)
            );
        }

        return $this->response->write($this->plates->render($name, $data));
    }
1349737
private function funcCondition($name, $arg = null)
    {
        $this->getExpr()->addCondition(new ConditionFunc(
            $name,
            $this,
            $arg !== null ? $this->getExpr()->value($arg) : null
        ));

        return $this->getExpr();
    }
451935
public function setCustomActions($name, $data = null)
    {
        $actions = is_array($name) ? $name : [$name => $data];

        foreach ($actions as $key => $value) {
            $this->customActions[$key] = $value;
        }

        return $this;
    }
1027415
public function resetAuthorization($authorization, $client_id, $access_token) {
        $instance = new resetAuthorization($this, $this->getUserAgent(), $authorization, $client_id, $access_token);
        return $instance;
    }
853284
protected function getTemplate($name, array $data)
    {
        $template = App::instance()->template($name);

        if (!$template->exists()) {
            throw new Exception("The template '{$name}' does not exist.");
        }

        return $template->render($data);
    }