remove example

static::assertEquals(
            new CalculatedPrice(1, 1, new CalculatedTaxCollection()new TaxRuleCollection()),
            $collection->get(0)
        );

        static::assertEquals(
            new CalculatedPrice(2, 2, new CalculatedTaxCollection()new TaxRuleCollection()),
            $collection->get(1)
        );

        $collection->remove(0);
        $collection->remove(1);
        static::assertNull($collection->get(0));
        static::assertNull($collection->get(1));
    }
}


    /** * Removes the provided code to the current cart. */
    public function removePromotionCode(string $code, Cart $cart, CartService $cartService, SalesChannelContext $context): Cart
    {
        $promotions = $cart->getLineItems()->filterType(PromotionProcessor::LINE_ITEM_TYPE);

        foreach ($promotions->getElements() as $promotion) {
            if ($promotion->getReferencedId() === $code) {
                return $cartService->remove($cart$promotion->getId()$context);
            }
        }

        return $cart;
    }

    /** * Gets all promotion codes that have been added * to the current session. * * @return array<mixed> */
public function remove(string $key)
    {
        $uniqueKey = strtr($key, self::UPPER, self::LOWER);
        unset($this->headerNames[$uniqueKey]);

        if ('set-cookie' === $uniqueKey) {
            $this->cookies = [];

            return;
        }

        parent::remove($key);

        if ('cache-control' === $uniqueKey) {
            $this->computedCacheControl = [];
        }

        if ('date' === $uniqueKey) {
            $this->initDate();
        }
    }

    public function hasCacheControlDirective(string $key): bool
    {
// determine the "real" sender         if (!$headers->has('Sender') && \count($froms = $headers->get('From')->getAddresses()) > 1) {
            $headers->addMailboxHeader('Sender', $froms[0]);
        }

        if (!$headers->has('Message-ID')) {
            $headers->addIdHeader('Message-ID', $this->generateMessageId());
        }

        // remove the Bcc field which should NOT be part of the sent message         $headers->remove('Bcc');

        return $headers;
    }

    public function toString(): string
    {
        if (null === $body = $this->getBody()) {
            $body = new TextPart('');
        }

        return $this->getPreparedHeaders()->toString().$body->toString();
    }
 else {
    // Always build genrb so that we can determine the ICU version of the     // download by running genrb --version     echo "Building genrb.\n";

    cd($sourceDir);

    echo "Running configure...\n";

    $buildDir = sys_get_temp_dir().'/icu-data/'.$shortIcuVersion.'/build';

    $filesystem->remove($buildDir);
    $filesystem->mkdir($buildDir);

    run('./configure --prefix='.$buildDir.' 2>&1');

    echo "Running make...\n";

    // If the directory "lib" does not exist in the download, create it or we     // will run into problems when building libicuuc.so.     $filesystem->mkdir($sourceDir.'/lib');

    // If the directory "bin" does not exist in the download, create it or we
$generator
        ));

        $tester->execute([
            '--force' => true,
            '--private-key-path' => $tmpDir . '/private.pem',
            '--public-key-path' => $tmpDir . '/public.pem',
        ]);

        static::assertSame(Command::SUCCESS, $tester->getStatusCode());

        $fs->remove($tmpDir);
    }

    private function getGenerator(): JwtCertificateGenerator&MockObject
    {
        $jwtCertificateGenerator = $this->createMock(JwtCertificateGenerator::class);
        $jwtCertificateGenerator
            ->method('generateString')
            ->willReturn(['1', '2']);

        return $jwtCertificateGenerator;
    }
}
        $remoteAddr = $request->server->get('REMOTE_ADDR');
        if (!$remoteAddr || !IpUtils::checkIp($remoteAddr$trustedProxies)) {
            $trustedHeaders = [
                'FORWARDED' => $trustedHeaderSet & Request::HEADER_FORWARDED,
                'X_FORWARDED_FOR' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_FOR,
                'X_FORWARDED_HOST' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_HOST,
                'X_FORWARDED_PROTO' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_PROTO,
                'X_FORWARDED_PORT' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_PORT,
                'X_FORWARDED_PREFIX' => $trustedHeaderSet & Request::HEADER_X_FORWARDED_PREFIX,
            ];
            foreach (array_filter($trustedHeaders) as $name => $key) {
                $request->headers->remove($name);
                $request->server->remove('HTTP_'.$name);
            }
        }

        // compute trusted values, taking any trusted proxies into account         $trustedIps = [];
        $trustedValues = [];
        foreach (array_reverse($request->getClientIps()) as $ip) {
            $trustedIps[] = $ip;
            $trustedValues[] = sprintf('for="%s"', $ip);
        }
        
