func_get_arg example


function add_permastruct( $name$struct$args = array() ) {
    global $wp_rewrite;

    // Back-compat for the old parameters: $with_front and $ep_mask.     if ( ! is_array( $args ) ) {
        $args = array( 'with_front' => $args );
    }

    if ( func_num_args() === 4 ) {
        $args['ep_mask'] = func_get_arg( 3 );
    }

    $wp_rewrite->add_permastruct( $name$struct$args );
}

/** * Removes a permalink structure. * * Can only be used to remove permastructs that were added using add_permastruct(). * Built-in permastructs cannot be removed. * * @since 4.5.0 * * @see WP_Rewrite::remove_permastruct() * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param string $name Name for permalink structure. */

    public function sendHeaders(/* int $statusCode = null */)static
    {
        // headers have already been sent by the developer         if (headers_sent()) {
            return $this;
        }

        $statusCode = \func_num_args() > 0 ? func_get_arg(0) : null;
        $informationalResponse = $statusCode >= 100 && $statusCode < 200;
        if ($informationalResponse && !\function_exists('headers_send')) {
            // skip informational responses if not supported by the SAPI             return $this;
        }

        // headers         foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
            $newValues = $values;
            $replace = false;

            

    public function __construct($options)
    {
        if ($options instanceof Zend_Config) {
            $options = $options->toArray();
        } else if (!is_array($options)) {
            throw new Zend_Validate_Exception('Array expected as parameter');
        } else {
            $count = func_num_args();
            $temp  = array();
            if ($count > 1) {
                $temp['haystack'] = func_get_arg(0);
                $temp['strict']   = func_get_arg(1);
                $options = $temp;
            } else {
                $temp = func_get_arg(0);
                if (!array_key_exists('haystack', $options)) {
                    $options = array();
                    $options['haystack'] = $temp;
                } else {
                    $options = $temp;
                }
            }
        }

        $this->connection->setup();
    }

    /** * Adds the Table to the Schema if this transport uses this connection. * * @param \Closure $isSameDatabase */
    public function configureSchema(Schema $schema, DbalConnection $forConnection/* , \Closure $isSameDatabase */): void
    {
        $isSameDatabase = 2 < \func_num_args() ? func_get_arg(2) : static fn () => false;

        $this->connection->configureSchema($schema$forConnection$isSameDatabase);
    }

    /** * Adds extra SQL if the given table was created by the Connection. * * @return string[] */
    public function getExtraSetupSqlForTable(Table $createdTable): array
    {
        
/** * @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) {
            
/** * Handles specific route requirements. * * @return array The first element represents the status, the second contains additional information */
    protected function handleRouteRequirements(string $pathinfo, string $name, Route $route/* , array $routeParameters */): array
    {
        if (\func_num_args() < 4) {
            trigger_deprecation('symfony/routing', '6.1', 'The "%s()" method will have a new "array $routeParameters" argument in version 7.0, not defining it is deprecated.', __METHOD__);
            $routeParameters = [];
        } else {
            $routeParameters = func_get_arg(3);

            if (!\is_array($routeParameters)) {
                throw new \TypeError(sprintf('"%s": Argument $routeParameters is expected to be an array, got "%s".', __METHOD__, get_debug_type($routeParameters)));
            }
        }

        // expression condition         if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition()[
            'context' => $this->context,
            'request' => $this->request ?: $this->createRequest($pathinfo),
            'params' => $routeParameters,
        ]))
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);
        // prepare for deep cloning         $serializedPrototype = serialize($prototype);

        foreach ($classes as $class => $errorMessage) {
            if (null === $errorMessage && $autoconfigureAttributes) {
                $r = $this->container->getReflectionClass($class);
                if ($r->getAttributes(Exclude::class)[0] ?? null) {
                    $this->addContainerExcludedTag($class$source);
                    

    protected $defaultRouteIndex = 0;

    private bool $hasDeprecatedAnnotations = false;

    /** * @param string|null $env */
    public function __construct($env = null)
    {
        if ($env instanceof Reader || null === $env && \func_num_args() > 1 && null !== func_get_arg(1)) {
            trigger_deprecation('symfony/routing', '6.4', 'Passing an instance of "%s" as first and the environment as second argument to "%s" is deprecated. Pass the environment as first argument instead.', Reader::class, __METHOD__);

            $this->reader = $env;
            $env = \func_num_args() > 1 ? func_get_arg(1) : null;
        }

        if (\is_string($env) || null === $env) {
            $this->env = $env;
        } elseif ($env instanceof \Stringable || \is_scalar($env)) {
            $this->env = (string) $env;
        } else {
            


    /** * @param \Closure $isSameDatabase */
    public function configureSchema(Schema $schema, Connection $forConnection/* , \Closure $isSameDatabase */): void
    {
        if ($schema->hasTable($this->table)) {
            return;
        }

        $isSameDatabase = 2 < \func_num_args() ? func_get_arg(2) : static fn () => false;

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

        $this->addTableToSchema($schema);
    }

    public function prune(): bool
    {
        $deleteSql = "DELETE FROM $this->table WHERE $this->lifetimeCol + $this->timeCol <= ?";
        
array(
                'time' => time(),
                'data' => $_sidebars_widgets,
            )
        );
    }

    $nav_menu_locations = get_theme_mod( 'nav_menu_locations' );
    update_option( 'theme_switch_menu_locations', $nav_menu_locations );

    if ( func_num_args() > 1 ) {
        $stylesheet = func_get_arg( 1 );
    }

    $old_theme = wp_get_theme();
    $new_theme = wp_get_theme( $stylesheet );
    $template  = $new_theme->get_template();

    if ( wp_is_recovery_mode() ) {
        $paused_themes = wp_paused_themes();
        $paused_themes->delete( $old_theme->get_stylesheet() );
        $paused_themes->delete( $old_theme->get_template() );
    }

    

    public function addBadge(BadgeInterface $badge/* , string $badgeFqcn = null */)static
    {
        $badgeFqcn = $badge::class;
        if (2 === \func_num_args()) {
            $badgeFqcn = func_get_arg(1);
            if (!\is_string($badgeFqcn)) {
                throw new \LogicException(sprintf('Second argument of "%s" must be a string.', __METHOD__));
            }
        }

        $this->badges[$badgeFqcn] = $badge;

        return $this;
    }

    public function hasBadge(string $badgeFqcn): bool
    {

    public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = null */)static
    {
        $suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : [];
        if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) {
            throw new \TypeError(sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues)));
        }
        $this->definition->addArgument(new InputArgument($name$mode$description$default$suggestedValues));
        $this->fullDefinition?->addArgument(new InputArgument($name$mode$description$default$suggestedValues));

        return $this;
    }

    /** * Adds an option. * * @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts * @param $mode The option mode: One of the InputOption::VALUE_* constants * @param $default The default value (must be null for InputOption::VALUE_NONE) * @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion * * @return $this * * @throws InvalidArgumentException If option mode is invalid or incompatible */
/** * Adds the Table to the Schema if "remember me" uses this Connection. * * @param \Closure $isSameDatabase */
    public function configureSchema(Schema $schema, Connection $forConnection/* , \Closure $isSameDatabase */): void
    {
        if ($schema->hasTable('rememberme_token')) {
            return;
        }

        $isSameDatabase = 2 < \func_num_args() ? func_get_arg(2) : static fn () => false;

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

        $this->addTableToSchema($schema);
    }

    private function addTableToSchema(Schema $schema): void
    {
        $table = $schema->createTable('rememberme_token');
        

  public function __construct(EntityStorageInterface $node_storage, EntityStorageInterface $node_type_storage, AccessManagerInterface|Connection $access_manager, DateFormatterInterface $date_formatter) {
    $this->nodeStorage = $node_storage;
    $this->nodeTypeStorage = $node_type_storage;
    $this->accessManager = $access_manager;
    $this->dateFormatter = $date_formatter;
    if ($access_manager instanceof Connection) {
      $this->connection = $access_manager;
      $this->accessManager = func_get_arg(3);
      @trigger_error('Calling ' . __CLASS__ . '::_construct() with the $connection argument is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3343754', E_USER_DEPRECATED);
    }
  }

  /** * {@inheritdoc} */
  public static function create(ContainerInterface $container) {
    $entity_type_manager = $container->get('entity_type.manager');
    return new static(
      $entity_type_manager->getStorage('node'),
      

        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];
    }

    
Home | Imprint | This part of the site doesn't use cookies.