prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Messenger;
/**
* @author Kevin Bond <kevinbond@gmail.com... | return $this->commandLine ?? implode(' ', $this->command);
}
/**
* Create a process message instance that will instantiate a Process using the fromShellCommandline method.
*
* @see Process::fromShellCommandline
*/
public st | ?string $cwd = null,
public readonly ?array $env = null,
public readonly mixed $input = null,
public readonly ?float $timeout = 60.0,
) {
}
public function __toString(): string
{
| {
"filepath": "src/Symfony/Component/Process/Messenger/RunProcessMessage.php",
"language": "php",
"file_size": 1296,
"cut_index": 524,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Messenger;
use Symfony\Component\Process\Exception\... | $message->env, $message->input, $message->timeout),
default => Process::fromShellCommandline($message->commandLine, $message->cwd, $message->env, $message->input, $message->timeout),
};
try {
return new RunProcessCo | ss RunProcessMessageHandler
{
public function __invoke(RunProcessMessage $message): RunProcessContext
{
$process = match ($message->commandLine) {
null => new Process($message->command, $message->cwd, | {
"filepath": "src/Symfony/Component/Process/Messenger/RunProcessMessageHandler.php",
"language": "php",
"file_size": 1209,
"cut_index": 518,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Process\Pipes;
use Symfony\Component\Process\Exception\InvalidArgumentException;
/**
* @author Romain Neutron <imprec@gmail.com>
*
* @internal
*/
abstract class AbstractPipes implements PipesInterface
{
public array $pipes = [];
private string... | ing) $input;
}
}
public function close(): void
{
foreach ($this->pipes as $pipe) {
if (\is_resource($pipe)) {
fclose($pipe);
}
}
$this->pipes = [];
}
/**
* R | g|\Iterator $input
*/
public function __construct($input)
{
if (\is_resource($input) || $input instanceof \Iterator) {
$this->input = $input;
} else {
$this->inputBuffer = (str | {
"filepath": "src/Symfony/Component/Process/Pipes/AbstractPipes.php",
"language": "php",
"file_size": 6113,
"cut_index": 716,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Pipes;
/**
* PipesInterface manages descriptors and pipe... | return string[]
*/
public function getFiles(): array;
/**
* Reads data in file handles and pipes.
*
* @param bool $blocking Whether to use blocking calls or not
* @param bool $close Whether to close pipes if they've rea | of descriptors for the use of proc_open.
*/
public function getDescriptors(): array;
/**
* Returns an array of filenames indexed by their related stream in case these pipes use temporary files.
*
* @ | {
"filepath": "src/Symfony/Component/Process/Pipes/PipesInterface.php",
"language": "php",
"file_size": 1502,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Pipes;
use Symfony\Component\Process\Process;
/**
* UnixPipes implementation uses unix pipes as handles.
*
* @author Romain Neutron <imprec@gma... | ion __unserialize(array $data): void
{
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
}
public function __destruct()
{
$this->close();
}
public function getDescriptors(): array
{
if | private bool $haveReadSupport,
) {
parent::__construct($input);
}
public function __serialize(): array
{
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
}
public funct | {
"filepath": "src/Symfony/Component/Process/Pipes/UnixPipes.php",
"language": "php",
"file_size": 3739,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Process\Pipes;
use Symfony\Component\Process\Exception\RuntimeException;
use Symfony\Component\Process\Process;
/**
* WindowsPipes implementation uses temporary files as handles.
*
* @see https://bugs.php.net/51800
* @see https://bugs.php.net/65650
*
... | if ($this->haveReadSupport) {
// Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big.
// Workaround for this problem is to use temporary files instead of pipes on Windows platform.
| y $lockHandles = [];
private array $readBytes = [
Process::STDOUT => 0,
Process::STDERR => 0,
];
public function __construct(
mixed $input,
private bool $haveReadSupport,
) {
| {
"filepath": "src/Symfony/Component/Process/Pipes/WindowsPipes.php",
"language": "php",
"file_size": 5849,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use S... | fony HTTP kernel using a "real" HTTP client.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
final class HttpClientKernel implements HttpKernelInterface
{
private HttpClientInterface $client;
public function __construct(?HttpClientInterfac | t;
use Symfony\Component\Mime\Part\TextPart;
use Symfony\Contracts\HttpClient\HttpClientInterface;
// Help opcache.preload discover always-needed symbols
class_exists(ResponseHeaderBag::class);
/**
* An implementation of a Sym | {
"filepath": "src/Symfony/Component/HttpKernel/HttpClientKernel.php",
"language": "php",
"file_size": 4120,
"cut_index": 614,
"middle_length": 229
} |
y\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver;
use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
use Symfony\Component\HttpKernel\Controller\... | el\Event\RequestEvent;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\Event\TerminateEvent;
use Symfony\Component\HttpKernel\Event\ViewEvent;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Sy | el\Event\ControllerEvent;
use Symfony\Component\HttpKernel\Event\ControllerMetadata;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKern | {
"filepath": "src/Symfony/Component/HttpKernel/HttpKernel.php",
"language": "php",
"file_size": 12160,
"cut_index": 921,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel;
use Symfony\Component\BrowserKit\AbstractBrowser;
use Symfony\Component\BrowserKit\CookieJar;
use Symfony\Component\BrowserKit\History;
use Symfony\Component\BrowserKit\Request as DomRequest;
use Symfony\Component\BrowserKit\Response as DomRespo... | tions = true;
/**
* @param array $server The server parameters (equivalent of $_SERVER)
*/
public function __construct(
protected HttpKernelInterface $kernel,
array $server = [],
?History $history = null,
| requests to an HttpKernel instance.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @template-extends AbstractBrowser<Request, Response>
*/
class HttpKernelBrowser extends AbstractBrowser
{
private bool $catchExcep | {
"filepath": "src/Symfony/Component/HttpKernel/HttpKernelBrowser.php",
"language": "php",
"file_size": 6065,
"cut_index": 716,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel;
use Symfony\Component\HttpFoundation\Request;
u... | * and do its best to convert them to a Response instance.
*
* @param int $type The type of the request
* (one of HttpKernelInterface::MAIN_REQUEST or HttpKernelInterface::SUB_REQUEST)
* @param bool $catch Wheth | ernelInterface
{
public const MAIN_REQUEST = 1;
public const SUB_REQUEST = 2;
/**
* Handles a Request to convert it to a Response.
*
* When $catch is true, the implementation must catch all exceptions
| {
"filepath": "src/Symfony/Component/HttpKernel/HttpKernelInterface.php",
"language": "php",
"file_size": 1227,
"cut_index": 518,
"middle_length": 229
} |
ymfony\Component\DependencyInjection\Kernel\KernelTrait;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Bundle\BundleAdapter;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\CacheWarmer\WarmableInter... | gisterBundles as public;
registerContainerConfiguration as public;
initializeBundles as protected doInitializeBundles;
initializeContainer as protected doInitializeContainer;
getKernelParameters as private doGetKernelParamet | ain letters and numbers.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class Kernel extends AbstractKernel implements KernelInterface, RebootableInterface, TerminableInterface
{
use KernelTrait {
re | {
"filepath": "src/Symfony/Component/HttpKernel/Kernel.php",
"language": "php",
"file_size": 9404,
"cut_index": 921,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel;
use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\... |
*/
final class KernelEvents
{
/**
* The REQUEST event occurs at the very beginning of request
* dispatching.
*
* This event allows you to create a response for a request before any
* other code in the framework is executed.
| Event;
use Symfony\Component\HttpKernel\Event\TerminateEvent;
use Symfony\Component\HttpKernel\Event\ViewEvent;
/**
* Contains all events thrown in the HttpKernel component.
*
* @author Bernhard Schussek <bschussek@gmail.com> | {
"filepath": "src/Symfony/Component/HttpKernel/KernelEvents.php",
"language": "php",
"file_size": 4142,
"cut_index": 614,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel;
use Symfony\Component\Config\Loader\LoaderInterface;
... | Returns an array of bundles to register.
*
* @return iterable<BundleInterface>
*/
public function registerBundles(): iterable;
/**
* Loads the container configuration.
*/
public function registerContainerConfiguration( | system.
*
* It manages an environment made of application kernel and bundles.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface KernelInterface extends HttpKernelInterface, BaseKernelInterface
{
/**
* | {
"filepath": "src/Symfony/Component/HttpKernel/KernelInterface.php",
"language": "php",
"file_size": 1485,
"cut_index": 524,
"middle_length": 229
} |
php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel;
/**
* Allows the Kernel to be rebooted usi... | l should not be called
* while building the container. Use the %kernel.build_dir% parameter instead.
*
* @param string|null $warmupDir pass null to reboot in the regular build directory
*/
public function reboot(?string $warmupDir): | bootable kerne | {
"filepath": "src/Symfony/Component/HttpKernel/RebootableInterface.php",
"language": "php",
"file_size": 793,
"cut_index": 514,
"middle_length": 14
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Terminable extends the Kernel requ... | ace TerminableInterface
{
/**
* Terminates a request/response cycle.
*
* Should be called after sending the response and before shutting down the kernel.
*/
public function terminate(Request $request, Response $response): void;
| Minnieur <pierre.minnieur@sensiolabs.de>
*/
interf | {
"filepath": "src/Symfony/Component/HttpKernel/TerminableInterface.php",
"language": "php",
"file_size": 916,
"cut_index": 606,
"middle_length": 52
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\HttpCache;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKer... | (default: text/html, text/xml, application/xhtml+xml, and application/xml)
*/
public function __construct(
protected array $contentTypes = ['text/html', 'text/xml', 'application/xhtml+xml', 'application/xml'],
) {
}
/**
| halas@gmail.com>
*/
abstract class AbstractSurrogate implements SurrogateInterface
{
/**
* @param array $contentTypes An array of content-type that should be parsed for Surrogate information
* | {
"filepath": "src/Symfony/Component/HttpKernel/HttpCache/AbstractSurrogate.php",
"language": "php",
"file_size": 4414,
"cut_index": 614,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\HttpCache;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Esi implements the ESI capabilit... | function addSurrogateControl(Response $response): void
{
if (str_contains($response->getContent(), '<esi:include')) {
$response->headers->set('Surrogate-Control', 'content="ESI/1.0"');
}
}
public function renderIncl | ure Specification (http://www.w3.org/TR/edge-arch)
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Esi extends AbstractSurrogate
{
public function getName(): string
{
return 'esi';
}
public | {
"filepath": "src/Symfony/Component/HttpKernel/HttpCache/Esi.php",
"language": "php",
"file_size": 3280,
"cut_index": 614,
"middle_length": 229
} |
cier <fabien@symfony.com>
*/
class HttpCache implements HttpKernelInterface, TerminableInterface
{
public const BODY_EVAL_BOUNDARY_LENGTH = 24;
private Request $request;
private ?ResponseCacheStrategyInterface $surrogateCacheStrategy = null;
private array $options = [];
private array $traces = [];... | f 'none', 'short' and 'full'. For 'short', a concise trace of the
* main request will be added as an HTTP header. 'full' will add traces for all
* requests (including ESI subrequests). (defaul | If true, exceptions are thrown when things go wrong. Otherwise, the cache
* will try to carry on and deliver a meaningful response.
*
* * trace_level May be one o | {
"filepath": "src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php",
"language": "php",
"file_size": 27225,
"cut_index": 1331,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\HttpCache;
use Symfony\Component\HttpFoundation\Response;
/**
* ResponseCacheStrategy knows how to compute the Response cache HTTP header
* based on the different response cache headers.
*
* This implementation changes the main response TTL ... | 'no-store', 'no-transform', 'must-revalidate', 'proxy-revalidate'];
/**
* Cache-Control headers that are sent to the final response if they appear in ALL of the responses.
*/
private const INHERIT_DIRECTIVES = ['public', 'immutable'];
| implements ResponseCacheStrategyInterface
{
/**
* Cache-Control headers that are sent to the final response if they appear in ANY of the responses.
*/
private const OVERRIDE_DIRECTIVES = ['private', 'no-cache', | {
"filepath": "src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategy.php",
"language": "php",
"file_size": 8684,
"cut_index": 716,
"middle_length": 229
} |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This code is partially based on the Rack-Cache library by Ryan Tomayko,
* which is released under the MIT license.
* (based on commit 02d2b48d75bcb63cf1c0c7149c077ad256542801)
*
* For the full copyright and ... | ResponseCacheStrategyInterface
{
/**
* Adds a Response.
*/
public function add(Response $response): void;
/**
* Updates the Response HTTP headers based on the embedded Responses.
*/
public function update(Response $res | sponse;
/**
* ResponseCacheStrategyInterface implementations know how to compute the
* Response cache HTTP header based on the different response cache headers.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface | {
"filepath": "src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategyInterface.php",
"language": "php",
"file_size": 1013,
"cut_index": 512,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\HttpCache;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation... | headers->set('Surrogate-Control', 'content="SSI/1.0"');
}
}
public function renderIncludeTag(string $uri, ?string $alt = null, bool $ignoreErrors = true, string $comment = ''): string
{
return \sprintf('<!--#include virtual="%s | ic function getName(): string
{
return 'ssi';
}
public function addSurrogateControl(Response $response): void
{
if (str_contains($response->getContent(), '<!--#include')) {
$response-> | {
"filepath": "src/Symfony/Component/HttpKernel/HttpCache/Ssi.php",
"language": "php",
"file_size": 2560,
"cut_index": 563,
"middle_length": 229
} |
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Store implements all the logic for storing cache metadata (Request and Response headers).
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Store implements StoreInterface
{
/** @var \SplObjectStorage<... | c function __construct(
protected string $root,
private array $options = [],
) {
if (!is_dir($this->root) && !@mkdir($this->root, 0o777, true) && !is_dir($this->root)) {
throw new \RuntimeException(\sprintf('Unable t | ions are:
*
* * private_headers Set of response headers that should not be stored
* when a response is cached. (default: Set-Cookie)
*
* @throws \RuntimeException
*/
publi | {
"filepath": "src/Symfony/Component/HttpKernel/HttpCache/Store.php",
"language": "php",
"file_size": 14710,
"cut_index": 921,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Redis\Tests\Transport;
use PHPUnit\Framework\Attributes\Group... | doesn\'t work with relay.');
}
public function testConnectionSendDelayedMessagesWithSameContent()
{
self::markTestSkipped('This test doesn\'t work with relay.');
}
public function testLazy()
{
self::markTestSkippe | ends RedisExtIntegrationTest
{
protected function createRedisClient(): \Redis|Relay
{
return new Relay();
}
public function testConnectionSendAndGetDelayed()
{
self::markTestSkipped('This test | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RelayExtIntegrationTest.php",
"language": "php",
"file_size": 1556,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Handler;
use Symfony\Component\Clock\Clock;
use Symfony\Component\Clock\ClockInterface;
use Sy... | rClass,
?\Closure $ack = null,
?ClockInterface $clock = null,
) {
$this->clock = $clock ?? Clock::get();
$this->ack = $ack ?? static function () {};
}
/**
* @param mixed $result
*/
public function | ck;
private \Throwable|false|null $error = null;
private mixed $result = null;
/**
* @param \Closure(\Throwable|null, mixed):void|null $ack
*/
public function __construct(
private string $handle | {
"filepath": "src/Symfony/Component/Messenger/Handler/Acknowledger.php",
"language": "php",
"file_size": 2177,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Handler;
use Symfony\Component\Clock\Clock;
use Symfony\Component\Clock\ClockInterface;
/**
... | }
}
/**
* @param Acknowledger|null $ack The function to call to ack/nack the $message.
* The message should be handled synchronously when null.
*
* @return mixed The number of pending messag | public function flush(bool $force): void
{
if (!$force && !$this->shouldFlush()) {
return;
}
if ($jobs = $this->jobs) {
$this->jobs = [];
$this->process($jobs);
| {
"filepath": "src/Symfony/Component/Messenger/Handler/BatchHandlerTrait.php",
"language": "php",
"file_size": 2690,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Handler;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Stamp\Recei... | iterable
{
$seen = [];
foreach (self::listTypes($envelope) as $type) {
foreach ($this->handlers[$type] ?? [] as $handlerDescriptor) {
if (\is_callable($handlerDescriptor)) {
$handlerDescr | sLocatorInterface
{
/**
* @param HandlerDescriptor[][]|callable[][] $handlers
*/
public function __construct(
private array $handlers,
) {
}
public function getHandlers(Envelope $envelope): | {
"filepath": "src/Symfony/Component/Messenger/Handler/HandlersLocator.php",
"language": "php",
"file_size": 2567,
"cut_index": 563,
"middle_length": 229
} |
he Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Handler;
use Symfony\Component\Messenger\Message\RedispatchMessage;
use Symfon... | essageBusInterface $bus,
) {
}
public function __invoke(RedispatchMessage $message): mixed
{
$envelope = $this->bus->dispatch($message->envelope, [new TransportNamesStamp($message->transportNames)]);
return $envelope->last | {
public function __construct(
private M | {
"filepath": "src/Symfony/Component/Messenger/Handler/RedispatchMessageHandler.php",
"language": "php",
"file_size": 900,
"cut_index": 547,
"middle_length": 52
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Execution;
use Symfony\Component\Messenger\Envelope;
use Symfony\Com... |
{
$acked = false;
$error = null;
$ack = function (Envelope $handledEnvelope, ?\Throwable $handledError = null) use (&$envelope, &$acked, &$error, $transportName): void {
$envelope = $handledEnvelope;
$a | on __construct(
private readonly MessageBusInterface $bus,
private readonly \Closure $onAcknowledge,
) {
}
public function execute(Envelope $envelope, string $transportName, callable $onHandled): void | {
"filepath": "src/Symfony/Component/Messenger/Execution/SyncMessageExecutionStrategy.php",
"language": "php",
"file_size": 1785,
"cut_index": 537,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Retry;
use Symfony\Component\Messenger\Envelope;
/**
* @author Fabien Potencier <fabien@symfony.com>
* @author Grégoire Pineau <lyrixx... | hrowable $throwable = null): bool;
/**
* @param \Throwable|null $throwable The cause of the failed handling
*
* @return int The time to delay/wait in milliseconds
*/
public function getWaitingTime(Envelope $message, ?\Throwable | public function isRetryable(Envelope $message, ?\T | {
"filepath": "src/Symfony/Component/Messenger/Retry/RetryStrategyInterface.php",
"language": "php",
"file_size": 943,
"cut_index": 606,
"middle_length": 52
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process;
/**
* Generic executable finder.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
cl... | 'time', 'title', 'type', 'ver', 'vol',
];
private array $suffixes = [];
/**
* Replaces default suffixes of executable.
*/
public function setSuffixes(array $suffixes): void
{
$this->suffixes = $suffixes;
}
| xit', 'for', 'ftype', 'goto',
'help', 'if', 'label', 'md', 'mkdir', 'mklink', 'move', 'path', 'pause',
'popd', 'prompt', 'pushd', 'rd', 'rem', 'ren', 'rename', 'rmdir', 'set',
'setlocal', 'shift', 'start', | {
"filepath": "src/Symfony/Component/Process/ExecutableFinder.php",
"language": "php",
"file_size": 3575,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process;
use Symfony\Component\Process\Exception\RuntimeException;
/**
* Provides a way to continuousl... | unction onEmpty(?callable $onEmpty = null): void
{
$this->onEmpty = null !== $onEmpty ? $onEmpty(...) : null;
}
/**
* Appends an input to the write buffer.
*
* @param resource|string|int|float|bool|\Traversable|null $inp | ts \IteratorAggregate
{
private ?\Closure $onEmpty = null;
private array $input = [];
private bool $open = true;
/**
* Sets a callback that is called when the write buffer becomes empty.
*/
public f | {
"filepath": "src/Symfony/Component/Process/InputStream.php",
"language": "php",
"file_size": 2385,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process;
use Symfony\Component\Process\Exception\LogicException;
use Symfony\Component\Process\Exception... | am string|null $cwd The working directory or null to use the working dir of the current PHP process
* @param EnvArray|null $env The environment variables or null to use the same environment as the current PHP process
* @param int | *
* @author Fabien Potencier <fabien@symfony.com>
*
* @psalm-import-type EnvArray from Process
*/
class PhpProcess extends Process
{
/**
* @param string $script The PHP script to run (as a string)
* @par | {
"filepath": "src/Symfony/Component/Process/PhpProcess.php",
"language": "php",
"file_size": 2615,
"cut_index": 563,
"middle_length": 229
} |
blocking call, use this flag to make it non-blocking
public const ITER_KEEP_OUTPUT = 2; // By default, outputs are cleared while iterating, use this flag to keep them in memory
public const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating
public const ITER_SKIP_ERR = 8; // Use th... | cessthreadsapi/nf-processthreadsapi-createprocessa
*/
private const WINDOWS_ENV_BLOCK_MAX_LENGTH = 32767;
/** @var \Closure('out'|'err', string):bool|null */
private ?\Closure $callback = null;
/** @var string[]|string */
private | as KEY=VALUE\0 in UTF-16LE,
* terminated by an extra \0. Exceeding this limit causes proc_open() to hang
* silently rather than returning false.
*
* @see https://learn.microsoft.com/en-us/windows/win32/api/pro | {
"filepath": "src/Symfony/Component/Process/Process.php",
"language": "php",
"file_size": 59616,
"cut_index": 2151,
"middle_length": 229
} |
he Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Exception;
use Symfony\Component\Process\Process;
/**
* Exception that is thro... | parent::__construct(\sprintf('The process has been signaled with signal "%s".', $process->getTermSignal()));
}
public function getProcess(): Process
{
return $this->process;
}
public function getSignal(): int
{
re | t(
private Process $process,
) {
| {
"filepath": "src/Symfony/Component/Process/Exception/ProcessSignaledException.php",
"language": "php",
"file_size": 906,
"cut_index": 547,
"middle_length": 52
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Exception;
use Symfony\Component\Process\Process;
/**
* Exception th... | ut of %s seconds.',
$process->getCommandLine(),
$this->getExceededTimeout()
));
}
public function getProcess(): Process
{
return $this->process;
}
public function isGeneralTimeout(): bool
{
|
public const TYPE_IDLE = 2;
public function __construct(
private Process $process,
private int $timeoutType,
) {
parent::__construct(\sprintf(
'The process "%s" exceeded the timeo | {
"filepath": "src/Symfony/Component/Process/Exception/ProcessTimedOutException.php",
"language": "php",
"file_size": 1554,
"cut_index": 537,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Compon... | ();
$process->start();
} catch (\Exception $e) {
$this->fail($e);
}
}
public function testItReturnsFastAfterStart()
{
// The started process must run in background after the main has finished but | ->expectNotToPerformAssertions();
try {
$process = new Process(['php', __DIR__.'/ThreeSecondProcess.php']);
$process->setOptions(['create_new_console' => true]);
$process->disableOutput | {
"filepath": "src/Symfony/Component/Process/Tests/CreateNewConsoleTest.php",
"language": "php",
"file_size": 1357,
"cut_index": 524,
"middle_length": 229
} |
n Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Runs a PHP script that can be stopped only with a SIGKILL (9) signal for 3 seconds.
*
* @args duration Run this script with a custom duration
... | n)',
};
echo "signal $name\n";
}
pcntl_signal(\SIGTERM, 'handleSignal');
pcntl_signal(\SIGINT, 'handleSignal');
echo 'received ';
$duration = isset($argv[1]) ? (int) $argv[1] : 3;
$start = microtime(true);
while ($duration > (microtime(true) - | NT => 'SIGINT',
default => $signal.' (unknow | {
"filepath": "src/Symfony/Component/Process/Tests/NonStopableProcess.php",
"language": "php",
"file_size": 952,
"cut_index": 582,
"middle_length": 52
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Redis\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attrib... | nsion('redis')]
class RedisTransportFactoryTest extends TestCase
{
use VarDumperTestTrait;
public function testSupportsOnlyRedisTransports()
{
$factory = new RedisTransportFactory();
$this->assertTrue($factory->supports('redis | ort;
use Symfony\Component\Messenger\Bridge\Redis\Transport\RedisTransportFactory;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
#[RequiresPhpExte | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisTransportFactoryTest.php",
"language": "php",
"file_size": 3122,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Test\Middleware;
use PHPUnit\Framework\TestCase;
use Symfony\Compone... | $stack = $this->createMock(StackInterface::class);
$stack
->expects($this->never())
->method('next')
;
return $stack;
}
$nextMiddleware = $this->createMock(MiddlewareInte | ckMiddleware;
/**
* @author Nicolas Grekas <p@tchwork.com>
*/
abstract class MiddlewareTestCase extends TestCase
{
protected function getStackMock(bool $nextIsCalled = true)
{
if (!$nextIsCalled) {
| {
"filepath": "src/Symfony/Component/Messenger/Test/Middleware/MiddlewareTestCase.php",
"language": "php",
"file_size": 1731,
"cut_index": 537,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Handler;
/**
* Describes a handler and the possible associated opti... | $r = new \ReflectionFunction($handler);
if ($r->isAnonymous()) {
$this->name = 'Closure';
} elseif (!$handler = $r->getClosureThis()) {
$class = $r->getClosureCalledClass();
$this->name = ($class | ivate ?BatchHandlerInterface $batchHandler = null;
public function __construct(
callable $handler,
private array $options = [],
) {
$handler = $handler(...);
$this->handler = $handler;
| {
"filepath": "src/Symfony/Component/Messenger/Handler/HandlerDescriptor.php",
"language": "php",
"file_size": 1899,
"cut_index": 537,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Execution;
use Symfony\Component\Messenger\Envelope;
use Symfony\Com... | ool &$acked, float $queuedAt): void
{
$this->messages ??= new \SplObjectStorage();
$this->messages[$batchHandler] = new DeferredBatchMessage($transportName, $envelope, $acked, $queuedAt);
}
/**
* @return \SplObjectStorage< | private ?\SplObjectStorage $messages = null;
public function hasPending(): bool
{
return null !== $this->messages;
}
public function add(object $batchHandler, string $transportName, Envelope $envelope, b | {
"filepath": "src/Symfony/Component/Messenger/Execution/DeferredBatchMessageQueue.php",
"language": "php",
"file_size": 1881,
"cut_index": 537,
"middle_length": 229
} |
ony\Component\Messenger\Handler\HandlerDescriptor;
use Symfony\Component\Messenger\Handler\HandlersLocator;
use Symfony\Component\Messenger\TraceableMessageBus;
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
/**
* @author Samuel Roze <samuel.roze@gmail.com>
*/
class MessengerPass implements Co... | $container->getParameterBag()->remove($busMiddlewareParameter);
}
if ($container->hasDefinition('data_collector.messenger')) {
$this->registerBusToCollector($container, $busId);
}
| usIds as $busId) {
if ($container->hasParameter($busMiddlewareParameter = $busId.'.middleware')) {
$this->registerBusMiddleware($container, $busId, $container->getParameter($busMiddlewareParameter));
| {
"filepath": "src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php",
"language": "php",
"file_size": 20932,
"cut_index": 1331,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Process;
use Symfony\Component\Process\Exception\LogicException;
use Symfony\Component\Process\Exception\RuntimeException;
/**
* PhpSubprocess runs a PHP command as a subprocess while keeping the original php.ini settings.
*
* For this, it generates a t... | sses:
*
* $p = new Process(['php', '-d', 'memory_limit=256M', 'MemoryTest.php']);
* $p->run();
* print $p->getOutput()."\n";
*
* This will output "string(2) "-1", because the process is started with the default php.ini settings.
*
* | r php.ini contains "memory_limit=-1" and you have a "MemoryTest.php" with the following content:
*
* <?php var_dump(ini_get('memory_limit'));
*
* These are the differences between the regular Process and PhpSubprocess cla | {
"filepath": "src/Symfony/Component/Process/PhpSubprocess.php",
"language": "php",
"file_size": 6205,
"cut_index": 716,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Exception;
use Symfony\Component\Process\Process;
/**
*... | e command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s",
$process->getCommandLine(),
$process->getExitCode(),
$process->getExitCodeText(),
$process->getWorkingDirectory()
);
| rivate Process $process,
) {
if ($process->isSuccessful()) {
throw new InvalidArgumentException('Expected a failed process, but the given process was successful.');
}
$error = \sprintf('Th | {
"filepath": "src/Symfony/Component/Process/Exception/ProcessFailedException.php",
"language": "php",
"file_size": 1428,
"cut_index": 524,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Exception;
use Symfony\Component\Process\Process;
... | $error = \sprintf('The command "%s" failed.'."\n\nWorking directory: %s\n\nError: %s",
$process->getCommandLine(),
$process->getWorkingDirectory(),
$message ?? 'unknown'
);
// Skip parent construc | ?string $message,
) {
if ($process->isStarted()) {
throw new InvalidArgumentException('Expected a process that failed during startup, but the given process was started successfully.');
}
| {
"filepath": "src/Symfony/Component/Process/Exception/ProcessStartFailedException.php",
"language": "php",
"file_size": 1148,
"cut_index": 518,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Redis\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\... | portInterface;
class RedisTransportTest extends TestCase
{
public function testItIsATransport()
{
$transport = $this->getTransport();
$this->assertInstanceOf(TransportInterface::class, $transport);
}
public function testR | ony\Component\Messenger\Bridge\Redis\Transport\RedisTransport;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\Trans | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisTransportTest.php",
"language": "php",
"file_size": 2644,
"cut_index": 563,
"middle_length": 229
} |
n Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Execution;
use Symfony\Component\Messenger\Envelope;
interface MessageExecutionStrategyInterface
{
/**
... | * @param callable(Envelope, string, bool, ?\Throwable): void $onHandled
*/
public function wait(callable $onHandled): bool;
/**
* @param callable(Envelope, string, bool, ?\Throwable): void $onHandled
*/
public function flush(c | unction shouldPauseConsumption(): bool;
/**
| {
"filepath": "src/Symfony/Component/Messenger/Execution/MessageExecutionStrategyInterface.php",
"language": "php",
"file_size": 985,
"cut_index": 582,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process;
/**
* An executable finder specifically designed for the PHP executable.
*
* @author Fabien ... | _BINARY')) {
if (!is_executable($php) && !$php = $this->executableFinder->find($php)) {
return false;
}
if (@is_dir($php)) {
return false;
}
return $php;
| truct()
{
$this->executableFinder = new ExecutableFinder();
}
/**
* Finds The PHP executable.
*/
public function find(bool $includeArgs = true): string|false
{
if ($php = getenv('PHP | {
"filepath": "src/Symfony/Component/Process/PhpExecutableFinder.php",
"language": "php",
"file_size": 2474,
"cut_index": 563,
"middle_length": 229
} |
?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Tests;
use Symfony\Component\Process\Exception... | while (!str_contains($process->getOutput(), 'ready')) {
usleep(1000);
}
$process->isRunning() && $process->signal(\SIGSTOP);
$process->wait();
return $process->getExitCode();
} catch (ProcessTimedOutException $t) {
echo $t- | /vendor/autoload.php';
['e' => $php] = getopt('e:') + ['e' => 'php'];
try {
$process = new Process([$php, '-r', "echo 'ready'; trigger_error('error', E_USER_ERROR);"]);
$process->start();
$process->setTimeout(0.5);
| {
"filepath": "src/Symfony/Component/Process/Tests/ErrorProcessInitiator.php",
"language": "php",
"file_size": 1039,
"cut_index": 513,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Process\Tests;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Process\ExecutableFinder;
use Symfony\Component\Process\Process;
/**
* @author Chris Smith <chris@cs278.org>
*/
class ExecutableFi... | der->find($this->getPhpBinaryName());
$this->assertSamePath(\PHP_BINARY, $result);
}
public function testFindWithDefault()
{
if (\ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is | (\ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
putenv('PATH='.\dirname(\PHP_BINARY));
$finder = new ExecutableFinder();
$result = $fin | {
"filepath": "src/Symfony/Component/Process/Tests/ExecutableFinderTest.php",
"language": "php",
"file_size": 5867,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Retry;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\InvalidArgumentException;
use Symfony\Component\Messen... | author Ryan Weaver <ryan@symfonycasts.com>
*
* @final
*/
class MultiplierRetryStrategy implements RetryStrategyInterface
{
/**
* @param int $maxRetries The maximum number of times to retry
* @param int $delayMilliseconds A | t exactly 10 seconds.
*
* But if $delayMilliseconds=10000 & $multiplier=2:
* * Retry 1: 10 second delay
* * Retry 2: 20 second delay (10000 * 2 = 20000)
* * Retry 3: 40 second delay (20000 * 2 = 40000)
*
* @ | {
"filepath": "src/Symfony/Component/Messenger/Retry/MultiplierRetryStrategy.php",
"language": "php",
"file_size": 3464,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process;
use Symfony\Component\Process\Exception\InvalidArgumentException;
/*... | of method call that validates the input
* @param mixed $input The input to validate
*
* @throws InvalidArgumentException In case the input is not valid
*/
public static function validateInput(string $caller, mixed $input): mixed
| s ProcessUtils
{
/**
* This class should not be instantiated.
*/
private function __construct()
{
}
/**
* Validates and normalizes a Process input.
*
* @param string $caller The name | {
"filepath": "src/Symfony/Component/Process/ProcessUtils.php",
"language": "php",
"file_size": 1753,
"cut_index": 537,
"middle_length": 229
} |
hp
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Handler;
/**
* @author Nicolas Grekas <p@tchw... | n __invoke(object $message, ?Acknowledger $ack = null): mixed;
/**
* Flushes any pending buffers.
*
* @param bool $force Whether flushing is required; it can be skipped if not
*/
public function flush(bool $force): void;
}
// | ld be handled synchronously when null.
*
* @return mixed The number of pending messages in the batch if $ack is not null,
* the result from handling the message otherwise
*/
// public functio | {
"filepath": "src/Symfony/Component/Messenger/Handler/BatchHandlerInterface.php",
"language": "php",
"file_size": 1094,
"cut_index": 515,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\HttpCache;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation... | /**
* Adds Surrogate-capability to the given Request.
*/
public function addSurrogateCapability(Request $request): void;
/**
* Adds HTTP headers to specify that the Response needs to be parsed for Surrogate.
*
* This m | public function createCacheStrategy(): ResponseCacheStrategyInterface;
/**
* Checks that at least one surrogate has Surrogate capability.
*/
public function hasSurrogateCapability(Request $request): bool;
| {
"filepath": "src/Symfony/Component/HttpKernel/HttpCache/SurrogateInterface.php",
"language": "php",
"file_size": 2116,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\VarDumper\Caster\CutStub;
use Symfony\Component\VarDumpe... | mfony.com>
*/
abstract class DataCollector implements DataCollectorInterface
{
protected array|Data $data = [];
private ClonerInterface $cloner;
/**
* Converts the variable into a serializable Data instance.
*
* This array can | nt\VarDumper\Cloner\VarCloner;
/**
* DataCollector.
*
* Children of this class must store the collected data in the data property.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Bernhard Schussek <bschussek@sy | {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php",
"language": "php",
"file_size": 2857,
"cut_index": 563,
"middle_length": 229
} |
file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\HttpFoundation\Request... | /**
* Collects data for the given Request and Response.
*/
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void;
/**
* Returns the name of the collector.
*/
public function get | DataCollectorInterface extends ResetInterface
{
| {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php",
"language": "php",
"file_size": 855,
"cut_index": 529,
"middle_length": 52
} |
e Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\VarDumper\Cloner\Data;
use Symfony\Component\VarDumper\Cloner\VarCloner;
use Symfony\Component\VarDumper\Dumper\CliDumper;
use Symfony\Component\VarDumper\Dump... | t $dataCount = 0;
private bool $isCollected = true;
private int $clonesCount = 0;
private int $clonesIndex = 0;
private array $rootRefs;
private string $charset;
private mixed $sourceContextProvider;
private bool $webMode;
p | Connection;
/**
* @author Nicolas Grekas <p@tchwork.com>
*
* @final
*/
class DumpDataCollector extends DataCollector implements DataDumperInterface
{
private string|FileLinkFormatter|false $fileLinkFormat;
private in | {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php",
"language": "php",
"file_size": 11412,
"cut_index": 921,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher;
use Symfony\Component\HttpFoundation\Request;
use Symfony\C... | rInterface
{
/** @var iterable<EventDispatcherInterface> */
private iterable $dispatchers;
private ?Request $currentRequest = null;
/**
* @param iterable<EventDispatcherInterface>|EventDispatcherInterface|null $dispatchers
*/
| ;
use Symfony\Contracts\Service\ResetInterface;
/**
* @author Fabien Potencier <fabien@symfony.com>
*
* @see TraceableEventDispatcher
*
* @final
*/
class EventDataCollector extends DataCollector implements LateDataCollecto | {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php",
"language": "php",
"file_size": 4336,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\ErrorHandler\Exception\Flatten... | ption' => FlattenException::createWithDataRepresentation($exception),
];
}
}
public function hasException(): bool
{
return isset($this->data['exception']);
}
public function getException(): \Exception|Flatt | taCollector extends DataCollector
{
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
if (null !== $exception) {
$this->data = [
'exce | {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php",
"language": "php",
"file_size": 1600,
"cut_index": 537,
"middle_length": 229
} |
Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Log\DebugLoggerConfigurator;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
use Symfony\Component\VarDumper\Cloner\Data;
/**
* @author Fabien Potencier <fabien@symfony.com>
*
*... | s->logger = DebugLoggerConfigurator::getDebugLogger($logger);
}
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
$this->currentRequest = $this->requestStack && $this->requestStack->ge | private ?array $processedLogs = null;
public function __construct(
?object $logger = null,
private ?string $containerPathPrefix = null,
private ?RequestStack $requestStack = null,
) {
$thi | {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php",
"language": "php",
"file_size": 10909,
"cut_index": 921,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFounda... | t(): void
{
$this->data = [
'memory' => 0,
'memory_limit' => $this->convertToBytes(\ini_get('memory_limit')),
];
}
public function lateCollect(): void
{
$this->updateMemoryUsage();
}
| n __construct()
{
$this->reset();
}
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
$this->updateMemoryUsage();
}
public function rese | {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php",
"language": "php",
"file_size": 2218,
"cut_index": 563,
"middle_length": 229
} |
t\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Process\Process;
use Symfony\Component\VarDumper\Cloner\Data;
/**
* @author Fabien Potencier <fabien@symfony.com>
*
* @final
*/
class RequestDataCollector extends DataCollector implements EventSubscriberInterface, LateDataCollect... | {
// attributes are serialized and as they can be anything, they need to be converted to strings.
$attributes = [];
$route = '';
foreach ($request->attributes->all() as $key => $value) {
if ('_route' === $key) | ct(
private ?RequestStack $requestStack = null,
) {
$this->controllers = new \SplObjectStorage();
}
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
| {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php",
"language": "php",
"file_size": 18327,
"cut_index": 1331,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\H... | /**
* @final
*/
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
if ($response instanceof RedirectResponse) {
$this->data['redirect'] = true;
$this->data[ | uterDataCollector extends DataCollector
{
/**
* @var \SplObjectStorage<Request, callable>
*/
protected \SplObjectStorage $controllers;
public function __construct()
{
$this->reset();
}
| {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php",
"language": "php",
"file_size": 2351,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Ker... | $this->data = ['events' => [], 'stopwatch_installed' => false, 'start_time' => 0];
}
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
if (null !== $this->kernel) {
$sta | llector extends DataCollector implements LateDataCollectorInterface
{
public function __construct(
private readonly ?KernelInterface $kernel = null,
private readonly ?Stopwatch $stopwatch = null,
) {
| {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php",
"language": "php",
"file_size": 3348,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\CacheClearer;
use Psr\Cache\CacheItemPoolInterface;
/**
* @author... | s \InvalidArgumentException If the cache pool with the given name does not exist
*/
public function getPool(string $name): CacheItemPoolInterface
{
if (!$this->hasPool($name)) {
throw new \InvalidArgumentException(\sprintf( |
*/
public function __construct(array $pools = [])
{
$this->pools = $pools;
}
public function hasPool(string $name): bool
{
return isset($this->pools[$name]);
}
/**
* @throw | {
"filepath": "src/Symfony/Component/HttpKernel/CacheClearer/Psr6CacheClearer.php",
"language": "php",
"file_size": 1629,
"cut_index": 537,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Log;
use Monolog\Logger;
/**
* @author Nicolas Greka... | {
if ($this->processor) {
$logger->pushProcessor($this->processor);
}
}
public static function getDebugLogger(mixed $logger): ?DebugLoggerInterface
{
if ($logger instanceof DebugLoggerInterface) {
| le ?? !\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
$this->processor = \is_object($processor) ? $processor : $processor(...);
}
}
public function pushDebugLogger(Logger $logger): void
| {
"filepath": "src/Symfony/Component/HttpKernel/Log/DebugLoggerConfigurator.php",
"language": "php",
"file_size": 1327,
"cut_index": 524,
"middle_length": 229
} |
?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Log;
use Symfony\Component\HttpFoundation\R... | ing,
* }>
*/
public function getLogs(?Request $request = null): array;
/**
* Returns the number of errors.
*/
public function countErrors(?Request $request = null): int;
/**
* Removes all log records.
*/
| ray<array{
* channel: ?string,
* context: array<string, mixed>,
* message: string,
* priority: int,
* priorityName: string,
* timestamp: int,
* timestamp_rfc3339: str | {
"filepath": "src/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php",
"language": "php",
"file_size": 1031,
"cut_index": 513,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Log;
use Psr\Log\AbstractLogger;
use Psr\Log\InvalidArgumentException;
use Psr\Log\LogLevel;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
/**
* Minimalist PSR-3 logger designed to write in std... | 7,
];
private const PRIORITIES = [
LogLevel::DEBUG => 100,
LogLevel::INFO => 200,
LogLevel::NOTICE => 250,
LogLevel::WARNING => 300,
LogLevel::ERROR => 400,
LogLevel::CRITICAL => 500,
LogLeve | ::DEBUG => 0,
LogLevel::INFO => 1,
LogLevel::NOTICE => 2,
LogLevel::WARNING => 3,
LogLevel::ERROR => 4,
LogLevel::CRITICAL => 5,
LogLevel::ALERT => 6,
LogLevel::EMERGENCY => | {
"filepath": "src/Symfony/Component/HttpKernel/Log/Logger.php",
"language": "php",
"file_size": 5835,
"cut_index": 716,
"middle_length": 229
} |
den="true" focusable="false" class="icon icon-tabler icon-tabler-box" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8... | th stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2"></path>
</svg>
SV | den="true" focusable="false" class="icon icon-tabler icon-tabler-folder-open" width="40" height="40" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<pa | {
"filepath": "src/Symfony/Component/HttpKernel/Resources/welcome.html.php",
"language": "php",
"file_size": 40436,
"cut_index": 2151,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller;
use Psr\Container\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Attribute\ValueResolver;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\DefaultValueResolver;
use Symfo... | \Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactoryInterface;
use Symfony\Component\HttpKernel\Exception\NearMissValueResolverException;
use Symfony\Component\HttpKernel\Exception\ResolverNotFoundException;
use Symfony\Contracts\Service\Servic | Kernel\Controller\ArgumentResolver\SessionValueResolver;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\VariadicValueResolver;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactory;
use Symfony | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ArgumentResolver.php",
"language": "php",
"file_size": 6148,
"cut_index": 716,
"middle_length": 229
} |
*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller;
use Symfony\Component\HttpFoundation\R... | nts to pass to the controller.
*
* @throws \RuntimeException When no value could be provided for a required argument
*/
public function getArguments(Request $request, callable $controller, ?\ReflectionFunctionAbstract $reflector = null): | esolverInterface
{
/**
* Returns the argume | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ArgumentResolverInterface.php",
"language": "php",
"file_size": 838,
"cut_index": 520,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Co... | er,
?LoggerInterface $logger = null,
) {
parent::__construct($logger);
}
protected function instantiateController(string $class): object
{
$class = ltrim($class, '\\');
if ($this->container->has($class)) {
| <fabien@symfony.com>
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*/
class ContainerControllerResolver extends ControllerResolver
{
public function __construct(
protected ContainerInterface $contain | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ContainerControllerResolver.php",
"language": "php",
"file_size": 2183,
"cut_index": 563,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller;
use Symfony\Component\HttpKernel\Fragment\... | e
{
public array $attributes = [];
public array $query = [];
/**
* @param string $controller The controller name
* @param array $attributes An array of parameters to add to the Request attributes
* @param array $query An | latter case, instead of passing an array representing
* the controller, you can use an instance of this class.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @see FragmentRendererInterface
*/
class ControllerReferenc | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ControllerReference.php",
"language": "php",
"file_size": 1287,
"cut_index": 524,
"middle_length": 229
} |
HttpFoundation\Request;
use Symfony\Component\HttpKernel\Attribute\AsController;
/**
* This implementation uses the '_controller' request attribute to determine
* the controller to execute.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Tobias Schultze <http://tobion.de>
*/
class ControllerResolver ... | (array $types = [], array $attributes = []): void
{
foreach ($types as $type) {
$this->allowedControllerTypes[$type] = $type;
}
foreach ($attributes as $attribute) {
$this->allowedControllerAttributes[$a | lic function __construct(
private ?LoggerInterface $logger = null,
) {
}
/**
* @param array<class-string> $types
* @param array<class-string> $attributes
*/
public function allowControllers | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php",
"language": "php",
"file_size": 9730,
"cut_index": 921,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller;
use Symfony\Component\HttpFoundation\Reque... | tion, a resolver must
* return false when it is not able to determine the controller.
*
* The resolver must only throw an exception when it should be able to load a
* controller but cannot because of some errors made by the developer.
| @author Fabien Potencier <fabien@symfony.com>
*/
interface ControllerResolverInterface
{
/**
* Returns the Controller instance associated with a Request.
*
* As several resolvers can exist for a single applica | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php",
"language": "php",
"file_size": 1372,
"cut_index": 524,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorR... | public function __construct(
private HttpKernelInterface $kernel,
private string|object|array|null $controller,
private ErrorRendererInterface $errorRenderer,
) {
}
public function __invoke(\Throwable $exception): R | ttpKernel\HttpKernelInterface;
/**
* Renders error or exception pages from a given FlattenException.
*
* @author Yonel Ceruto <yonelceruto@gmail.com>
* @author Matthias Pigulla <mp@webfactory.de>
*/
class ErrorController
{
| {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ErrorController.php",
"language": "php",
"file_size": 1870,
"cut_index": 537,
"middle_length": 229
} |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller;
use Symfony\Component\HttpFoun... | bstract $reflector = null): array
{
$e = $this->stopwatch->start('controller.get_arguments');
try {
return $this->resolver->getArguments($request, $controller, $reflector);
} finally {
$e->stop();
| public function __construct(
private ArgumentResolverInterface $resolver,
private Stopwatch $stopwatch,
) {
}
public function getArguments(Request $request, callable $controller, ?\ReflectionFunctionA | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/TraceableArgumentResolver.php",
"language": "php",
"file_size": 1009,
"cut_index": 512,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Stopwatch\Stopwatch;
/**
* @author Fabien Potencier <f... | ublic function getController(Request $request): callable|false
{
$e = $this->stopwatch->start('controller.get_callable');
try {
return $this->resolver->getController($request);
} finally {
$e->stop();
| private Stopwatch $stopwatch,
) {
}
p | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/TraceableControllerResolver.php",
"language": "php",
"file_size": 930,
"cut_index": 606,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Compon... | xime.steinhausser@gmail.com>
*/
final class BackedEnumValueResolver implements ValueResolverInterface
{
public function resolve(Request $request, ArgumentMetadata $argument): iterable
{
if (!is_subclass_of($argument->getType(), \BackedEnum | * Attempt to resolve backed enum cases from request attributes, for a route path parameter,
* leading to a 404 Not Found if the attribute value isn't a valid backing value for the enum type.
*
* @author Maxime Steinhausser <ma | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/BackedEnumValueResolver.php",
"language": "php",
"file_size": 2436,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver;
use Psr\Clock\ClockInterface;
use Symfony\Component\HttpFoundati... | m@codedmonkey.com>
*/
final class DateTimeValueResolver implements ValueResolverInterface
{
public function __construct(
private readonly ?ClockInterface $clock = null,
) {
}
public function resolve(Request $request, ArgumentMetad | mentMetadata;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Convert DateTime instances from request attribute variable.
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Tim Goudriaan <ti | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/DateTimeValueResolver.php",
"language": "php",
"file_size": 2871,
"cut_index": 563,
"middle_length": 229
} |
hp
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver;
use Symfony\Comp... | st $request, ArgumentMetadata $argument): array
{
if ($argument->hasDefaultValue()) {
return [$argument->getDefaultValue()];
}
if (null !== $argument->getType() && $argument->isNullable() && !$argument->isVariadic() | lt value defined in the action signature when no value has been given.
*
* @author Iltar van der Berg <kjarli@gmail.com>
*/
final class DefaultValueResolver implements ValueResolverInterface
{
public function resolve(Reque | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/DefaultValueResolver.php",
"language": "php",
"file_size": 1069,
"cut_index": 515,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver;
use Psr\Container\ContainerInterface;
use Symfony\Component\Depe... | llerValueResolver implements ValueResolverInterface
{
public function __construct(
private ContainerInterface $container,
) {
}
public function resolve(Request $request, ArgumentMetadata $argument): array
{
$controller | ontrollerMetadata\ArgumentMetadata;
/**
* Provides an intuitive error message when controller fails because it is not registered as a service.
*
* @author Simeon Kolev <simeon.kolev9@gmail.com>
*/
final class NotTaggedContro | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/NotTaggedControllerValueResolver.php",
"language": "php",
"file_size": 2124,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Attribute\MapQueryParameter;
use Symfony\Component\HttpKernel\Controller\ValueResolverInterface;
use Symfony\Component\HttpKernel\Controll... | .com>
*/
final class QueryParameterValueResolver implements ValueResolverInterface
{
public function resolve(Request $request, ArgumentMetadata $argument): array
{
if (!$attribute = $argument->getAttributesOfType(MapQueryParameter::class)[ | , \BackedEnum from query parameters.
*
* @author Ruud Kamphuis <ruud@ticketswap.com>
* @author Nicolas Grekas <p@tchwork.com>
* @author Mateusz Anders <anders_mateusz@outlook.com>
* @author Ionut Enache <i.ovidiuenache@yahoo | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/QueryParameterValueResolver.php",
"language": "php",
"file_size": 5274,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Compon... | ve(Request $request, ArgumentMetadata $argument): array
{
if ($argument->isVariadic()) {
return [];
}
$name = $argument->getName();
if (!$request->attributes->has($name)) {
return [];
}
| * Yields a non-variadic argument's value from the request attributes.
*
* @author Iltar van der Berg <kjarli@gmail.com>
*/
final class RequestAttributeValueResolver implements ValueResolverInterface
{
public function resol | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestAttributeValueResolver.php",
"language": "php",
"file_size": 2288,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Controller\ArgumentResolver;
use Symfony\Component\HttpFoundation\AcceptHeader;
use Symfony\C... | etadata $argument): array
{
if (!$attribute = $argument->getAttributesOfType(MapRequestHeader::class)[0] ?? null) {
return [];
}
$type = $argument->getType();
if (!\in_array($type, ['string', 'array', Accep | el\ControllerMetadata\ArgumentMetadata;
use Symfony\Component\HttpKernel\Exception\HttpException;
final class RequestHeaderValueResolver implements ValueResolverInterface
{
public function resolve(Request $request, ArgumentM | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestHeaderValueResolver.php",
"language": "php",
"file_size": 2469,
"cut_index": 563,
"middle_length": 229
} |
ge\Expression;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Attribute\MapQueryString;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Component... | lueResolverException;
use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Serializer\Exception\InvalidArgumentException as SerializerInvalidArgumentException;
us | ponent\HttpKernel\Event\ControllerArgumentsEvent;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NearMissVa | {
"filepath": "src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php",
"language": "php",
"file_size": 16722,
"cut_index": 921,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Exception;
/**
* HttpException.
*
* @author Kris Wallsmith <kris@symfony.com>
*/
class Ht... | ?\Throwable $previous = null, array $headers = [], int $code = 0): self
{
return match ($statusCode) {
400 => new BadRequestHttpException($message, $previous, $code, $headers),
403 => new AccessDeniedHttpException($messa | revious = null,
private array $headers = [],
int $code = 0,
) {
parent::__construct($message, $code, $previous);
}
public static function fromStatusCode(int $statusCode, string $message = '', | {
"filepath": "src/Symfony/Component/HttpKernel/Exception/HttpException.php",
"language": "php",
"file_size": 2546,
"cut_index": 563,
"middle_length": 229
} |
he Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Exception;
/**
* @author Ben Ramsey <ben@benramsey.com>
*
* @see http://to... | onstruct(int|string|null $retryAfter = null, string $message = '', ?\Throwable $previous = null, int $code = 0, array $headers = [])
{
if ($retryAfter) {
$headers['Retry-After'] = $retryAfter;
}
parent::__construct( | quest may be retried
*/
public function __c | {
"filepath": "src/Symfony/Component/HttpKernel/Exception/TooManyRequestsHttpException.php",
"language": "php",
"file_size": 907,
"cut_index": 547,
"middle_length": 52
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Fragment;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation... | m>
*
* @see FragmentRendererInterface
*/
class FragmentHandler
{
/** @var array<string, FragmentRendererInterface> */
private array $renderers = [];
/**
* @param FragmentRendererInterface[] $renderers An array of FragmentRendererInterf | ragment.
*
* This class handles the rendering of resource fragments that are included into
* a main resource. The handling of the rendering is managed by specialized renderers.
*
* @author Fabien Potencier <fabien@symfony.co | {
"filepath": "src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php",
"language": "php",
"file_size": 3624,
"cut_index": 614,
"middle_length": 229
} |
ackage.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Fragment;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundat... | * Renders a URI and returns the Response content.
*/
public function render(string|ControllerReference $uri, Request $request, array $options = []): Response;
/**
* Gets the name of the strategy.
*/
public function getName(): s | /
interface FragmentRendererInterface
{
/**
| {
"filepath": "src/Symfony/Component/HttpKernel/Fragment/FragmentRendererInterface.php",
"language": "php",
"file_size": 876,
"cut_index": 559,
"middle_length": 52
} |
?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Fragment;
use Symfony\Component\HttpFoundat... | bool $strict Whether to allow non-scalar attributes or not
* @param bool $sign Whether to sign the URL or not
*/
public function generate(ControllerReference $controller, ?Request $request = null, bool $absolute = false, bool $strict = | unglas <kevin@dunglas.fr>
*/
interface FragmentUriGeneratorInterface
{
/**
* Generates a fragment URI for a given controller.
*
* @param bool $absolute Whether to generate an absolute URL or not
* @param | {
"filepath": "src/Symfony/Component/HttpKernel/Fragment/FragmentUriGeneratorInterface.php",
"language": "php",
"file_size": 1035,
"cut_index": 513,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Fragment;
use Symfony\Component\HttpFoundation\Request... | ragment';
/**
* Sets the fragment path that triggers the fragment listener.
*
* @see FragmentListener
*/
public function setFragmentPath(string $path): void
{
$this->fragmentPath = $path;
}
/**
* Gener | a given Controller.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class RoutableFragmentRenderer implements FragmentRendererInterface
{
/**
* @internal
*/
protected string $fragmentPath = '/_f | {
"filepath": "src/Symfony/Component/HttpKernel/Fragment/RoutableFragmentRenderer.php",
"language": "php",
"file_size": 1498,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Attribute;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\HttpFoundation\Request;
/**
* Describes the default HTTP... | Cache
{
/**
* @internal
*/
public public(set) readonly array $variables;
public function __construct(
/**
* The expiration date as a valid date for the strtotime() function.
*/
public ?string $expire | king-your-responses-http-cacheable
*
* @author Fabien Potencier <fabien@symfony.com>
*/
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION | \Attribute::IS_REPEATABLE)]
final class | {
"filepath": "src/Symfony/Component/HttpKernel/Attribute/Cache.php",
"language": "php",
"file_size": 4972,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Attribute;
use Symfony\Component\HttpFoundation\Response;
use Symfo... |
{
/**
* @see https://php.net/manual/filter.constants for filter, flags and options
*
* @param string|null $name The name of the query parameter; if null, the name of the argument in the contro | er to a controller argument.
*
* @author Ruud Kamphuis <ruud@ticketswap.com>
* @author Ionut Enache <i.ovidiuenache@yahoo.com>
*/
#[\Attribute(\Attribute::TARGET_PARAMETER)]
final class MapQueryParameter extends ValueResolver | {
"filepath": "src/Symfony/Component/HttpKernel/Attribute/MapQueryParameter.php",
"language": "php",
"file_size": 1842,
"cut_index": 537,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Attribute;
use Symfony\Component\HttpFoundation\... | ss name of the resolver to use
* @param int $validationFailedStatusCode The HTTP code to return if the validation fails
*/
public function __construct(
public readonly ?string $name = null,
string $resolver = RequestH | er
{
/**
* @param string|null $name The name of the header parameter; if null, the name of the argument in the controller will be used
* @param class-string $resolver The cla | {
"filepath": "src/Symfony/Component/HttpKernel/Attribute/MapRequestHeader.php",
"language": "php",
"file_size": 1172,
"cut_index": 518,
"middle_length": 229
} |
hp
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Attribute;
use Symfony\Component\HttpFoundati... | aint>|null */
public Constraint|array|null $constraints = null,
public ?string $name = null,
string $resolver = RequestPayloadValueResolver::class,
public readonly int $validationFailedStatusCode = Response::HTTP_UNPROCESSAB | nt\Validator\Constraint;
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class MapUploadedFile extends ValueResolver
{
public ArgumentMetadata $metadata;
public function __construct(
/** @var Constraint|array<Constr | {
"filepath": "src/Symfony/Component/HttpKernel/Attribute/MapUploadedFile.php",
"language": "php",
"file_size": 1067,
"cut_index": 515,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Attribute;
/**
* Controller tag to serialize response.
*
* @author Konstantin Myakshin <molodchick@gmail.com>
*/
#[\Attribute(\Attri... | ring, mixed> $context The serialization context passed to the serializer
*/
public function __construct(
public readonly int $code = 200,
public readonly array $headers = [],
public readonly array $context = [],
) {
| eaders to set on the response
* @param array<st | {
"filepath": "src/Symfony/Component/HttpKernel/Attribute/Serialize.php",
"language": "php",
"file_size": 919,
"cut_index": 606,
"middle_length": 52
} |
php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Attribute;
/**
* Defines the HTTP status co... | de The HTTP status code to use
* @param array<string, string> $headers The HTTP headers to add to the response
*/
public function __construct(
public readonly int $statusCode,
public readonly array $headers = [],
) {
| $statusCo | {
"filepath": "src/Symfony/Component/HttpKernel/Attribute/WithHttpStatus.php",
"language": "php",
"file_size": 790,
"cut_index": 514,
"middle_length": 14
} |
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\HttpFoundation\R... | able $exception = null): void
{
// all collecting is done client side
}
public function reset(): void
{
// all collecting is done client side
}
public function getName(): string
{
return 'ajax';
}
} | ollect(Request $request, Response $response, ?\Throw | {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/AjaxDataCollector.php",
"language": "php",
"file_size": 832,
"cut_index": 523,
"middle_length": 52
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\DataCollector;
use Composer\InstalledVersions;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Com... | l(KernelInterface $kernel): void
{
$this->kernel = $kernel;
}
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
$eom = \DateTimeImmutable::createFromFormat('d/m/Y', '01/'.K | l
*/
class ConfigDataCollector extends DataCollector implements LateDataCollectorInterface
{
private KernelInterface $kernel;
/**
* Sets the Kernel associated with this Request.
*/
public function setKerne | {
"filepath": "src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php",
"language": "php",
"file_size": 8902,
"cut_index": 716,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.