Constructor

@param string $name The name
@param string $type Optional the type name (default: string)
@param array $settings Optional the settings hash array (default: NULL)
354379
public function PhpWsdlParam($name,$type='string',$settings=null){
		PhpWsdl::Debug('New parameter '.$name);
		parent::PhpWsdlObject($name,$settings);
		$this->Type=$type;
	}
1354009
public static function passive(string $name, Type $type): self
    {
        $self = new self($name, $type);
        $self->passive = true;

        return $self;
    }
1014655
protected function makeField($name, $type = 'text', array $options = [])
    {
        $this->setupFieldOptions($name, $options);

        $fieldName = $this->getFieldName($name);

        $fieldType = $this->getFieldType($type);

        $field = new $fieldType($fieldName, $type, $this, $options);

        $this->eventDispatcher->dispatch(new AfterFieldCreation($this, $field));

        return $field;
    }
300532
public function addType(Type $type, $name = '')
    {
        if (!$name) {
            $name = (string)$type;
        }

        $this->types[$name] = $type;
    }
191657
public function createForm($name, $type = "form", array $data = array(), array $options = array())
    {
        if (empty($name)) {
            $name = static::EMPTY_FORM_NAME;
        }

        return $this->getTheliaFormFactory()->createForm($name, $type, $data, $options);
    }
1243733
public function add( $name, $type = Type::TEXT, $rules = [] ) {
		$this->fields[$name] = new Field($name, $type, $rules);
		$this->types = [];	// clear this so it will be refreshed when we've finished adding fields
		return $this;
	}
1253759
protected function createProperty($name, Type $type, $namespace, $default = null)
    {
        $propertyName = $this->getNaming()->getPropertyName($name);
        $property     = new Stmt\PropertyProperty($propertyName);

        if ($default !== null) {
            $property->default = new Expr\ConstFetch(new Name($default));
        }

        return new Stmt\Property(Stmt\Class_::MODIFIER_PROTECTED, [
            $property
        ], [
            'comments' => [$this->createPropertyDoc($type, $namespace)]
        ]);
    }
199183
private function mkstr($name, $type = 'string', $options = array())
    {
        $result = "  define('$name', ";
        $quot = "'";
        $value = isset($_POST[$name]) ? $_POST[$name] : null;

        if (isset($options['nobr']) && $options['nobr'])
        {
            $value = str_replace(array("\n", "\r"), ' ', $value);
        }

        if (isset($options['savebr']) && $options['savebr'])
        {
            $value = addcslashes($value, "\n\r\"");
            $quot = '"';
        }

        switch ($type)
        {
            case 'string':
                $value = str_replace(
                    array('\\', $quot),
                    array('\\\\', '\\' . $quot),
                    $value
                );
                $value = $quot . $value . $quot;
                break;
            case 'bool':
                $value = $value ? 'true' : 'false';
                break;
            case 'int':
                $value = intval($value);
                break;
        }
        $result .= $value . ");\n";
        return $result;
    }
692566
public function addField(string $name, $type, array $options = [])
    {
        $this->fields[$name] = array_merge($options, ['type' => $type]);
        if (!isset($options['argument']) || $options['argument'] !== false) {
            $this->arguments[$name] = array_merge($options, ['type' => $type]);
        }

        return $this;
    }
525538
public static function create($name, $type, array $rules = [])
    {
        if (false === ValidatorType::isSupported($type)) {
            throw new ValidatorFactoryException(
                \sprintf('The provided validator type \'%s\' is not supported.', $type)
            );
        }


        $validator = self::createValidator($name, $type);

        return self::applyValidatorRules($validator, $rules);
    }
900578
public function createContainer($name, $type = 'public')
    {
        if (!in_array($type, ['public', 'private', 'gallery'])) {
            throw new InvalidArgumentException('Unknown type "'.$type.'" provided.');
        }

        $response = $this->api->request('PUT', '/'.trim($name, '/'), [
            'headers' => [
                'X-Container-Meta-Type' => $type,
            ],
        ]);

        switch ($response->getStatusCode()) {
            case 201:
                return $this->getContainer(trim($name, '/'));
            case 202:
                throw new ApiRequestFailedException('Container "'.$name.'" already exists.');
            default:
                throw new ApiRequestFailedException('Unable to create container "'.$name.'".', $response->getStatusCode());
        }
    }
316677
public function createProperty($name, $type = NULL, $default = self::UNDEFINED, $modifiers = GProperty::MODIFIER_PROTECTED) {
    $gProperty = GProperty::create($name, $type, $default,  $modifiers);
    
    $this->addProperty($gProperty);
    return $gProperty;
  }
34024
public static function setDescription($name, array $options, $mergeOptions = false)
    {
        if (self::$descriptions === null) {
            self::$descriptions = self::loadDefaultDescriptions();
        }
        if ($mergeOptions && !empty(self::$descriptions[$name])) {
            $options = array_merge(self::$descriptions[$name], $options);
        }
        if (empty($options['type'])) {
            throw new InvalidArgumentException('Type parameter is empty');
        } elseif (!class_exists($options['type'])) {
            throw new InvalidArgumentException('Class does not exist: ' . $options['type']);
        }
        self::$descriptions[$name] = $options;
    }
794930
public static function setter($name, $type)
  {
    $setter = self::method(
      'set' . ucfirst($name),
      [
        new ParameterGenerator($name, $type)
      ]
    );

    $setter->getDocBlock()->setTag(new GenericTag('return', 'static'));

    $body = "\$this->{$name} = \${$name};" . PHP_EOL
    . "return \$this;" . PHP_EOL;

    $setter->setBody($body);

    return $setter;
  }
706549
public static function init($slug, $name, $endpoints = null, $type = Config::TYPE_COLLECTION)
    {
        $instance = new static();

        $instance->route = [];

        if (is_array($name)) {
            $section = key($name);
            $name = $name[$section];
        } else {
            $section = $name;
        }

        $instance->route['slug'] = $slug;
        $instance->route['name'] = $name;
        $instance->route['section'] = $section;
        $instance->route['type'] = $type;
        $instance->route['endpoints'] = self::makeEndpoints($endpoints);
        $instance->route['groups'] = collect([]);
        $instance->route['icon'] = 'filter_list';

        return $instance;
    }
367691
public static function build($name, $type)
	{
		$factory = new BuildFactory(self::config($name), $type);
		$buildNode = $factory->build();
		$buildNode->build();
		return $buildNode->getNodes();
	}
939495
public function is_null(string $name, int $type = null): bool
    {
        if (isset(self::$globalOptions[$name]) && (is_null($type) || $type == self::TYPE_GLOBAL)) {
            return is_null(self::$globalOptions[$name]);
        } else {
            if (isset($this->options[$name]) && (is_null($type) || $type == self::TYPE_LOCAL)) {
                return is_null($this->options[$name]);
            } else {
                return true;
            }
        }
    }