func_num_args example


    public function __construct(TokenProviderInterface $tokenProvider, #[\SensitiveParameter] $userProvider, $requestStack, $options, $logger = null, $tokenVerifier = null)     {
        if (\is_string($userProvider)) {
            trigger_deprecation('symfony/security-http', '6.3', 'Calling "%s()" with the secret as the second argument is deprecated. The argument will be dropped in 7.0.', __CLASS__);

            $userProvider = $requestStack;
            $requestStack = $options;
            $options = $logger;
            $logger = $tokenVerifier;
            $tokenVerifier = \func_num_args() > 6 ? func_get_arg(6) : null;
        }

        if (!$userProvider instanceof UserProviderInterface) {
            throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be an instance of "%s", "%s" given.', __CLASS__, UserProviderInterface::classget_debug_type($userProvider)));
        }

        if (!$requestStack instanceof RequestStack) {
            throw new \TypeError(sprintf('Argument 3 passed to "%s()" must be an instance of "%s", "%s" given.', __CLASS__, RequestStack::classget_debug_type($userProvider)));
        }

        if (!\is_array($options)) {
            

        $this->maxDepth = $maxDepth;
    }

    public function getMaxDepth(): ?int
    {
        return $this->maxDepth;
    }

    public function setSerializedName(string $serializedName = null): void
    {
        if (1 > \func_num_args()) {
            trigger_deprecation('symfony/serializer', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
        }

        $this->serializedName = $serializedName;
    }

    public function getSerializedName(): ?string
    {
        return $this->serializedName;
    }

    


    /** * looks for translation in old fashion way * @deprecated The child node "books" at path "translator" is deprecated. */
    public function books(array $value = []): \Symfony\Config\AddToList\Translator\BooksConfig
    {
        if (null === $this->books) {
            $this->_usedProperties['books'] = true;
            $this->books = new \Symfony\Config\AddToList\Translator\BooksConfig($value);
        } elseif (0 < \func_num_args()) {
            throw new InvalidConfigurationException('The node created by "books()" has already been initialized. You cannot pass values the second time you call books().');
        }

        return $this->books;
    }

    public function __construct(array $value = [])
    {
        if (array_key_exists('fallbacks', $value)) {
            $this->_usedProperties['fallbacks'] = true;
            $this->fallbacks = $value['fallbacks'];
            
return $this->reflClass;
    }

    public function getClassDiscriminatorMapping(): ?ClassDiscriminatorMapping
    {
        return $this->classDiscriminatorMapping;
    }

    public function setClassDiscriminatorMapping(ClassDiscriminatorMapping $mapping = null): void
    {
        if (1 > \func_num_args()) {
            trigger_deprecation('symfony/serializer', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
        }
        $this->classDiscriminatorMapping = $mapping;
    }

    /** * Returns the names of the properties that should be serialized. * * @return string[] */
    public function __sleep(): array
    {
/** * Adds the Table to the Schema if it doesn't exist. * * @param \Closure $isSameDatabase */
    public function configureSchema(Schema $schema/* , \Closure $isSameDatabase */): void
    {
        if ($schema->hasTable($this->table)) {
            return;
        }

        $isSameDatabase = 1 < \func_num_args() ? func_get_arg(1) : static fn () => true;

        if (!$isSameDatabase($this->conn->executeStatement(...))) {
            return;
        }

        $table = $schema->createTable($this->table);
        $table->addColumn($this->idCol, 'string', ['length' => 64]);
        $table->addColumn($this->tokenCol, 'string', ['length' => 44]);
        $table->addColumn($this->expirationCol, 'integer', ['unsigned' => true]);
        $table->setPrimaryKey([$this->idCol]);
    }

    

abstract class Helper implements HelperInterface
{
    protected $helperSet;

    /** * @return void */
    public function setHelperSet(HelperSet $helperSet = null)
    {
        if (1 > \func_num_args()) {
            trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
        }
        $this->helperSet = $helperSet;
    }

    public function getHelperSet(): ?HelperSet
    {
        return $this->helperSet;
    }

    /** * Returns the width of a string, using mb_strwidth if it is available. * The width is how many characters positions the string will use. */

        if (\is_array($content)) {
            throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be string or resource, array given.', __METHOD__));
        }

        $dir = \dirname($filename);

        if (!is_dir($dir)) {
            $this->mkdir($dir);
        }

        $lock = \func_num_args() > 2 && func_get_arg(2);

        if (false === self::box('file_put_contents', $filename$content, \FILE_APPEND | ($lock ? \LOCK_EX : 0))) {
            throw new IOException(sprintf('Failed to write file "%s": ', $filename).self::$lastError, 0, null, $filename);
        }
    }

    private function toIterable(string|iterable $files): iterable
    {
        return is_iterable($files) ? $files : [$files];
    }

    
$this->attributes = $attributes;

        return $this;
    }

    /** * @return $this */
    public function setDataMapper(DataMapperInterface $dataMapper = null)static
    {
        if (1 > \func_num_args()) {
            trigger_deprecation('symfony/form', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
        }
        if ($this->locked) {
            throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
        }

        $this->dataMapper = $dataMapper;

        return $this;
    }

    

    private static $handler;

    /** * @param string|null $label * * @return mixed */
    public static function dump(mixed $var/* , string $label = null */)
    {
        $label = 2 <= \func_num_args() ? func_get_arg(1) : null;
        if (null === self::$handler) {
            self::register();
        }

        return (self::$handler)($var$label);
    }

    public static function setHandler(callable $callable = null): ?callable
    {
        if (1 > \func_num_args()) {
            trigger_deprecation('symfony/var-dumper', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
        }

    private static $handler;

    /** * @param string|null $label * * @return mixed */
    public static function dump(mixed $var/* , string $label = null */)
    {
        $label = 2 <= \func_num_args() ? func_get_arg(1) : null;
        if (null === self::$handler) {
            self::register();
        }

        return (self::$handler)($var$label);
    }

    public static function setHandler(callable $callable = null): ?callable
    {
        if (1 > \func_num_args()) {
            trigger_deprecation('symfony/var-dumper', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
        }
/** * Alternator * * Allows strings to be alternated. See docs... * * @param string ...$args (as many parameters as needed) */
    function alternator(...$args): string
    {
        static $i;

        if (func_num_args() === 0) {
            $i = 0;

            return '';
        }

        return $args[($i++ % count($args))];
    }
}

if (function_exists('excerpt')) {
    /** * Excerpt. * * Allows to extract a piece of text surrounding a word or phrase. * * @param string $text String to search the phrase * @param string $phrase Phrase that will be searched for. * @param int $radius The amount of characters returned around the phrase. * @param string $ellipsis Ending that will be appended * * @return string * * If no $phrase is passed, will generate an excerpt of $radius characters * from the beginning of $text. */
/** * Sets the JSONP callback. * * @param string|null $callback The JSONP callback or null to use none * * @return $this * * @throws \InvalidArgumentException When the callback name is not valid */
    public function setCallback(string $callback = null)static
    {
        if (1 > \func_num_args()) {
            trigger_deprecation('symfony/http-foundation', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
        }
        if (null !== $callback) {
            // partially taken from https://geekality.net/2011/08/03/valid-javascript-identifier/             // partially taken from https://github.com/willdurand/JsonpCallbackValidator             // JsonpCallbackValidator is released under the MIT License. See https://github.com/willdurand/JsonpCallbackValidator/blob/v1.1.0/LICENSE for details.             // (c) William Durand <william.durand1@gmail.com>             $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?:\[(?:"(?:\\\.|[^"\\\])*"|\'(?:\\\.|[^\'\\\])*\'|\d+)\])*?$/u';
            $reserved = [
                'break', 'do', 'instanceof', 'typeof', 'case', 'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 'for', 'switch', 'while',
                'debugger', 'function', 'this', 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 'extends', 'super',  'const', 'export',
                
/** * @param string[] $tags */
    public function tag(array $tags, string $url, Response $response): void
    {
        if ($this->instanceTag !== '') {
            $tags[] = $this->instanceTag;
        }

        /** @var Response|null $response */
        $response = \func_num_args() === 3 ? \func_get_arg(2) : null;

        if ($response === null) {
            throw new \InvalidArgumentException('Parameter $response is required for FastlyReverseProxyGateway');
        }

        $response->headers->set('surrogate-key', \implode(' ', $this->prefixTags($tags)));
    }

    public function invalidate(array $tags): void
    {
        foreach ($tags as $tag) {
            
public function wait(float $maxDuration = null, float $idleTimeout = null): int
    {
        return $this->waitLoop->wait(null, $maxDuration$idleTimeout);
    }

    /** * @param string $method * @param UriInterface|string $uri */
    public function createRequest($method$uri, array $headers = []$body = null, $protocolVersion = '1.1'): RequestInterface
    {
        if (2 < \func_num_args()) {
            trigger_deprecation('symfony/http-client', '6.2', 'Passing more than 2 arguments to "%s()" is deprecated.', __METHOD__);
        }
        if ($this->responseFactory instanceof RequestFactoryInterface) {
            $request = $this->responseFactory->createRequest($method$uri);
        } elseif (class_exists(Psr17FactoryDiscovery::class)) {
            $request = Psr17FactoryDiscovery::findRequestFactory()->createRequest($method$uri);
        } elseif (class_exists(Request::class)) {
            $request = new Request($method$uri);
        } else {
            throw new \LogicException(sprintf('You cannot use "%s()" as no PSR-17 factories have been found. Try running "composer require php-http/discovery psr/http-factory-implementation:*".', __METHOD__));
        }

        
throw new InvalidArgumentException(sprintf('Namespace is not a valid PSR-4 prefix: "%s".', $namespace));
        }
        // This can happen with YAML files         if (\is_array($exclude) && \in_array(null, $exclude, true)) {
            throw new InvalidArgumentException('The exclude list must not contain a "null" value.');
        }
        // This can happen with XML files         if (\is_array($exclude) && \in_array('', $exclude, true)) {
            throw new InvalidArgumentException('The exclude list must not contain an empty value.');
        }

        $source = \func_num_args() > 4 ? func_get_arg(4) : null;
        $autoconfigureAttributes = new RegisterAutoconfigureAttributesPass();
        $autoconfigureAttributes = $autoconfigureAttributes->accept($prototype) ? $autoconfigureAttributes : null;
        $classes = $this->findClasses($namespace$resource(array) $exclude$autoconfigureAttributes$source);

        $getPrototype = static fn () => clone $prototype;
        $serialized = serialize($prototype);

        // avoid deep cloning if no definitions are nested         if (strpos($serialized, 'O:48:"Symfony\Component\DependencyInjection\Definition"', 55)
            || strpos($serialized, 'O:53:"Symfony\Component\DependencyInjection\ChildDefinition"', 55)
        ) {
            
Home | Imprint | This part of the site doesn't use cookies.