end example


  }

  /** * Tests that all core entity types have JSON:API test coverage. */
  public function testEntityTypeRestTestCoverage() {
    $problems = [];
    foreach ($this->definitions as $entity_type_id => $info) {
      $class_name_full = $info->getClass();
      $parts = explode('\\', $class_name_full);
      $class_name = end($parts);
      $module_name = $parts[1];

      $possible_paths = [
        'Drupal\Tests\jsonapi\Functional\CLASSTest',
        '\Drupal\Tests\\' . $module_name . '\Functional\Jsonapi\CLASSTest',
      ];
      foreach ($possible_paths as $path) {
        $missing_tests = [];
        $class = str_replace('CLASS', $class_name$path);
        if (class_exists($class)) {
          break;
        }
public function stream_stat(): array|false
    {
        if (!$stat = stat($this->path)) {
            return false;
        }

        $h = fopen($this->path, 'r');
        fseek($h, -4, \SEEK_END);
        $size = unpack('V', fread($h, 4));
        fclose($h);

        $stat[7] = $stat['size'] = end($size);

        return $stat;
    }
}

    public function checkPrivilege($privilege$resource = null)
    {
        if (!$this->getRole() || !$this->getAcl()) {
            throw new ApiException\PrivilegeException('Unable to get role or acl');
        }

        if (!$resource) {
            $calledClass = \get_called_class();
            $calledClass = explode('\\', $calledClass);
            $resource = strtolower(end($calledClass));
        }

        if (!$this->getAcl()->has($resource)) {
            throw new ApiException\PrivilegeException(sprintf('No resource "%s" found', $resource));
        }

        $role = $this->getRole();

        if (!$this->getAcl()->isAllowed($role$resource$privilege)) {
            throw new ApiException\PrivilegeException(sprintf('Role "%s" is not allowed to "%s" on resource "%s"', \is_string($role) ? $role : $role->getRoleId()$privilege, \is_string($resource) ? $resource : $resource->getResourceId()));
        }
    }
public function addConfiguration(NodeDefinition $node): void
    {
        $builder = $node
            ->fixXmlConfig('user_provider')
            ->children()
        ;

        $builder
            ->scalarNode('secret')
                ->cannotBeEmpty()
                ->defaultValue('%kernel.secret%')
            ->end()
            ->scalarNode('service')->end()
            ->arrayNode('user_providers')
                ->beforeNormalization()
                    ->ifString()->then(fn ($v) => [$v])
                ->end()
                ->prototype('scalar')->end()
            ->end()
            ->booleanNode('catch_exceptions')->defaultTrue()->end()
            ->arrayNode('signature_properties')
                ->prototype('scalar')->end()
                ->requiresAtLeastOneElement()
                
<?php
use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator;

return static function DDefinitionConfigurator $definition) {
    $definition->rootNode()
        ->children()
            ->scalarNode('baz')->defaultValue('multi')->end()
        ->end()
    ;
};
    // any other database, and it will cease to exist when the connection is     // closed.     $connection_options = ['database' => ':memory:'];
    $pdo = Connection::open($connection_options);
    $connection = new Connection($pdo$connection_options);

    // Create the tables and fill them with data.     foreach ($source_data as $table => $rows) {
      // Use the biggest row to build the table schema.       $counts = array_map('count', $rows);
      asort($counts);
      end($counts);
      $pilot = $rows[key($counts)];

      $connection->schema()
        ->createTable($table[
          // SQLite uses loose affinity typing, so it's OK for every field to           // be a text field.           'fields' => array_map(function D) {
            return ['type' => 'text'];
          }$pilot),
        ]);

      
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

class Placeholders implements ConfigurationInterface
{
    public function getConfigTreeBuilder(): TreeBuilder
    {
        $tb = new TreeBuilder('placeholders');
        $rootNode = $tb->getRootNode();
        $rootNode
            ->children()
                ->booleanNode('enabled')->defaultFalse()->end()
                ->floatNode('favorite_float')->end()
                ->arrayNode('good_integers')
                    ->integerPrototype()->end()
                ->end()
            ->end()
        ;

        return $tb;
    }
}


        $parts = explode('\\', $phpFunctionName);
        if (!$expressionFunctionName && \count($parts) > 1) {
            throw new \InvalidArgumentException(sprintf('An expression function name must be defined when PHP function "%s" is namespaced.', $phpFunctionName));
        }

        $compiler = fn (...$args) => sprintf('\%s(%s)', $phpFunctionNameimplode(', ', $args));

        $evaluator = fn ($p, ...$args) => $phpFunctionName(...$args);

        return new self($expressionFunctionName ?: end($parts)$compiler$evaluator);
    }
}
'on' => $location ?? 'bottom-start',
            ],
            // Shepherd expects classes to be provided as a string.             'classes' => implode(' ', $classes),
          ] + $output;
        }
      }
    }

    // If there is at least one tour item, build the tour.     if ($items) {
      end($items);
      $key = key($items);
      $items[$key]['cancelText'] = t('End tour');
    }

    $build = [
      '#cache' => [
        'tags' => $cache_tags,
      ],
    ];

    // If at least one tour was built, attach tips and the tour library.
return $this;
    }

    /** * Determines the alias name based on the table */
    protected function createAliasFromTable(string $item): string
    {
        if (strpos($item, '.') !== false) {
            $item = explode('.', $item);

            return end($item);
        }

        return $item;
    }

    /** * Sets a flag which tells the query string compiler to add DISTINCT * * @return $this */
    public function distinct(bool $val = true)
    {
$this->assertEmpty($container->getResources(), 'No resources get registered without resource tracking');

        $container->setResourceTracking(true);
        $container->addObjectResource(new \BarClass());

        $resources = $container->getResources();

        $this->assertCount(1, $resources);

        /* @var $resource \Symfony\Component\Config\Resource\FileResource */
        $resource = end($resources);

        $this->assertInstanceOf(FileResource::class$resource);
        $this->assertSame(realpath(__DIR__.'/Fixtures/includes/classes.php')realpath($resource->getResource()));
    }

    public function testGetReflectionClass()
    {
        $container = new ContainerBuilder();

        $container->setResourceTracking(false);
        $r1 = $container->getReflectionClass('BarClass');

        
public function __construct(Command $command)
    {
        $this->command = $command;
    }

    /** * Create completion suggestions from input tokens. */
    public function complete(array $input): array
    {
        $currentIndex = \count($input);
        if ('' === end($input)) {
            array_pop($input);
        }
        array_unshift($input$this->command->getName());

        $completionInput = CompletionInput::fromTokens($input$currentIndex);
        $completionInput->bind($this->command->getDefinition());
        $suggestions = new CompletionSuggestions();

        $this->command->complete($completionInput$suggestions);

        $options = [];
        


    public function addConfiguration(NodeBuilder $node): void
    {
        $node
            ->arrayNode($this->getKey())
                ->fixXmlConfig($this->getKey())
                ->children()
                    ->scalarNode('claim')
                        ->info('Claim which contains the user identifier (e.g.: sub, email..).')
                        ->defaultValue('sub')
                    ->end()
                    ->scalarNode('audience')
                        ->info('Audience set in the token, for validation purpose.')
                        ->isRequired()
                    ->end()
                    ->arrayNode('issuers')
                        ->info('Issuers allowed to generate the token, for validation purpose.')
                        ->isRequired()
                        ->prototype('scalar')->end()
                    ->end()
                    ->scalarNode('algorithm')
                        ->info('Algorithm used to sign the token.')
                        

function current_filter() {
    global $wp_current_filter;

    return end( $wp_current_filter );
}

/** * Returns whether or not a filter hook is currently being processed. * * The function current_filter() only returns the most recent filter being executed. * did_filter() returns the number of times a filter has been applied during * the current request. * * This function allows detection for any filter currently being executed * (regardless of whether it's the most recent filter to fire, in the case of * hooks called from hook callbacks) to be verified. * * @since 3.9.0 * * @see current_filter() * @see did_filter() * @global string[] $wp_current_filter Current filter. * * @param string|null $hook_name Optional. Filter hook to check. Defaults to null, * which checks if any filter is currently being run. * @return bool Whether the filter is currently in the stack. */
if (!\is_file($pathToComposerJson)) {
            throw new \RuntimeException('Could not auto detect plugin name via composer.json. Path: ' . $pathToComposerJson);
        }

        $composer = json_decode((string) file_get_contents($pathToComposerJson), true, 512, \JSON_THROW_ON_ERROR);
        $baseClass = $composer['extra']['shopware-plugin-class'] ?? '';
        if ($baseClass === '') {
            throw new \RuntimeException('composer.json does not contain `extra.shopware-plugin-class`. Path: ' . $pathToComposerJson);
        }

        $parts = explode('\\', (string) $baseClass);
        $pluginName = end($parts);

        $this->addActivePlugins($pluginName);

        return $this;
    }

    public function setPlatformEmbedded(bool $platformEmbedded): TestBootstrapper
    {
        $this->platformEmbedded = $platformEmbedded;

        return $this;
    }
Home | Imprint | This part of the site doesn't use cookies.