/** * {@inheritdoc} */
  public function setActiveWorkspace(WorkspaceInterface $workspace) {
    $this->session->set('active_workspace_id', $workspace->id());
  }

  /** * {@inheritdoc} */
  public function unsetActiveWorkspace() {
    $this->session->remove('active_workspace_id');
  }

}
$tagsToKeep = [];

        if ($container->hasParameter('container.behavior_describing_tags')) {
            $tagsToKeep = $container->getParameter('container.behavior_describing_tags');
        }

        foreach ($container->getDefinitions() as $id => $definition) {
            $container->setDefinition($id$this->processDefinition($container$id$definition$tagsToKeep));
        }

        if ($container->hasParameter('container.behavior_describing_tags')) {
            $container->getParameterBag()->remove('container.behavior_describing_tags');
        }
    }

    private function processDefinition(ContainerBuilder $container, string $id, Definition $definition, array $tagsToKeep): Definition
    {
        $instanceofConditionals = $definition->getInstanceofConditionals();
        $autoconfiguredInstanceof = $definition->isAutoconfigured() ? $container->getAutoconfiguredInstanceof() : [];
        if (!$instanceofConditionals && !$autoconfiguredInstanceof) {
            return $definition;
        }

        
$facade->notice('notice');

        static::assertCount(3, $facade);
        static::assertTrue($facade->has('warning'));
        static::assertTrue($facade->has('error'));
        static::assertTrue($facade->has('notice'));

        $facade->warning('duplicate');
        $facade->warning('duplicate');
        static::assertTrue($facade->has('duplicate'));
        static::assertCount(4, $facade);
        $facade->remove('duplicate');
        static::assertFalse($facade->has('duplicate'));
        static::assertCount(3, $facade);

        static::assertInstanceOf(Error::class$facade->get('error'));
        static::assertEquals(Error::LEVEL_ERROR, $facade->get('error')->getLevel());
        static::assertInstanceOf(Error::class$facade->get('warning'));
        static::assertEquals(Error::LEVEL_WARNING, $facade->get('warning')->getLevel());
        static::assertInstanceOf(Error::class$facade->get('notice'));
        static::assertEquals(Error::LEVEL_NOTICE, $facade->get('notice')->getLevel());
    }
}
$path = new PropertyPath('new1.new2.new3');
        $expected = new PropertyPath('new1.new2.new3.old2');

        $builder = new PropertyPathBuilder(new PropertyPath('old1.old2'));
        $builder->replace(0, 1, $path);

        $this->assertEquals($expected$builder->getPropertyPath());
    }

    public function testRemove()
    {
        $this->builder->remove(3);

        $path = new PropertyPath('old1[old2].old3[old5].old6');

        $this->assertEquals($path$this->builder->getPropertyPath());
    }

    public function testRemoveDoesNotAllowInvalidOffsets()
    {
        $this->expectException(\OutOfBoundsException::class);
        $this->builder->remove(6);
    }

    
$store->set($this->entity->uuid()$form_state);

    $route_parameters = [
      'node_preview' => $this->entity->uuid(),
      'view_mode_id' => 'full',
    ];

    $options = [];
    $query = $this->getRequest()->query;
    if ($query->has('destination')) {
      $options['query']['destination'] = $query->get('destination');
      $query->remove('destination');
    }
    $form_state->setRedirect('entity.node.preview', $route_parameters$options);
  }

  /** * {@inheritdoc} */
  public function save(array $form, FormStateInterface $form_state) {
    $node = $this->entity;
    $insert = $node->isNew();
    $node->save();
    
$fs->mirror($path$appDir);

        if ($install) {
            $this->getContainer()->get(AbstractStoreAppLifecycleService::class)->installExtension($name, Context::createDefaultContext());
        }
    }

    public function removeApp(string $path): void
    {
        $fs = new Filesystem();

        $fs->remove($this->getContainer()->getParameter('shopware.app_dir') . '/' . basename($path));
    }

    public function registerPlugin(string $path): void
    {
        $fs = new Filesystem();

        $name = basename($path);
        $pluginDir = $this->getContainer()->getParameter('kernel.plugin_dir') . '/' . $name;
        $fs->mirror($path$pluginDir);
    }

    
$is_allowed = authorize_access_allowed($request);

// Build content. if ($is_allowed) {
  // Load both the Form API and Batch API.   require_once __DIR__ . '/includes/form.inc';
  require_once __DIR__ . '/includes/batch.inc';

  $page_title = $request->getSession()->get('authorize_page_title', t('Authorize file system changes'));

  // See if we've run the operation and need to display a report.   if ($results = $request->getSession()->remove('authorize_results')) {

    // Clear the session out.     $request->getSession()->remove('authorize_operation');
    $request->getSession()->remove('authorize_filetransfer_info');

    if (!empty($results['page_title'])) {
      $page_title = $results['page_title'];
    }
    if (!empty($results['page_message'])) {
      \Drupal::messenger()->addMessage($results['page_message']['message']$results['page_message']['type']);
    }

    
return parent::send($message$envelope);
    }

    private function addOhMySmtpHeaders(Message $message): void
    {
        $headers = $message->getHeaders();

        foreach ($headers->all() as $name => $header) {
            if ($header instanceof TagHeader) {
                if (null != $headers->get('X-OMS-Tags')) {
                    $existing = $headers->get('X-OMS-Tags')->getBody();
                    $headers->remove('X-OMS-Tags');
                    $headers->addTextHeader('X-OMS-Tags', $existing.', '.$header->getValue());
                } else {
                    $headers->addTextHeader('X-OMS-Tags', $header->getValue());
                }
                $headers->remove($name);
            }
        }
    }
}
Home | Imprint | This part of the site doesn't use cookies.