Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ArgumentTrait.php

trait ArgumentTrait

Hierarchy

  • trait \Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait

File

vendor/symfony/dependency-injection/Loader/Configurator/Traits/ArgumentTrait.php, line 14

Namespace

Symfony\Component\DependencyInjection\Loader\Configurator\Traits
View source
trait ArgumentTrait {
    
    /**
     * Sets the arguments to pass to the service constructor/factory method.
     *
     * @return $this
     */
    public final function args(array $arguments) : static {
        $this->definition
            ->setArguments(static::processValue($arguments, true));
        return $this;
    }
    
    /**
     * Sets one argument to pass to the service constructor/factory method.
     *
     * @return $this
     */
    public final function arg(string|int $key, mixed $value) : static {
        $this->definition
            ->setArgument($key, static::processValue($value, true));
        return $this;
    }

}

Members

Title Sort descending Modifiers Object type Summary
ArgumentTrait::arg final public function Sets one argument to pass to the service constructor/factory method.
ArgumentTrait::args final public function Sets the arguments to pass to the service constructor/factory method.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal