_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q262500
Application.defaults
test
public function defaults(string $commandName, array $argumentDefaults = []): void { $command = $this->get($commandName); $commandDefinition = $command->getDefinition(); foreach ($argumentDefaults as $name => $default) {
php
{ "resource": "" }
q262501
Application.phpBinary
test
public static function phpBinary(): string { $finder = (new PhpExecutableFinder())->find(false);
php
{ "resource": "" }
q262502
Application.cerebroBinary
test
public static function cerebroBinary(): string { $constant = \defined('CEREBRO_BINARY') ?
php
{ "resource": "" }
q262503
Application.doRunCommand
test
protected function doRunCommand(SymfonyCommand $command, InputInterface $input, OutputInterface $output): int { $this->runningCommand = $command; foreach ($command->getHelperSet() as $helper) { if ($helper instanceof InputAwareInterface) { $helper->setInput($input); ...
php
{ "resource": "" }
q262504
Application.getDefaultInputDefinition
test
protected function getDefaultInputDefinition(): InputDefinition { $definition = parent::getDefaultInputDefinition();
php
{ "resource": "" }
q262505
RouteTreeBuilder.build
test
public function build(array $routes): array { $rootRouteData = null; $nodes = []; $groupedRoutes = []; foreach ($routes as $route) { $groupedRoutes[\count($route->getSegments())][] = $route; } if (isset($groupedRoutes[0])) { $rootRout...
php
{ "resource": "" }
q262506
RouteTreeBuilder.addRouteToNode
test
private function addRouteToNode( RouteTreeNode $node, RouteContract $route, array $segments, int $segmentDepth, array $parameterIndexNameMap ): void { if (\count($segments) === 0) { $node->getContents()->addRoute($route, $parameterIndexNameMap); ...
php
{ "resource": "" }
q262507
RouteTreeBuilder.getMatcher
test
private function getMatcher($firstSegment, array &$parameterIndexNameMap): SegmentMatcherContract { if ($firstSegment instanceof ParameterMatcher) {
php
{ "resource": "" }
q262508
FilesystemServiceProvider.createFilesystemManager
test
public static function createFilesystemManager(ContainerInterface $container): FilesystemManager { $manager = new FilesystemManager($container->get('config')); if ($container->has(CacheManagerContract::class)) {
php
{ "resource": "" }
q262509
FilesystemServiceProvider.createCachedFactory
test
public static function createCachedFactory(ContainerInterface $container): CachedFactory { $cache = null; if ($container->has(CacheManagerContract::class)) {
php
{ "resource": "" }
q262510
TraceablePDODecorater.getAccumulatedStatementsDuration
test
public function getAccumulatedStatementsDuration(): int { return \array_reduce($this->executedStatements, static function ($v, $s)
php
{ "resource": "" }
q262511
TraceablePDODecorater.getMemoryUsage
test
public function getMemoryUsage(): int { return \array_reduce($this->executedStatements, static function ($v, $s) {
php
{ "resource": "" }
q262512
TraceablePDODecorater.profileCall
test
protected function profileCall(string $method, string $sql, array $args) { $trace = new TracedStatement($sql); $trace->start(); $ex = null; $result = null; try { $result = $this->pdo->{$method}(...$args); } catch (PDOException $e) { $ex =...
php
{ "resource": "" }
q262513
Resolver.resolve
test
public function resolve(string $alias): ?string { // Check wether the alias matches the pattern if (\preg_match($this->regex, $alias, $matches) !== 1) { return null; } // Get the translation $translation = $this->translation; if (\mb_strpos($translation,...
php
{ "resource": "" }
q262514
Resolver.matches
test
public function matches(string $pattern, string $translation = null): bool { return $this->pattern === $pattern && (!
php
{ "resource": "" }
q262515
TwigServiceProvider.createTwigEngine
test
public static function createTwigEngine(ContainerInterface $container): TwigEngine { $engine = new TwigEngine($container->get(TwigEnvironment::class),
php
{ "resource": "" }
q262516
TwigServiceProvider.extendViewFactory
test
public static function extendViewFactory( ContainerInterface $container, ?FactoryContract $view = null ):
php
{ "resource": "" }
q262517
TwigServiceProvider.extendEngineResolver
test
public static function extendEngineResolver( ContainerInterface $container, ?EngineResolver $engines = null ): ?EngineResolver { if ($engines !== null) { // @var EngineResolver $engines $engines->register('twig', static function () use
php
{ "resource": "" }
q262518
TwigServiceProvider.createTwigEnvironment
test
public static function createTwigEnvironment(ContainerInterface $container): TwigEnvironment { $options = self::resolveOptions($container->get('config')); $twigOptions = $options['engines']['twig']['options']; $twig = new TwigEnvironment( $container->get(LoaderInterface::cla...
php
{ "resource": "" }
q262519
TwigServiceProvider.createTwigLoader
test
public static function createTwigLoader(ContainerInterface $container): LoaderInterface { $options = self::resolveOptions($container->get('config')); $loaders = []; $twigOptions = $options['engines']['twig']; $loader = new TwigLoader($container->get(FinderContract::class));...
php
{ "resource": "" }
q262520
Validator.parseData
test
protected function parseData(array $data): array { $newData = []; foreach ($data as $key => $value) { if (\is_array($value)) { return $this->parseData($value);
php
{ "resource": "" }
q262521
Validator.createRule
test
protected function createRule($rules): RespectValidator { $notRules = []; $optionalRules = []; if (\is_string($rules)) { // remove duplicate $rules = \array_unique(\explode('|', $rules)); } foreach ($rules as $key => $rule) { if (\mb...
php
{ "resource": "" }
q262522
Validator.createNegativeOrOptionalValidator
test
protected function createNegativeOrOptionalValidator(string $filter, array $rules): RespectValidator { [$method, $parameters] = $this->parseStringRule($rules[0]); unset($rules[0]); $method = \str_replace($filter, '', $method); $validator = RespectValidator::$method(...$parameter...
php
{ "resource": "" }
q262523
Validator.createChainableValidators
test
protected function createChainableValidators(RespectValidator $class, array $rules): RespectValidator { // reset keys $rules = \array_values($rules); if (\count($rules) !== 0) { $chain = ''; foreach ($rules as $rule) { if ($rules[0] === $rule) { ...
php
{ "resource": "" }
q262524
Validator.parseStringRule
test
protected function parseStringRule(string $rules): array { $parameters = []; // The format for specifying validation rules and parameters follows an // easy {rule}:{parameters} formatting convention. For instance the // rule "Min:3" states that the value may only be three letters. ...
php
{ "resource": "" }
q262525
Validator.parseParameters
test
protected function parseParameters(string $rule, string $parameter): array { if (\mb_strtolower($rule) === 'regex') {
php
{ "resource": "" }
q262526
WebServer.start
test
public static function start(WebServerConfig $config, string $pidFile = null): int { $pidFile = $pidFile ?? self::getDefaultPidFile(); if (self::isRunning($pidFile)) { throw new RuntimeException(\sprintf('A process is already listening on http://%s.', $config->getAddress())); } ...
php
{ "resource": "" }
q262527
WebServer.stop
test
public static function stop(string $pidFile = null): void { $pidFile = $pidFile ?? self::getDefaultPidFile(); if (! \file_exists($pidFile)) {
php
{ "resource": "" }
q262528
WebServer.getAddress
test
public static function getAddress(string $pidFile = null) { $pidFile = $pidFile ?? self::getDefaultPidFile(); if (! \file_exists($pidFile)) {
php
{ "resource": "" }
q262529
WebServer.isRunning
test
public static function isRunning(string $pidFile = null): bool { $pidFile = $pidFile ?? self::getDefaultPidFile(); if (! \file_exists($pidFile)) { return false; } $address = \file_get_contents($pidFile); $pos = \mb_strrpos($address, ':'); $hostname...
php
{ "resource": "" }
q262530
WebServer.createServerProcess
test
private static function createServerProcess(WebServerConfig $config): Process { $finder = new PhpExecutableFinder(); if (($binary = $finder->find(false)) === false) { throw new RuntimeException('Unable to find the PHP binary.'); } $xdebugArgs = []; if ($config-...
php
{ "resource": "" }
q262531
EventManager.getListeners
test
public function getListeners(string $eventName = null): array { if ($eventName === null) { foreach ($this->listeners as $name => $eventListeners) { if (! isset($this->sorted[$name])) { $this->sortListeners($name); } } r...
php
{ "resource": "" }
q262532
EventManager.removeListenerPattern
test
protected function removeListenerPattern(string $eventPattern, $listener): void { if (empty($this->patterns[$eventPattern])) { return; } /** @var ListenerPattern $pattern */
php
{ "resource": "" }
q262533
EventManager.hasWildcards
test
private function hasWildcards(string $subject): bool {
php
{ "resource": "" }
q262534
EventManager.addListenerPattern
test
private function addListenerPattern(ListenerPattern $pattern): void { $this->patterns[$pattern->getEventPattern()][] = $pattern; foreach ($this->syncedEvents as $eventName => $value) {
php
{ "resource": "" }
q262535
OptionsReader.readMandatoryOption
test
protected function readMandatoryOption(string $className, array $dimensions, array $mandatoryOptions): array { $options = []; foreach ($mandatoryOptions as $key => $mandatoryOption) { if (! \is_scalar($mandatoryOption)) { $options[$key] = $this->readMandatoryOption($clas...
php
{ "resource": "" }
q262536
OptionsReader.buildMultidimensionalArray
test
private function buildMultidimensionalArray(array $dimensions, $value): array { $config = []; $index = \array_shift($dimensions); if (! isset($dimensions[0])) { $config[$index] = $value;
php
{ "resource": "" }
q262537
Handler.getPreparedResponse
test
protected function getPreparedResponse( ?ServerRequestInterface $request, Throwable $exception, Throwable $transformed ): ResponseInterface { try { $response = $this->getResponse( $request, $exception, $transformed ...
php
{ "resource": "" }
q262538
Handler.getResponse
test
protected function getResponse( ?ServerRequestInterface $request, Throwable $exception, Throwable $transformed ): ResponseInterface { $id = ExceptionIdentifier::identify($exception); $flattened = FlattenException::create($exception); $code = $flattened->ge...
php
{ "resource": "" }
q262539
Handler.getDisplayer
test
protected function getDisplayer( ?ServerRequestInterface $request, Throwable $original, Throwable $transformed, int $code ): DisplayerContract { $sortedDisplayers = []; \ksort($this->displayers); \array_walk_recursive($this->displayers, static function ($dis...
php
{ "resource": "" }
q262540
Handler.getFiltered
test
protected function getFiltered( array $displayers, ServerRequestInterface $request, Throwable $original, Throwable $transformed, int $code ): array { /** @var \Viserio\Component\Contract\Exception\Filter[] $sortedFilters */ $sortedFilters = []; \ksort...
php
{ "resource": "" }
q262541
Handler.sortedFilter
test
private function sortedFilter(array $filtered, ServerRequestInterface $request): DisplayerContract { $accepts = self::getHeaderValuesFromString($request->getHeaderLine('Accept')); foreach ($accepts as $accept) { foreach ($filtered as $filter) {
php
{ "resource": "" }
q262542
Collection.addLookups
test
protected function addLookups(RouteContract $route): void { // If the route has a name, we will add it to the name look-up table so that we // will quickly be able to find any route associate with a name and not have // to iterate through every route every time we need to perform a look-up. ...
php
{ "resource": "" }
q262543
Message.addAddresses
test
protected function addAddresses($address, string $name, string $type): void { if (\is_array($address)) { $set = \sprintf('set%s', $type);
php
{ "resource": "" }
q262544
ProfilerServiceProvider.createAssetsRenderer
test
public static function createAssetsRenderer(ContainerInterface $container): AssetsRenderer {
php
{ "resource": "" }
q262545
ProfilerServiceProvider.registerBaseCollectors
test
protected static function registerBaseCollectors( ContainerInterface $container, ProfilerContract $profiler, array $options ): void { if ($options['collector']['time']) { $profiler->addCollector(new TimeDataCollector( $container->get(ServerRequestInterface...
php
{ "resource": "" }
q262546
ProfilerServiceProvider.registerCollectorsFromConfig
test
private static function registerCollectorsFromConfig( ContainerInterface $container, ProfilerContract $profiler, array $options
php
{ "resource": "" }
q262547
SessionServiceProvider.extendEventManager
test
public static function extendEventManager( ContainerInterface $container, ?EventManagerContract $eventManager = null ): ?EventManagerContract { if ($eventManager !== null) { $eventManager->attach(TerminableContract::TERMINATE, static function (EventContract $event): void { ...
php
{ "resource": "" }
q262548
SessionServiceProvider.createSessionManager
test
public static function createSessionManager(ContainerInterface $container): SessionManager { $manager = new SessionManager($container->get('config')); if ($container->has(CacheManagerContract::class)) {
php
{ "resource": "" }
q262549
RoutingServiceProvider.createRouteDispatcher
test
public static function createRouteDispatcher( ContainerInterface $container, ?callable $getPrevious = null ): DispatcherContract { // @codeCoverageIgnoreStart if (\is_callable($getPrevious)) { $dispatcher = $getPrevious();
php
{ "resource": "" }
q262550
RoutingServiceProvider.createRouter
test
public static function createRouter(ContainerInterface $container): RouterContract { $router = new Router($container->get(DispatcherContract::class));
php
{ "resource": "" }
q262551
RoutingServiceProvider.createUrlGenerator
test
public static function createUrlGenerator(ContainerInterface $container): ?UrlGeneratorContract { if (! $container->has(UriFactoryInterface::class)) { return null; } return new UrlGenerator(
php
{ "resource": "" }
q262552
EnvironmentDetector.detectConsoleEnvironment
test
protected function detectConsoleEnvironment(Closure $callback, array $args): string { // First we will check if an environment argument was passed via console arguments // and if it was that automatically overrides as the environment. Otherwise, we // will check the environment as a "web" re...
php
{ "resource": "" }
q262553
EnvironmentDetector.getEnvironmentArgument
test
protected function getEnvironmentArgument(array $args): ?string { $callback = static function ($v) { return self::startsWith($v, '--env'); }; foreach ($args as $key => $value) {
php
{ "resource": "" }
q262554
AssetController.js
test
public function js(): ResponseInterface { $renderer = $this->profiler->getAssetsRenderer(); $stream = $this->streamFactory->createStream(
php
{ "resource": "" }
q262555
TomlDumper.fromArray
test
private function fromArray(array $data, TomlBuilder $builder, string $parent = ''): TomlBuilder { foreach ($data as $key => $value) { if (\is_array($value)) { if ($this->hasStringKeys($value)) { $key = $parent !== '' ? "${parent}.${key}" : $key; ...
php
{ "resource": "" }
q262556
TomlDumper.processArrayOfArrays
test
private function processArrayOfArrays(array $values, string $parent, TomlBuilder $builder): TomlBuilder { $array = []; foreach ($values as $value) { if ($this->hasStringKeys($value)) { $builder->addArrayOfTable($parent); foreach ($value as $key => $val) ...
php
{ "resource": "" }
q262557
DebugCommand.getPrettyMetadata
test
private function getPrettyMetadata(string $type, object $entity): string { if ($type === 'tests') { return ''; } try { $meta = $this->getMetadata($type, $entity); if ($meta === null) { return '(unknown?)'; } } catch (U...
php
{ "resource": "" }
q262558
DebugCommand.getLoaderPaths
test
private function getLoaderPaths(Environment $twig): array { /** @var \Twig\Loader\FilesystemLoader $loader */ $loader = $twig->getLoader(); if (! $loader instanceof FilesystemLoader) { return []; } $loaderPaths = [];
php
{ "resource": "" }
q262559
DebugCommand.buildTableRows
test
private function buildTableRows(array $loaderPaths): array { $rows = []; $firstNamespace = true; $prevHasSeparator = false; foreach ($loaderPaths as $namespace => $paths) { if (! $firstNamespace && ! $prevHasSeparator && \count($paths) > 1) { ...
php
{ "resource": "" }
q262560
AbstractWhoopsDisplayer.getWhoops
test
private function getWhoops(): Whoops { $whoops = new Whoops(); $whoops->allowQuit(false);
php
{ "resource": "" }
q262561
Router.addWhereClausesToRoute
test
protected function addWhereClausesToRoute(RouteContract $route): void { $where = $route->getAction()['where'] ?? []; $pattern = \array_merge($this->patterns, $where);
php
{ "resource": "" }
q262562
Router.mergeGroupAttributesIntoRoute
test
protected function mergeGroupAttributesIntoRoute(RouteContract $route): void
php
{ "resource": "" }
q262563
Router.convertToControllerAction
test
protected function convertToControllerAction($action): array { if (\is_string($action)) { $action = ['uses' => $action];
php
{ "resource": "" }
q262564
Router.prependGroupNamespace
test
protected function prependGroupNamespace(string $uses): string { $group = \end($this->groupStack);
php
{ "resource": "" }
q262565
Router.prefix
test
protected function prefix(string $uri): string { $trimmed = \trim($this->getLastGroupPrefix(), '/') . '/' . \trim($uri, '/'); if (! $trimmed) { return '/';
php
{ "resource": "" }
q262566
Router.updateGroupStack
test
protected function updateGroupStack(array $attributes): void { if ($this->hasGroupStack()) {
php
{ "resource": "" }
q262567
SanitizerServiceProvider.createSanitizer
test
public static function createSanitizer(ContainerInterface $container): Sanitizer { $sanitizer = new Sanitizer();
php
{ "resource": "" }
q262568
BootstrapManager.addBeforeBootstrapping
test
public function addBeforeBootstrapping(string $bootstrapper, callable $callback): void {
php
{ "resource": "" }
q262569
BootstrapManager.addAfterBootstrapping
test
public function addAfterBootstrapping(string $bootstrapper, callable $callback): void {
php
{ "resource": "" }
q262570
BootstrapManager.bootstrapWith
test
public function bootstrapWith(array $bootstraps): void { foreach ($bootstraps as $bootstrap) { $this->callCallbacks( $this->bootstrappingCallbacks, $this->kernel, 'bootstrapping: ', $bootstrap ); $bootstrap:...
php
{ "resource": "" }
q262571
BootstrapManager.callCallbacks
test
private function callCallbacks(array $bootCallbacks, KernelContract $kernel, string $type, string $bootstrap): void { foreach ($bootCallbacks as $name => $callbacks) { if ($type . \str_replace('\\', '', $bootstrap) === $name) {
php
{ "resource": "" }
q262572
Store.generateSessionId
test
protected function generateSessionId(): string { return \hash('ripemd160', \uniqid(Str::random(23),
php
{ "resource": "" }
q262573
Store.mergeNewFlashes
test
private function mergeNewFlashes(array $keys): void { $values = \array_unique(\array_merge($this->get('_flash.new',
php
{ "resource": "" }
q262574
Store.loadSession
test
private function loadSession(): bool { $values = $this->readFromHandler(); if (\count($values) === 0) { return false; } $metadata = $values[self::METADATA_NAMESPACE]; $this->firstTrace = $metadata['firstTrace']; $this->lastTrace = $metada...
php
{ "resource": "" }
q262575
Store.readFromHandler
test
private function readFromHandler(): array { $data = $this->handler->read($this->id);
php
{ "resource": "" }
q262576
Store.writeToHandler
test
private function writeToHandler(): void { $values = $this->values; $values[self::METADATA_NAMESPACE] = [ 'firstTrace' => $this->firstTrace, 'lastTrace' => $this->lastTrace, 'regenerationTrace' => $this->regenerationTrace, 'requestsCount...
php
{ "resource": "" }
q262577
AbstractPaginator.resolveCurrentPage
test
protected function resolveCurrentPage(): int { $query = $this->request->getQueryParams(); if (\array_key_exists($this->pageName, $query)) { $query = $this->secureInput($query); $page = $query[$this->pageName]; if ((int) $page >=
php
{ "resource": "" }
q262578
AbstractPaginator.secureInput
test
private function secureInput(array $query): array { $secure = static function (&$v): void { if (! \is_string($v) && ! \is_numeric($v)) { $v = ''; } elseif (\mb_strpos($v, "\0") !== false) {
php
{ "resource": "" }
q262579
EventsDataCollectorServiceProvider.extendEventManager
test
public static function extendEventManager( ContainerInterface $container, ?EventManager $eventManager = null ): ?TraceableEventManager { if ($eventManager !== null) { $options = self::resolveOptions($container->get('config')); if ($options['collector']['events']) { ...
php
{ "resource": "" }
q262580
LintCommand.getFiles
test
protected function getFiles(array $files, array $directories): array { $foundFiles = []; /** @var \SplFileInfo $file */ foreach ($this->getFinder($directories) as $file)
php
{ "resource": "" }
q262581
LintCommand.getFinder
test
protected function getFinder(array $paths): iterable { $foundFiles = []; $baseDir = (array) $this->argument('dir'); foreach ($baseDir as $dir) { if (\count($paths) !== 0) { foreach ($paths as $path) {
php
{ "resource": "" }
q262582
LintCommand.validate
test
protected function validate(string $template, string $file): array { $realLoader = $this->environment->getLoader(); try { $temporaryLoader = new ArrayLoader([$file => $template]); $this->environment->setLoader($temporaryLoader); $nodeTree = $this->environment->p...
php
{ "resource": "" }
q262583
LintCommand.display
test
protected function display(array $details, string $format = 'txt'): int { $verbose = $this->getOutput()->isVerbose(); switch ($format) { case 'txt': return $this->displayText($details, $verbose); case 'json':
php
{ "resource": "" }
q262584
LintCommand.displayText
test
protected function displayText(array $details, bool $verbose = false): int { $errors = 0; foreach ($details as $info) { if ($verbose && $info['valid']) { $file = ' in ' . $info['file']; $this->line('<info>OK</info>' . $file); } elseif (! $info...
php
{ "resource": "" }
q262585
MiddlewareNameResolver.parseMiddlewareGroup
test
protected static function parseMiddlewareGroup( string $name, array $map, array $middlewareGroups, array $disabledMiddleware ): array { $results = []; foreach ($middlewareGroups[$name] as $middleware) { $name = \is_object($middleware) ? \get_class($middle...
php
{ "resource": "" }
q262586
OptionsResolverTrait.checkMandatoryOptions
test
private static function checkMandatoryOptions( string $configClass, array $mandatoryOptions, $config, array $interfaces ): void { foreach ($mandatoryOptions as $key => $mandatoryOption) { $useRecursion = ! \is_scalar($mandatoryOption); if (! $useRecur...
php
{ "resource": "" }
q262587
OptionsResolverTrait.getConfigurationDimensions
test
private static function getConfigurationDimensions( array $dimensions, $config, string $configClass, array $interfaces, ?string $configId ) { foreach ($dimensions as $dimension) { if ((array) $config !== $config && ! $config instanceof ArrayAccess) { ...
php
{ "resource": "" }
q262588
OptionsResolverTrait.validateOptions
test
private static function validateOptions(array $validators, $config, string $configClass): void { foreach ($validators as $key => $values) { if (! \array_key_exists($key, (array) $config)) { continue; } if (\is_array($values) && isset($values[0]) && \is_st...
php
{ "resource": "" }
q262589
OptionsResolverTrait.checkDeprecatedOptions
test
private static function checkDeprecatedOptions(string $configClass, array $deprecatedOptions, $config): void { foreach ($deprecatedOptions as $key => $deprecationMessage) { if (\is_array($deprecationMessage)) { self::checkDeprecatedOptions($configClass, $deprecationMessage, $conf...
php
{ "resource": "" }
q262590
ResourceRegistrar.register
test
public function register(string $name, string $controller, array $options = []): void { if (isset($options['parameters']) && \count($this->parameters) === 0) { $this->parameters = (array) $options['parameters']; } // If the resource name contains a slash, we will assume the deve...
php
{ "resource": "" }
q262591
ResourceRegistrar.getResourceUri
test
public function getResourceUri(string $resource, array $options): string { if (\strpos($resource, '.') === false) { return $resource; } // Once we have built the base URI, we'll remove the parameter holder for this // base resource name so that the individual route adder...
php
{ "resource": "" }
q262592
ResourceRegistrar.getResourceWildcard
test
public function getResourceWildcard(string $value): string { if (isset($this->parameters[$value])) { $value = $this->parameters[$value]; } elseif (isset(static::$parameterMap[$value])) { $value = static::$parameterMap[$value];
php
{ "resource": "" }
q262593
ResourceRegistrar.getResourcePrefix
test
protected function getResourcePrefix(string $name): array { $segments = \explode('/', $name); // To get the prefix, we will take all of the name segments and implode them on // a slash. This will generate a proper URI prefix for us. Then we take this // last segment,
php
{ "resource": "" }
q262594
ResourceRegistrar.addResourceDestroy
test
protected function addResourceDestroy(string $name, string $base, string $controller, array $options): RouteContract { $uri = $this->getResourceUri($name, $options) . '/{' . $base . '}'; $action
php
{ "resource": "" }
q262595
ResourceRegistrar.getNestedResourceUri
test
protected function getNestedResourceUri(array $segments, array $options): string { // We will spin through the segments and create a place-holder for each of the // resource segments, as well as the resource itself. Then we should get an // entire string for the resource URI that contains al...
php
{ "resource": "" }
q262596
ResourceRegistrar.getResourceAction
test
protected function getResourceAction(string $resource, string $controller, string $method, array $options): array { $name = $this->getResourceRouteName($resource, $method, $options); $action = ['as' => $name, 'uses' => $controller . '@' . $method]; if (isset($options['middleware'])) { ...
php
{ "resource": "" }
q262597
ResourceRegistrar.getResourceRouteName
test
protected function getResourceRouteName(string $resource, string $method, array $options): string { $name = $resource; // If the names array has been provided to us we will check for an entry in the // array first. We will also check for the specific method within this array // so t...
php
{ "resource": "" }
q262598
Pipeline.sliceThroughContainer
test
protected function sliceThroughContainer($traveler, $stack, string $stage) { [$name, $parameters] = $this->parseStageString($stage); $parameters = \array_merge([$traveler, $stack], $parameters); $class = null; if ($this->container->has($name)) { $c...
php
{ "resource": "" }
q262599
Pipeline.getRequestHandlerMiddleware
test
private function getRequestHandlerMiddleware(callable $middleware): RequestHandlerInterface { return new class($middleware) implements RequestHandlerInterface { /** * @var callable */ private $middleware; /** * Create a new delegate...
php
{ "resource": "" }