prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
UsageException;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelInterface;
class SessionListenerTest extends TestCase
{
#[DataProvider('provideSessionOptions')]
#[RunInSeparateProcess]
public function testSessionCookieOptions(array $phpSessionOptions, array $ses... | e'])) {
ini_set('session.cookie_samesite', $phpSessionOptions['samesite']);
}
session_set_cookie_params(0, $phpSessionOptions['path'] ?? null, $phpSessionOptions['domain'] ?? null, $phpSessionOptions['secure'] ?? null, $phpSessi | etId')->willReturn('123456');
$session->method('getName')->willReturn('PHPSESSID');
$session->method('save');
$session->method('isStarted')->willReturn(true);
if (isset($phpSessionOptions['samesit | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php",
"language": "php",
"file_size": 42639,
"cut_index": 2151,
"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\Tests\EventListener;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\Ev... | e
{
public function testFilterDoesNothingForSubRequests()
{
$dispatcher = new EventDispatcher();
$kernel = $this->createStub(HttpKernelInterface::class);
$response = new Response('foo <esi:include src="" />');
$liste | el\EventListener\SurrogateListener;
use Symfony\Component\HttpKernel\HttpCache\Esi;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
class SurrogateListenerTest extends TestCas | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/EventListener/SurrogateListenerTest.php",
"language": "php",
"file_size": 2749,
"cut_index": 563,
"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\Tests\EventListener;
use PHPUnit\Framework\TestCase;
use Symfony\Co... | st extends TestCase
{
protected function tearDown(): void
{
Request::setTrustedProxies([], -1);
}
public function testListenerThrowsWhenMainRequestHasInconsistentClientIps()
{
$this->expectException(ConflictingHeadersEx | nel\Event\RequestEvent;
use Symfony\Component\HttpKernel\EventListener\ValidateRequestListener;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
class ValidateRequestListenerTe | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/EventListener/ValidateRequestListenerTest.php",
"language": "php",
"file_size": 1744,
"cut_index": 537,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\Event;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\Co... | EventTest extends TestCase
{
public function testControllerArgumentsEvent()
{
$event = new ControllerArgumentsEvent(new TestHttpKernel(), static function () {}, ['test'], new Request(), HttpKernelInterface::MAIN_REQUEST);
$this->ass | Bar;
use Symfony\Component\HttpKernel\Tests\Fixtures\Attribute\Baz;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\AttributeController;
use Symfony\Component\HttpKernel\Tests\TestHttpKernel;
class ControllerArguments | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Event/ControllerArgumentsEventTest.php",
"language": "php",
"file_size": 5937,
"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\Tests\Event;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\ExpressionLanguage\Expre... | ymfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\AttributeController;
use Symfony\Component\HttpKernel\Tests\TestHttpKernel;
class ControllerAttributeEventTest extends TestCase
{
public functi | nt\HttpKernel\Event\ControllerArgumentsMetadata;
use Symfony\Component\HttpKernel\Event\ControllerAttributeEvent;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use S | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Event/ControllerAttributeEventTest.php",
"language": "php",
"file_size": 4609,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\Event;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ExpressionLanguage\Expression;
use Symf... | Fixtures\Controller\AttributeController;
use Symfony\Component\HttpKernel\Tests\TestHttpKernel;
class ControllerEventTest extends TestCase
{
#[DataProvider('provideGetAttributes')]
public function testGetAttributes(callable $controller)
{
| lerEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Tests\Fixtures\Attribute\Bar;
use Symfony\Component\HttpKernel\Tests\Fixtures\Attribute\Baz;
use Symfony\Component\HttpKernel\Tests\ | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Event/ControllerEventTest.php",
"language": "php",
"file_size": 7830,
"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\Tests\Bundle;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
use PHPUnit\Framework\TestCase;
use S... | ction testGetContainerExtension()
{
$bundle = new ExtensionPresentBundle();
$this->assertInstanceOf(
'Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\DependencyInjection\ExtensionPresentExtension',
| Component\HttpKernel\Tests\Fixtures\BundleCompilerPass\BundleAsCompilerPassBundle;
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\ExtensionPresentBundle;
class BundleTest extends TestCase
{
public fun | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php",
"language": "php",
"file_size": 3102,
"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\Tests\Config;
use PHPUnit\Framework\Attributes\G... | >atLeastOnce())
->method('locateResource')
->with('@BundleName/some/path')
->willReturn('/bundle-name/some/path');
$locator = new FileLocator($kernel);
$this->assertEquals('/bundle-name/some/path', $locat | ;
#[Group('legacy')]
#[IgnoreDeprecations]
class FileLocatorTest extends TestCase
{
public function testLocate()
{
$kernel = $this->createMock(KernelInterface::class);
$kernel
->expects($this- | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Config/FileLocatorTest.php",
"language": "php",
"file_size": 1240,
"cut_index": 518,
"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\Tests\Debug;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psr\Log\LogLevel;
use Psr\Log\NullLogger;
use Sy... | Loggers([]);
$this->assertArrayHasKey(\E_DEPRECATED, $loggers);
$this->assertSame([$logger, LogLevel::INFO], $loggers[\E_DEPRECATED]);
}
#[DataProvider('provideLevelsAssignedToLoggers')]
public function testLevelsAssignedToLog | gure()
{
$logger = new NullLogger();
$configurator = new ErrorHandlerConfigurator($logger);
$handler = new ErrorHandler();
$configurator->configure($handler);
$loggers = $handler->set | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerConfiguratorTest.php",
"language": "php",
"file_size": 4056,
"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\Tests\Debug;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request... | entDispatcher\Event;
class TraceableEventDispatcherTest extends TestCase
{
public function testStopwatchSections()
{
$dispatcher = new TraceableEventDispatcher(new EventDispatcher(), $stopwatch = new Stopwatch());
$kernel = $this-> | \HttpKernel\Controller\ControllerResolverInterface;
use Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Contracts\Ev | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php",
"language": "php",
"file_size": 4672,
"cut_index": 614,
"middle_length": 229
} |
age = new FileProfilerStorage('file:'.$this->tmpDir);
$this->storage->purge();
}
protected function tearDown(): void
{
self::cleanDir();
}
public function testStore()
{
for ($i = 0; $i < 10; ++$i) {
$profile = new Profile('token_'.$i);
$profile->... | le->setIp('127.0.0.1');
$parentProfile->setUrl('http://foo.bar/parent');
$parentProfile->setStatusCode(200);
$parentProfile->setMethod('GET');
$childProfile = new Profile('token_child');
$childProfile->setIp('127.0. | , $this->storage->find('127.0.0.1', 'http://foo.bar', 20, 'GET'), '->write() stores data in the storage');
}
public function testChildren()
{
$parentProfile = new Profile('token_parent');
$parentProfi | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php",
"language": "php",
"file_size": 18767,
"cut_index": 1331,
"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\Tests\Controller\ArgumentResolver;
use PHPUnit\Framework\TestCase;
use Symfony\Component\BrowserKit\Request as RandomRequest;
use Symfony\Compon... | turned()
{
$resolver = new RequestValueResolver();
$expectedRequest = Request::create('/');
$actualRequest = $resolver->resolve($expectedRequest, new ArgumentMetadata('request', Request::class, false, false, null));
self | \Component\HttpKernel\Exception\NearMissValueResolverException;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\ExtendingRequest;
class RequestValueResolverTest extends TestCase
{
public function testSameRequestRe | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/RequestValueResolverTest.php",
"language": "php",
"file_size": 3079,
"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\HttpKernel\Tests\Controller\ArgumentResolver;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Http... | public function testResolveReturnsSession()
{
$resolver = new SessionValueResolver();
$session = new Session(new MockArraySessionStorage());
$request = Request::create('/');
$request->setSession($session);
$me | ckArraySessionStorage;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\SessionValueResolver;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
class SessionValueResolverTest extends TestCase
{
| {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/SessionValueResolverTest.php",
"language": "php",
"file_size": 2508,
"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\Tests\DataCollector;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Req... | heme()
{
$c = new CloneVarDataCollector('scheme://foo');
$c->collect(new Request(), new Response());
$cloner = new VarCloner();
$this->assertEquals($cloner->cloneVar('scheme://foo'), $c->getData());
}
public fu | pertyInDestruct;
use Symfony\Component\HttpKernel\Tests\Fixtures\WithPublicObjectProperty;
use Symfony\Component\VarDumper\Cloner\VarCloner;
class DataCollectorTest extends TestCase
{
public function testCloneVarStringWithSc | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DataCollector/DataCollectorTest.php",
"language": "php",
"file_size": 2751,
"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\Tests\DataCollector;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Red... | DataCollector();
$request = Request::create('http://test.com/foo?bar=baz');
$response = new RedirectResponse('http://test.com/redirect');
$event = $this->createControllerEvent($request);
$collector->onKernelController($ev | onent\HttpKernel\Event\ControllerEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
class RouterDataCollectorTest extends TestCase
{
public function testRouteRedirectResponse()
{
$collector = new Router | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DataCollector/RouterDataCollectorTest.php",
"language": "php",
"file_size": 2876,
"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\Tests\DataCollector;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request;
use S... | new Request();
$request->server->set('REQUEST_TIME', 1);
$c->collect($request, new Response());
$this->assertEquals(0, $c->getStartTime());
$request->server->set('REQUEST_TIME_FLOAT', 2);
$c->collect($request, n | opwatch;
use Symfony\Component\Stopwatch\StopwatchEvent;
#[Group('time-sensitive')]
class TimeDataCollectorTest extends TestCase
{
public function testCollect()
{
$c = new TimeDataCollector();
$request = | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php",
"language": "php",
"file_size": 4760,
"cut_index": 614,
"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\Tests\Fixtures;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symf... | erContainerConfiguration(LoaderInterface $loader): void
{
}
public function getProjectDir(): string
{
return __DIR__;
}
protected function build(ContainerBuilder $container): void
{
$container->setParameter('te | return [];
}
public function regist | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelWithoutBundles.php",
"language": "php",
"file_size": 884,
"cut_index": 547,
"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\Tests\Fixtures\DataCollector;
use Symfony\... | ponse $response, ?\Throwable $exception = null): void
{
$this->data = $this->cloneVar($this->varToClone);
}
public function getData(): Data
{
return $this->data;
}
public function getName(): string
{
re | al class CloneVarDataCollector extends DataCollector
{
private $varToClone;
public function __construct($varToClone)
{
$this->varToClone = $varToClone;
}
public function collect(Request $request, Res | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Fixtures/DataCollector/CloneVarDataCollector.php",
"language": "php",
"file_size": 1023,
"cut_index": 512,
"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\Tests\Fixtures\Controller;
use Symfony\Component\HttpKernel\Tests\Fixtures\At... | hod')]
public function __invoke()
{
}
public function action(#[Foo('bar')] string $baz)
{
}
public function multiAttributeArg(#[Foo('bar'), Undefined('bar')] string $baz)
{
}
public function issue41478(#[Foo('bar' | ontroller
{
#[Bar('method'), Baz, Undefined('met | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Fixtures/Controller/AttributeController.php",
"language": "php",
"file_size": 898,
"cut_index": 547,
"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\Tests\Fixtures\Controller;
use Symfony\Comp... | utesController
{
#[Buz]
#[Qux]
public function buzQuxAction()
{
}
#[Buz]
public function buzAction()
{
}
#[SubBuz]
public function subBuzAction()
{
}
public function noAttributeAction()
{
} | ntrollerAttrib | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Fixtures/Controller/ControllerAttributesController.php",
"language": "php",
"file_size": 786,
"cut_index": 513,
"middle_length": 14
} |
eResolver;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestAttributeValueResolver;
use Symfony\Component\HttpKernel\Controller\ValueResolverInterface;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactory;
us... | es\Controller\VariadicController;
class ArgumentResolverTest extends TestCase
{
public static function getResolver(array $chainableResolvers = [], ?array $namedResolvers = null): ArgumentResolver
{
if (null !== $namedResolvers) {
| ontroller\ExtendingRequest;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\ExtendingSession;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\NullableController;
use Symfony\Component\HttpKernel\Tests\Fixtur | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolverTest.php",
"language": "php",
"file_size": 20414,
"cut_index": 1331,
"middle_length": 229
} |
ymfony\Component\HttpFoundation\Exception\BadRequestException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\HttpKernel\Controller\ControllerResolver;
class ControllerResolverTest extends TestCase
{
public function testGetControllerWith... | () returns false when the request has no _controller attribute');
}
public function testGetControllerWithLambda()
{
$resolver = $this->createControllerResolver();
$request = Request::create('/');
$request->attributes-> | as the "_controller" parameter is missing.');
$resolver = $this->createControllerResolver($logger);
$request = Request::create('/');
$this->assertFalse($resolver->getController($request), '->getController | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php",
"language": "php",
"file_size": 13136,
"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 Controller;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Re... | chEvent::class);
$stopwatchEvent->expects(self::once())->method('stop');
$stopwatch = $this->createStub(Stopwatch::class);
$stopwatch->method('start')->willReturn($stopwatchEvent);
$resolver = new class implements Argument | use Symfony\Component\Stopwatch\StopwatchEvent;
class TraceableArgumentResolverTest extends TestCase
{
public function testStopwatchEventIsStoppedWhenResolverThrows()
{
$stopwatchEvent = $this->createMock(Stopwat | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/TraceableArgumentResolverTest.php",
"language": "php",
"file_size": 1480,
"cut_index": 524,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\Controller\ArgumentResolver;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\BackedEnumValueResolver;
... | data, bool $expectedSupport)
{
$resolver = new BackedEnumValueResolver();
$this->assertCount((int) $expectedSupport, $resolver->resolve($request, $metadata));
}
public static function provideTestSupportsData(): iterable
{
|
use Symfony\Component\HttpKernel\Tests\Fixtures\Suit;
class BackedEnumValueResolverTest extends TestCase
{
#[DataProvider('provideTestSupportsData')]
public function testSupports(Request $request, ArgumentMetadata $meta | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/BackedEnumValueResolverTest.php",
"language": "php",
"file_size": 5370,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\Controller\ArgumentResolver;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Component\HttpFoundation\Request;
use S... | n () => new ServiceLocator([
'dummy' => static fn () => new \stdClass(),
]),
]));
$argument = new ArgumentMetadata('dummy', \stdClass::class, false, false, null);
$request = $this->requestWithAttributes([ | esolverTest extends TestCase
{
public function testDoNotSupportWhenControllerExists()
{
$resolver = new NotTaggedControllerValueResolver(new ServiceLocator([
'App\\Controller\\Mine::method' => static f | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/NotTaggedControllerValueResolverTest.php",
"language": "php",
"file_size": 5337,
"cut_index": 716,
"middle_length": 229
} |
nent\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\MapQueryParameter;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\QueryParameterValueResolver;
use Symfony\Component\HttpKernel\Controller\ValueResolverInterface;
use Symfony\Component\Ht... | olver;
protected function setUp(): void
{
$this->resolver = new QueryParameterValueResolver();
}
public function testSkipWhenNoAttribute()
{
$metadata = new ArgumentMetadata('firstName', 'string', false, true, false);
| t\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Tests\Fixtures\Suit;
use Symfony\Component\Uid\Ulid;
class QueryParameterValueResolverTest extends TestCase
{
private ValueResolverInterface $res | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/QueryParameterValueResolverTest.php",
"language": "php",
"file_size": 15572,
"cut_index": 921,
"middle_length": 229
} |
t, $argument);
$event = new ControllerArgumentsEvent($kernel, static function () {}, $arguments, $request, HttpKernelInterface::MAIN_REQUEST);
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('Could not resolve the "$notTyped" controller argument: argument should be... | new ArgumentMetadata('valid', RequestPayload::class, false, true, $payload, false, [
MapRequestPayload::class => new MapRequestPayload(),
]);
$request = Request::create('/', 'POST', [], [], [], ['CONTENT_TYPE' => 'application/js | $this->createMock(ValidatorInterface::class);
$validator->expects($this->never())
->method('validate');
$resolver = new RequestPayloadValueResolver(new Serializer(), $validator);
$argument = | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/RequestPayloadValueResolverTest.php",
"language": "php",
"file_size": 66945,
"cut_index": 3790,
"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\Tests\Controller\ArgumentResolver;
use PHPUnit\Framework\TestCase;
... | $stopwatch = new Stopwatch();
$resolver = new TraceableValueResolver(new ResolverStub(), $stopwatch);
$argument = new ArgumentMetadata('dummy', 'string', false, false, null);
$request = new Request();
$iterable = $resolver | rface;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
use Symfony\Component\Stopwatch\Stopwatch;
class TraceableValueResolverTest extends TestCase
{
public function testTimingsInResolve()
{
| {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/TraceableValueResolverTest.php",
"language": "php",
"file_size": 1907,
"cut_index": 537,
"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\EventListener;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleEvent;
use Symfony\Component\Console\Outp... | private string|object|null $earlyHandler;
private ?\Closure $exceptionHandler;
private bool $webMode;
private bool $firstCall = true;
private bool $hasTerminatedWithException = false;
/**
* @param callable|null $exceptionHandler | use Symfony\Component\HttpKernel\KernelEvents;
/**
* Sets an exception handler.
*
* @author Nicolas Grekas <p@tchwork.com>
*
* @final
*
* @internal
*/
class DebugHandlersListener implements EventSubscriberInterface
{
| {
"filepath": "src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php",
"language": "php",
"file_size": 4704,
"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\Tests\CacheClearer;
use PHPUnit\Framework\TestCase;
us... |
}
public function testClearPool()
{
$pool = $this->createMock(CacheItemPoolInterface::class);
$pool
->expects($this->once())
->method('clear')
->willReturn(true)
;
$this->as | onstructor()
{
$pool = $this->createMock(CacheItemPoolInterface::class);
$pool
->expects($this->once())
->method('clear');
(new Psr6CacheClearer(['pool' => $pool]))->clear(''); | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/CacheClearer/Psr6CacheClearerTest.php",
"language": "php",
"file_size": 1367,
"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\HttpKernel\Tests\Fixtures\DataCollector;
class DummyControl... | /**
* Magic method to allow non existing methods to be called and delegated.
*/
public static function __callStatic(string $method, array $args)
{
throw new \LogicException('Unexpected method call');
}
public function | }
/**
* Magic method to allow non existing methods to be called and delegated.
*/
public function __call(string $method, array $args)
{
throw new \LogicException('Unexpected method call');
}
| {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Fixtures/DataCollector/DummyController.php",
"language": "php",
"file_size": 1202,
"cut_index": 518,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\Log;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psr\Log\InvalidArgumentException;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use Symfony\Component\HttpKernel\Log\Logger;
/**
* @author Kévin ... | this->tmpFile)) {
file_put_contents($this->tmpFile, '');
}
}
public static function assertLogsMatch(array $expected, array $given)
{
foreach ($given as $k => $line) {
self::assertSame(1, preg_match('/[0- | ion setUp(): void
{
$this->tmpFile = tempnam(sys_get_temp_dir(), 'log');
$this->logger = new Logger(LogLevel::DEBUG, $this->tmpFile);
}
protected function tearDown(): void
{
if (!@unlink($ | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php",
"language": "php",
"file_size": 6962,
"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\Tests\Controller;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\ErrorRendere... | tInvokeControllerDataProvider')]
public function testInvokeController(Request $request, \Exception $exception, int $statusCode, string $content)
{
$kernel = $this->createStub(HttpKernelInterface::class);
$errorRenderer = new HtmlErr | nent\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\HttpKernelInterface;
class ErrorControllerTest extends TestCase
{
#[DataProvider('ge | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ErrorControllerTest.php",
"language": "php",
"file_size": 3378,
"cut_index": 614,
"middle_length": 229
} |
nent\Clock\MockClock;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Attribute\MapDateTime;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\DateTimeValueResolver;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
use Symfony\Component\HttpKernel\Exception... | e];
yield ['Pacific/Honolulu', false];
yield ['America/Toronto', false];
yield ['UTC', true];
yield ['Pacific/Honolulu', true];
yield ['America/Toronto', true];
}
public static function getClasses()
{
| zone = date_default_timezone_get();
}
protected function tearDown(): void
{
date_default_timezone_set($this->defaultTimezone);
}
public static function getTimeZones()
{
yield ['UTC', fals | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/DateTimeValueResolverTest.php",
"language": "php",
"file_size": 10083,
"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\Tests\CacheClearer;
use PHPUnit\Framework\TestCa... | id
{
@unlink(self::$cacheDir);
}
public function testInjectClearersInConstructor()
{
$clearer = $this->createMock(CacheClearerInterface::class);
$clearer
->expects($this->once())
->method('cl | otected static string $cacheDir;
public static function setUpBeforeClass(): void
{
self::$cacheDir = tempnam(sys_get_temp_dir(), 'sf_cache_clearer_dir');
}
public static function tearDownAfterClass(): vo | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/CacheClearer/ChainCacheClearerTest.php",
"language": "php",
"file_size": 1125,
"cut_index": 518,
"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\Tests\Fixtures;
use Symfony\Component\HttpKernel\Att... | #[IsSignatureValid]
#[IsSignatureValid]
public function withMultiple()
{
}
#[IsSignatureValid(methods: 'POST')]
public function withPostOnly()
{
}
#[IsSignatureValid(methods: ['GET', 'POST'])]
public function with | {
}
| {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Fixtures/IsSignatureValidAttributeMethodsController.php",
"language": "php",
"file_size": 819,
"cut_index": 522,
"middle_length": 14
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\Controller;
use PHPUnit\Framework\Attributes\DataProvider;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Com... | te('/');
$request->attributes->set('_controller', 'foo::action');
$controller = $resolver->getController($request);
$this->assertSame($service, $controller[0]);
$this->assertSame('action', $controller[1]);
}
publi | service = new ControllerTestService('foo');
$container = new Container();
$container->set('foo', $service);
$resolver = $this->createControllerResolver(null, $container);
$request = Request::crea | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ContainerControllerResolverTest.php",
"language": "php",
"file_size": 7311,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\Controller\ArgumentResolver;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\AcceptHeader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\At... | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'];
yield 'with accept-language' => ['accept-language', 'en-us,en;q=0.5'];
yield 'with host' => ['host', 'localhost'];
yield 'with user-agent' => ['user-agent', 'Symfony | fony\Component\HttpKernel\Exception\HttpException;
class RequestHeaderValueResolverTest extends TestCase
{
public static function provideHeaderValueWithStringType(): iterable
{
yield 'with accept' => ['accept', ' | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/RequestHeaderValueResolverTest.php",
"language": "php",
"file_size": 7283,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\Controller\ArgumentResolver;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Com... | {
$resolver = new ServiceValueResolver(new ServiceLocator([]));
$argument = new ArgumentMetadata('dummy', DummyService::class, false, false, null);
$request = $this->requestWithAttributes(['_controller' => 'my_controller']);
| egisterControllerArgumentLocatorsPass;
use Symfony\Component\HttpKernel\Exception\NearMissValueResolverException;
class ServiceValueResolverTest extends TestCase
{
public function testDoNotSupportWhenControllerDoNotExists()
| {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/ServiceValueResolverTest.php",
"language": "php",
"file_size": 5172,
"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\Tests\Fixtures\AcmeFooBundle;
use Symfony\Component\Co... | ->children()
->scalarNode('foo')->defaultValue('bar')->end()
->end()
;
$definition->import('Resources/config/definition.php');
}
public function prependExtension(ContainerConfigurator $container, Conta | ator;
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
class AcmeFooBundle extends AbstractBundle
{
public function configure(DefinitionConfigurator $definition): void
{
$definition->rootNode()
| {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Fixtures/AcmeFooBundle/AcmeFooBundle.php",
"language": "php",
"file_size": 1495,
"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 Controller;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Re... | topwatchEvent::class);
$stopwatchEvent->expects(self::once())->method('stop');
$stopwatch = $this->createStub(Stopwatch::class);
$stopwatch->method('start')->willReturn($stopwatchEvent);
$resolver = new class implements Co | ch;
use Symfony\Component\Stopwatch\StopwatchEvent;
class TraceableControllerResolverTest extends TestCase
{
public function testStopwatchEventIsStoppedWhenResolverThrows()
{
$stopwatchEvent = $this->createMock(S | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Controller/TraceableControllerResolverTest.php",
"language": "php",
"file_size": 1407,
"cut_index": 524,
"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\Tests\DependencyInjection;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\... | [Group('legacy')]
#[IgnoreDeprecations]
class ResettableServicePassTest extends TestCase
{
public function testDeprecatedClassExtendsNewClass()
{
$this->assertTrue(is_subclass_of(ResettableServicePass::class, BaseResettableServicePass::clas | Kernel\DependencyInjection\ResettableServicePass;
# | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/ResettableServicePassTest.php",
"language": "php",
"file_size": 880,
"cut_index": 559,
"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\HttpKernel\Debug;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Co... | {
if ($this->decorated->getCurrentRequest()) {
throw new \LogicException('Cannot mix virtual and HTTP requests.');
}
parent::push($request);
return;
}
$this->decorated->push | ends RequestStack
{
public function __construct(
private readonly RequestStack $decorated,
) {
}
public function push(Request $request): void
{
if ($request->attributes->has('_virtual_type')) | {
"filepath": "src/Symfony/Component/HttpKernel/Debug/VirtualRequestStack.php",
"language": "php",
"file_size": 1580,
"cut_index": 537,
"middle_length": 229
} |
erStorage implements ProfilerStorageInterface
{
/**
* Folder where profiler data are stored.
*/
private string $folder;
/**
* Constructs the file storage using a "dsn-like" path.
*
* Example : "file:/path/to/the/storage/folder"
*
* @throws \RuntimeException
*/
pu... | der, 0o777, true) && !is_dir($this->folder)) {
throw new \RuntimeException(\sprintf('Unable to create the storage directory (%s).', $this->folder));
}
}
/**
* @param-immediately-invoked-callable $filter
*/
public | use FileStorage with an invalid dsn "%s". The expected format is "file:/path/to/the/storage/folder".', $dsn));
}
$this->folder = substr($dsn, 5);
if (!is_dir($this->folder) && false === @mkdir($this->fol | {
"filepath": "src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php",
"language": "php",
"file_size": 10843,
"cut_index": 921,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Profiler;
use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
/**
* @author Fabien Potencier <fabien@symfony.com>
*
* @final
*/
class Profile
{
/**
* @var DataCollectorInterface[]
*/
private array $collec... | g $token,
) {
}
public function setToken(string $token): void
{
$this->token = $token;
}
/**
* Gets the token.
*/
public function getToken(): string
{
return $this->token;
}
/**
* Se | ?self $parent = null;
private ?string $virtualType = null;
private bool $hasErrors = false;
/**
* @var Profile[]
*/
private array $children = [];
public function __construct(
private strin | {
"filepath": "src/Symfony/Component/HttpKernel/Profiler/Profile.php",
"language": "php",
"file_size": 5733,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Profiler;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataC... | = [];
private bool $initiallyEnabled = true;
public function __construct(
private ProfilerStorageInterface $storage,
private ?LoggerInterface $logger = null,
private bool $enabled = true,
) {
$this->initiallyE | racts\Service\ResetInterface;
/**
* Profiler.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Profiler implements ResetInterface
{
/**
* @var DataCollectorInterface[]
*/
private array $collectors | {
"filepath": "src/Symfony/Component/HttpKernel/Profiler/Profiler.php",
"language": "php",
"file_size": 7180,
"cut_index": 716,
"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\Profiler;
/**
* ProfilerStorageInterface.
*
* This interface exi... | *
* @param int|null $limit The maximum number of tokens to return
* @param int|null $start The start date to search from
* @param int|null $end The end date to search to
* @param string|null $statusC | ugh and no other implementations will ever be supported.
*
* @internal
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface ProfilerStorageInterface
{
/**
* Finds profiler tokens for the given criteria.
| {
"filepath": "src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php",
"language": "php",
"file_size": 1769,
"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\DependencyInjection;
use Symfony\Component\DependencyI... | ependencyInjection sub-folder.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
abstract class ConfigurableExtension extends Extension
{
final public function load(array $configs, ContainerBuilder $container): void
{
$this->load | ent.
*
* You can use this as base class if
*
* a) you use the Config/Definition component for configuration,
* b) your configuration class is named "Configuration", and
* c) the configuration class resides in the D | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php",
"language": "php",
"file_size": 1322,
"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\DependencyInjection;
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
use Symfony\Component\DependencyInjection\Argument\Ser... | r\TraceableValueResolver;
use Symfony\Component\Stopwatch\Stopwatch;
/**
* Gathers and configures the argument value resolvers.
*
* @author Iltar van der Berg <kjarli@gmail.com>
*/
class ControllerArgumentValueResolverPass implements CompilerPassInter | DependencyInjection\Compiler\PriorityTaggedServiceTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\Controller\ArgumentResolve | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/ControllerArgumentValueResolverPass.php",
"language": "php",
"file_size": 3066,
"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\DependencyInjection;
use Symfony\Component\DependencyInjection\Comp... | KernelEvents::CONTROLLER_ARGUMENTS,
KernelEvents::VIEW,
KernelEvents::RESPONSE,
KernelEvents::EXCEPTION,
KernelEvents::FINISH_REQUEST,
];
public function process(ContainerBuilder $container): void
{
| or ControllerAttributesListener.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class ControllerAttributesListenerPass implements CompilerPassInterface
{
private const ATTRIBUTE_EVENTS = [
KernelEvents::CONTROLLER,
| {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/ControllerAttributesListenerPass.php",
"language": "php",
"file_size": 2011,
"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\DependencyInjection;
use Symfony\Component\... | * Allow adding classes to the class cache.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since Symfony 8.1; use Symfony\Component\DependencyInjection\Extension\Extension instead
*/
abstract class Extension extends BaseExtension
{
| :class);
/**
| {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/Extension.php",
"language": "php",
"file_size": 785,
"cut_index": 513,
"middle_length": 14
} |
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\DependencyInjection;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface... | egies.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class FragmentRendererPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('fragment.handler')) {
| lidArgumentException;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface;
/**
* Adds services tagged kernel.fragment_renderer as HTTP content rendering strat | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/FragmentRendererPass.php",
"language": "php",
"file_size": 2085,
"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\DependencyInjection;
use Psr\Container\ContainerInterf... | */
private array $initialized = [];
public function __construct(
private ContainerInterface $container,
RequestStack $requestStack,
bool $debug = false,
) {
parent::__construct($requestStack, [], $debug);
}
| ly loads fragment renderers from the dependency injection container.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class LazyLoadingFragmentHandler extends FragmentHandler
{
/**
* @var array<string, bool>
| {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/LazyLoadingFragmentHandler.php",
"language": "php",
"file_size": 1417,
"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\HttpKernel\DependencyInjection;
use Psr\Log\LoggerInterface;
use ... | sInterface
{
public function process(ContainerBuilder $container): void
{
if (!$container->has(LoggerInterface::class)) {
$container->setAlias(LoggerInterface::class, 'logger');
}
if ($container->has('logger')) | ny\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\Log\Logger;
/**
* Registers the default logger if necessary.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class LoggerPass implements CompilerPas | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/LoggerPass.php",
"language": "php",
"file_size": 1491,
"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.
*/
namespace Symfony\Component\HttpKernel\DependencyInjection;
use Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass as BaseM... | Pass::class);
/**
* Ensures certain extensions are always loaded.
*
* @author Kris Wallsmith <kris@symfony.com>
*
* @deprecated since Symfony 8.1, use MergeExtensionConfigurationPass from the DependencyInjection component instead
*/
class MergeExten | gurationPass::class, BaseMergeExtensionConfiguration | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php",
"language": "php",
"file_size": 960,
"cut_index": 582,
"middle_length": 52
} |
ute\AutowireCallable;
use Symfony\Component\DependencyInjection\Attribute\Target;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
use Symfony\Component\Dependenc... | sionInterface;
use Symfony\Component\VarExporter\ProxyHelper;
/**
* Creates the service-locators required by ServiceValueResolver.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class RegisterControllerArgumentLocatorsPass implements CompilerPassInterf | ependencyInjection\Reference;
use Symfony\Component\DependencyInjection\TypedReference;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\Ses | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php",
"language": "php",
"file_size": 12137,
"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\DependencyInjection;
use Symfony\Component\DependencyI... | pilerPassInterface
{
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('locale_aware_listener')) {
return;
}
$services = [];
foreach ($container->findTaggedServ | DependencyInjection\Reference;
/**
* Register all services that have the "kernel.locale_aware" tag into the listener.
*
* @author Pierre Bobiet <pierrebobiet@gmail.com>
*/
class RegisterLocaleAwareServicesPass implements Com | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/RegisterLocaleAwareServicesPass.php",
"language": "php",
"file_size": 1392,
"cut_index": 524,
"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\DependencyInjection;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface... | ler_locator');
$controllers = $controllerLocator->getArgument(0);
foreach ($controllers as $controller => $argumentRef) {
$argumentLocator = $container->getDefinition((string) $argumentRef->getValues()[0]);
if ($ar | RemoveEmptyControllerArgumentLocatorsPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
$controllerLocator = $container->findDefinition('argument_resolver.control | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php",
"language": "php",
"file_size": 2778,
"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\DependencyInjection;
use Symfony\Component\Depende... | BaseResettableServicePass::class);
/**
* @author Alexander M. Turek <me@derrabus.de>
*
* @deprecated since Symfony 8.1, use ResettableServicePass from the DependencyInjection component instead
*/
class ResettableServicePass extends BaseResettableServ | n component instead.', ResettableServicePass::class, | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/ResettableServicePass.php",
"language": "php",
"file_size": 840,
"cut_index": 520,
"middle_length": 52
} |
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\DependencyInjection;
use Symfony\Component\DependencyInjection\ServicesResett... | ded services.
*
* @author Alexander M. Turek <me@derrabus.de>
* @author Nicolas Grekas <p@tchwork.com>
*
* @deprecated since Symfony 8.1, use ServicesResetter from the DependencyInjection component instead
*/
final class ServicesResetter extends Base | , BaseServicesResetter::class);
/**
* Resets provi | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/ServicesResetter.php",
"language": "php",
"file_size": 913,
"cut_index": 547,
"middle_length": 52
} |
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\DependencyInjection;
use Symfony\Component\DependencyInjection\Se... | vicesResetterInterface::class);
/**
* Resets provided services.
*
* @deprecated since Symfony 8.1, use ServicesResetterInterface from the DependencyInjection component instead
*/
interface ServicesResetterInterface extends BaseServicesResetterInterfac | instead.', ServicesResetterInterface::class, BaseSer | {
"filepath": "src/Symfony/Component/HttpKernel/DependencyInjection/ServicesResetterInterface.php",
"language": "php",
"file_size": 849,
"cut_index": 535,
"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\ControllerMetadata;
/**
* Responsible for storing metadata of an argument.
*
* @author Iltar van der Berg <kjarli@gmail.com>
*/
class Argume... | Name = 'n/a',
) {
$this->isNullable = $isNullable || null === $type || ($hasDefaultValue && null === $defaultValue);
}
/**
* Returns the name as given in PHP, $foo would yield "foo".
*/
public function getName(): string
| e,
private bool $isVariadic,
private bool $hasDefaultValue,
private mixed $defaultValue,
private bool $isNullable = false,
private array $attributes = [],
private string $controller | {
"filepath": "src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadata.php",
"language": "php",
"file_size": 3527,
"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\HttpKernel\ControllerMetadata;
/**
* Builds {@see ArgumentMetadata} objects based on the given Controll... | lector);
foreach ($reflector->getParameters() as $param) {
$attributes = [];
foreach ($param->getAttributes() as $reflectionAttribute) {
if (class_exists($reflectionAttribute->getName())) {
| object|array $controller, ?\ReflectionFunctionAbstract $reflector = null): array
{
$arguments = [];
$reflector ??= new \ReflectionFunction($controller(...));
$controllerName = $this->getPrettyName($ref | {
"filepath": "src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadataFactory.php",
"language": "php",
"file_size": 2405,
"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\RemoteEvent\Event\Mailer;
use Symfony\Component\RemoteEvent\Remot... | return $this->date;
}
public function setRecipientEmail(string $email): void
{
$this->email = $email;
}
public function getRecipientEmail(): string
{
return $this->email;
}
public function setMetadata(a |
private array $metadata = [];
private array $tags = [];
public function setDate(\DateTimeImmutable $date): void
{
$this->date = $date;
}
public function getDate(): \DateTimeImmutable
{
| {
"filepath": "src/Symfony/Component/RemoteEvent/Event/Mailer/AbstractMailerEvent.php",
"language": "php",
"file_size": 1335,
"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\RemoteEvent\Event\Mailer;
/**
* @author Fabien Potencier ... | ';
public const BOUNCE = 'bounce';
private string $reason = '';
public function setReason(string $reason): void
{
$this->reason = $reason;
}
public function getReason(): string
{
return $this->reason;
}
}
| = 'delivered';
public const DEFERRED = 'deferred | {
"filepath": "src/Symfony/Component/RemoteEvent/Event/Mailer/MailerDeliveryEvent.php",
"language": "php",
"file_size": 825,
"cut_index": 517,
"middle_length": 52
} |
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\RemoteEvent\Messenger;
use Psr\Container\ContainerInterface;
use ... | >has($message->getType())) {
throw new LogicException(\sprintf('Unable to find a consumer for message of type "%s".', $message->getType()));
}
$consumer = $this->consumers->get($message->getType());
if (!$consumer insta | oteEventHandler
{
public function __construct(
private readonly ContainerInterface $consumers,
) {
}
public function __invoke(ConsumeRemoteEventMessage $message): void
{
if (!$this->consumers- | {
"filepath": "src/Symfony/Component/RemoteEvent/Messenger/ConsumeRemoteEventHandler.php",
"language": "php",
"file_size": 1294,
"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\Workflow;
use Symfony\Component\Workflow\Exception\LogicException;
use Symfony\Component\Workflow\Metadata\InMemoryMetadataStore;
use Symfony\Component\Wor... | $places
* @param Transition[] $transitions
* @param string|string[]|null $initialPlaces
*/
public function __construct(array $places, array $transitions, string|array|null $initialPlaces = null, ?MetadataStoreInterface $metada | */
final class Definition
{
private array $places = [];
private array $transitions = [];
private array $initialPlaces = [];
private MetadataStoreInterface $metadataStore;
/**
* @param string[] | {
"filepath": "src/Symfony/Component/Workflow/Definition.php",
"language": "php",
"file_size": 3112,
"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\Workflow;
use Symfony\Component\Workflow\Metadata\MetadataStoreInterface;
/**
* Builds a definition.
... | ansition[] $transitions
*/
public function __construct(array $places = [], array $transitions = [])
{
$this->addPlaces($places);
$this->addTransitions($transitions);
}
public function build(): Definition
{
| array $places = [];
private array $transitions = [];
private string|array|null $initialPlaces = null;
private ?MetadataStoreInterface $metadataStore = null;
/**
* @param string[] $places
* @param Tr | {
"filepath": "src/Symfony/Component/Workflow/DefinitionBuilder.php",
"language": "php",
"file_size": 2877,
"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\Workflow;
/**
* Marking contains the place of every tokens.
*
* @author Grégoire Pineau <lyrixx@lyrix... | foreach ($representation as $place => $nbToken) {
$this->mark($place, $nbToken);
}
}
/**
* @psalm-param int<1, max> $nbToken
*/
public function mark(string $place, int $nbToken = 1): void
{
if ($nbTok | private ?array $context = null;
/**
* @param int[] $representation Keys are the place name and values should be superior or equals to 1
*/
public function __construct(array $representation = [])
{
| {
"filepath": "src/Symfony/Component/Workflow/Marking.php",
"language": "php",
"file_size": 2794,
"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\Workflow;
use Symfony\Component\Workflow\Exception\InvalidArgumentException;
use Symfony\Component\Workf... | on has(object $subject, ?string $workflowName = null): bool
{
foreach ($this->workflows as [$workflow, $supportStrategy]) {
if ($this->supports($workflow, $supportStrategy, $subject, $workflowName)) {
return true;
| ay $workflows = [];
public function addWorkflow(WorkflowInterface $workflow, WorkflowSupportStrategyInterface $supportStrategy): void
{
$this->workflows[] = [$workflow, $supportStrategy];
}
public functi | {
"filepath": "src/Symfony/Component/Workflow/Registry.php",
"language": "php",
"file_size": 2752,
"cut_index": 563,
"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\Workflow;
use Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface;
use Symfony\Component\Workflow\MarkingStore\MethodMarkingStore;
use Sy... | tore = null, ?EventDispatcherInterface $dispatcher = null, string $name = 'unnamed', ?array $eventsToDispatch = null)
{
parent::__construct($definition, $markingStore ?? new MethodMarkingStore(true), $dispatcher, $name, $eventsToDispatch);
| nition $definition, ?MarkingStoreInterface $markingS | {
"filepath": "src/Symfony/Component/Workflow/StateMachine.php",
"language": "php",
"file_size": 918,
"cut_index": 606,
"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\Workflow;
/**
* @author Fabien Potencier <fabien@symfony.com>
* @author Grég... | s->fromArcs = array_map($this->normalize(...), (array) $froms);
$this->toArcs = array_map($this->normalize(...), (array) $tos);
}
public function getName(): string
{
return $this->name;
}
/**
* @return $asArc is t | * @param string|string[]|Arc[] $froms
* @param string|string[]|Arc[] $tos
*/
public function __construct(
private string $name,
string|array $froms,
string|array $tos,
) {
$thi | {
"filepath": "src/Symfony/Component/Workflow/Transition.php",
"language": "php",
"file_size": 1913,
"cut_index": 537,
"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\Workflow;
/**
* A reason why a transition cannot be performed for a subject.
*/
final class TransitionBlocker
{
public const BLOCKED_BY_MARKING = '19... | blocked the transition. E.g. for a condition "distance must be larger than
* 5 miles", you might want to pass around the value of 5.
*/
public function __construct(
private string $message,
| 8a82a';
/**
* @param string $code Code is a machine-readable string, usually an UUID
* @param array $parameters This is useful if you would like to pass around the condition values, that
* | {
"filepath": "src/Symfony/Component/Workflow/TransitionBlocker.php",
"language": "php",
"file_size": 3162,
"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\Workflow;
/**
* A list of transition blockers.
*
* @author Gré... | d($blocker);
}
}
public function add(TransitionBlocker $blocker): void
{
$this->blockers[] = $blocker;
}
public function has(string $code): bool
{
foreach ($this->blockers as $blocker) {
if ($co | ay $blockers;
/**
* @param TransitionBlocker[] $blockers
*/
public function __construct(array $blockers = [])
{
$this->blockers = [];
foreach ($blockers as $blocker) {
$this->ad | {
"filepath": "src/Symfony/Component/Workflow/TransitionBlockerList.php",
"language": "php",
"file_size": 1482,
"cut_index": 524,
"middle_length": 229
} |
low\Event\EnteredEvent;
use Symfony\Component\Workflow\Event\EnterEvent;
use Symfony\Component\Workflow\Event\GuardEvent;
use Symfony\Component\Workflow\Event\LeaveEvent;
use Symfony\Component\Workflow\Event\TransitionEvent;
use Symfony\Component\Workflow\Exception\LogicException;
use Symfony\Component\Workflow\Excepti... | @author Grégoire Pineau <lyrixx@lyrixx.info>
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
* @author Carlos Pereira De Amorim <carlos@shauri.fr>
*/
class Workflow implements WorkflowInterface
{
public const DISABLE_LEAVE_EVENT = 'workflow_disabl | t\Workflow\MarkingStore\MethodMarkingStore;
use Symfony\Component\Workflow\Metadata\MetadataStoreInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
/**
* @author Fabien Potencier <fabien@symfony.com>
* | {
"filepath": "src/Symfony/Component/Workflow/Workflow.php",
"language": "php",
"file_size": 16790,
"cut_index": 921,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\ControllerMetadata;
use Fake\ImportedAndFake;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactory;
use Symfony\Com... | private ArgumentMetadataFactory $factory;
protected function setUp(): void
{
$this->factory = new ArgumentMetadataFactory();
}
public function testSignature1()
{
$arguments = $this->factory->createArgumentMetadata( | TypesController;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\NullableController;
use Symfony\Component\HttpKernel\Tests\Fixtures\Controller\VariadicController;
class ArgumentMetadataFactoryTest extends TestCase
{
| {
"filepath": "src/Symfony/Component/HttpKernel/Tests/ControllerMetadata/ArgumentMetadataFactoryTest.php",
"language": "php",
"file_size": 7623,
"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\Event;
use Symfony\Component\ExpressionLanguage\Expres... | d>
*/
public function getArguments(): array
{
return $this->controllerArgumentsEvent->getArguments();
}
/**
* @return array<string, mixed>
*/
public function getNamedArguments(): array
{
return $this- | ic function __construct(
ControllerEvent $controllerEvent,
private ControllerArgumentsEvent $controllerArgumentsEvent,
) {
parent::__construct($controllerEvent);
}
/**
* @return list<mixe | {
"filepath": "src/Symfony/Component/HttpKernel/Event/ControllerArgumentsMetadata.php",
"language": "php",
"file_size": 1256,
"cut_index": 524,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\HttpKernel\Event;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
/**
* Allows filtering ... | ublic function __construct(HttpKernelInterface $kernel, callable $controller, Request $request, ?int $requestType)
{
parent::__construct($kernel, $request, $requestType);
$this->setController($controller);
}
public function ge | equest.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
final class ControllerEvent extends KernelEvent
{
private string|array|object $controller;
private \ReflectionFunctionAbstract $controllerReflector;
p | {
"filepath": "src/Symfony/Component/HttpKernel/Event/ControllerEvent.php",
"language": "php",
"file_size": 5796,
"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\Event;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKer... | ernhard Schussek <bschussek@gmail.com>
*/
final class ExceptionEvent extends RequestEvent
{
private \Throwable $throwable;
private bool $allowCustomResponseCode = false;
public function __construct(
HttpKernelInterface $kernel,
| event is stopped as soon as a
* response is set.
*
* You can also call setThrowable() to replace the thrown exception. This
* exception will be thrown if no response is set during processing of this
* event.
*
* @author B | {
"filepath": "src/Symfony/Component/HttpKernel/Event/ExceptionEvent.php",
"language": "php",
"file_size": 2180,
"cut_index": 563,
"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\Event;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Co... | nelInterface::SUB_REQUEST
*/
public function __construct(
private HttpKernelInterface $kernel,
private Request $request,
private ?int $requestType,
) {
}
/**
* Returns the kernel in which this event was th | ussek@gmail.com>
*/
class KernelEvent extends Event
{
/**
* @param int $requestType The request type the kernel is currently processing; one of
* HttpKernelInterface::MAIN_REQUEST or HttpKer | {
"filepath": "src/Symfony/Component/HttpKernel/Event/KernelEvent.php",
"language": "php",
"file_size": 1782,
"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\Event;
use Symfony\Component\HttpFoundation\Request;
u... | ction __construct(
HttpKernelInterface $kernel,
Request $request,
int $requestType,
private Response $response,
public readonly ?ControllerArgumentsMetadata $controllerMetadata = null,
) {
parent::__const | current response. With
* setResponse() you can set a new response that will be returned to the
* browser.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
final class ResponseEvent extends KernelEvent
{
public fun | {
"filepath": "src/Symfony/Component/HttpKernel/Event/ResponseEvent.php",
"language": "php",
"file_size": 1253,
"cut_index": 524,
"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\Event;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKer... | etadata;
/**
* @deprecated since Symfony 8.1, use $controllerMetadata instead
*/
public private(set) ?ControllerArgumentsEvent $controllerArgumentsEvent {
get {
trigger_deprecation('symfony/http-kernel', '8.1', 'Acces | gation of this event is stopped as soon as a
* response is set.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
final class ViewEvent extends RequestEvent
{
public readonly ?ControllerArgumentsMetadata $controllerM | {
"filepath": "src/Symfony/Component/HttpKernel/Event/ViewEvent.php",
"language": "php",
"file_size": 2760,
"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\Bundle;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjectio... | bundle's container extension.
*
* @throws \LogicException
*/
public function getContainerExtension(): ?ExtensionInterface
{
if (!isset($this->extension)) {
$extension = $this->createContainerExtension();
| for DependencyInjection extensions.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class Bundle extends BaseAbstractBundle implements BundleInterface
{
private string $namespace;
/**
* Returns the | {
"filepath": "src/Symfony/Component/HttpKernel/Bundle/Bundle.php",
"language": "php",
"file_size": 3499,
"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\Debug;
use Psr\Log\LoggerInterface;
use Symfony\Component\ErrorHandler\ErrorHandler;
/**
* Configures the error handler.
*
* @final
*
* @i... | where even silenced errors are logged
* @param bool $scope Enables/disables scoping mode
*/
public function __construct(
private ?LoggerInterface $logger = null,
array|int|null $levels = \E_ALL,
?int $throw | an integer bit field of E_* constants
* @param int|null $throwAt Thrown errors in a bit field of E_* constants, or null to keep the current value
* @param bool $scream Enables/disables screaming mode, | {
"filepath": "src/Symfony/Component/HttpKernel/Debug/ErrorHandlerConfigurator.php",
"language": "php",
"file_size": 3520,
"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\Tests\Profiler;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use... | st = new Request();
$request->query->set('foo', 'bar');
$request->server->set('REMOTE_ADDR', '127.0.0.1');
$response = new Response('', 204);
$collector = new RequestDataCollector();
$profiler = new Profiler($this-> | torage;
use Symfony\Component\HttpKernel\Profiler\Profiler;
class ProfilerTest extends TestCase
{
private string $tmp;
private ?FileProfilerStorage $storage = null;
public function testCollect()
{
$reque | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/Profiler/ProfilerTest.php",
"language": "php",
"file_size": 3790,
"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\HttpKernel\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyIn... | ction testCollectsAttributeListenersByKernelEvent()
{
$container = new ContainerBuilder();
$dispatcher = new Definition();
$dispatcher->addMethodCall('addListener', [KernelEvents::CONTROLLER.'.'.TestAttribute::class, [new Refer | llerAttributesListenerPass;
use Symfony\Component\HttpKernel\EventListener\ControllerAttributesListener;
use Symfony\Component\HttpKernel\KernelEvents;
class ControllerAttributesListenerPassTest extends TestCase
{
public fun | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/ControllerAttributesListenerPassTest.php",
"language": "php",
"file_size": 2758,
"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\Tests\DependencyInjection;
use PHPUnit\Framework\TestC... | unction testRender()
{
$renderer = $this->createMock(FragmentRendererInterface::class);
$renderer->expects($this->once())->method('getName')->willReturn('foo');
$renderer->method('render')->willReturn(new Response());
$ | Response;
use Symfony\Component\HttpKernel\DependencyInjection\LazyLoadingFragmentHandler;
use Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface;
class LazyLoadingFragmentHandlerTest extends TestCase
{
public f | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/LazyLoadingFragmentHandlerTest.php",
"language": "php",
"file_size": 1446,
"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\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Psr\... | er', 'Foo');
(new LoggerPass())->process($container);
$this->assertFalse($container->getAlias(LoggerInterface::class)->isPublic());
}
public function testDoNotOverrideExistingLogger()
{
$container = new ContainerBuild | /**
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class LoggerPassTest extends TestCase
{
public function testAlwaysSetAutowiringAlias()
{
$container = new ContainerBuilder();
$container->register('logg | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/LoggerPassTest.php",
"language": "php",
"file_size": 1985,
"cut_index": 537,
"middle_length": 229
} |
DependencyInjection\Attribute\AutowireLocator;
use Symfony\Component\DependencyInjection\Attribute\Target;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Dependency... | catorsPass;
use Symfony\Component\HttpKernel\Tests\Fixtures\DataCollector\DummyController;
use Symfony\Component\HttpKernel\Tests\Fixtures\Suit;
class RegisterControllerArgumentLocatorsPassTest extends TestCase
{
public function testInvalidClass()
| ponent\DependencyInjection\ServiceLocator;
use Symfony\Component\DependencyInjection\TypedReference;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DependencyInjection\RegisterControllerArgumentLo | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php",
"language": "php",
"file_size": 32443,
"cut_index": 1331,
"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\Tests\DependencyInjection;
use PHPUnit\Framework\A... | cesResetter;
#[Group('legacy')]
#[IgnoreDeprecations]
class ServicesResetterTest extends TestCase
{
public function testDeprecatedClassExtendsNewClass()
{
$this->assertTrue(is_subclass_of(ServicesResetter::class, BaseServicesResetter::clas | mfony\Component\HttpKernel\DependencyInjection\Servi | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/ServicesResetterTest.php",
"language": "php",
"file_size": 841,
"cut_index": 520,
"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\Event;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\H... | r.
*
* @author Christophe Coevoet <stof@notk.org>
*/
final class ControllerArgumentsEvent extends KernelEvent
{
private ControllerEvent $controllerEvent;
private array $namedArguments;
public function __construct(
HttpKernelInterfac | getArguments
* to retrieve the current arguments. With setArguments() you can replace
* arguments that are used to call the controller.
*
* Arguments set in the event must be compatible with the signature of the
* controlle | {
"filepath": "src/Symfony/Component/HttpKernel/Event/ControllerArgumentsEvent.php",
"language": "php",
"file_size": 3813,
"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\HttpKernel\Event;
use Psr\EventDispatcher\StoppableEventInterface;
use Symfony\Component\ExpressionLangu... | * @var T */
public readonly object $attribute,
public readonly KernelEvent $kernelEvent,
private readonly ?ExpressionLanguage $expressionLanguage = null,
) {
$this->controller = match (true) {
$kernelEvent in | @tchwork.com>
*/
final class ControllerAttributeEvent implements StoppableEventInterface
{
private string|array|object|null $controller;
/**
* @param T $attribute
*/
public function __construct(
/* | {
"filepath": "src/Symfony/Component/HttpKernel/Event/ControllerAttributeEvent.php",
"language": "php",
"file_size": 2522,
"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\Event;
use Symfony\Component\HttpFoundation\Req... | on __construct(
HttpKernelInterface $kernel,
Request $request,
?int $requestType,
public readonly ?ControllerMetadata $controllerMetadata = null,
) {
parent::__construct($kernel, $request, $requestType);
}
}
| RequestEvent extends KernelEvent
{
public functi | {
"filepath": "src/Symfony/Component/HttpKernel/Event/FinishRequestEvent.php",
"language": "php",
"file_size": 825,
"cut_index": 517,
"middle_length": 52
} |
*
* 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\Bundle;
use Symfony\Component\DependencyInjection\... | actBundle extends Bundle
{
public function getContainerExtension(): ?ExtensionInterface
{
return BaseAbstractBundle::getContainerExtension();
}
public function getPath(): string
{
return BaseAbstractBundle::getPath();
| uto <yonelceruto@gmail.com>
*/
abstract class Abstr | {
"filepath": "src/Symfony/Component/HttpKernel/Bundle/AbstractBundle.php",
"language": "php",
"file_size": 835,
"cut_index": 520,
"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\Debug;
use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher as BaseTraceableEventDispatcher;
use Symfony\Component\HttpKernel\Ke... | switch ($eventName) {
case KernelEvents::REQUEST:
$event->getRequest()->attributes->set('_stopwatch_token', bin2hex(random_bytes(3)));
$this->stopwatch->openSection();
break;
case K | s TraceableEventDispatcher extends BaseTraceableEventDispatcher
{
protected function beforeDispatch(string $eventName, object $event): void
{
if ($this->disabled?->__invoke()) {
return;
}
| {
"filepath": "src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php",
"language": "php",
"file_size": 3685,
"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\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Dep... | $services = [
'n3' => [[]],
'n1' => [['priority' => 200]],
'n2' => [['priority' => 100]],
];
$expected = [
new Reference('n1'),
new Reference('n2'),
new Reference('n3' | tion\ControllerArgumentValueResolverPass;
use Symfony\Component\Stopwatch\Stopwatch;
class ControllerArgumentValueResolverPassTest extends TestCase
{
public function testServicesAreOrderedAccordingToPriority()
{
| {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/ControllerArgumentValueResolverPassTest.php",
"language": "php",
"file_size": 4804,
"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\HttpKernel\Tests\DependencyInjection;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attr... | p('legacy')]
#[IgnoreDeprecations]
class MergeExtensionConfigurationPassTest extends TestCase
{
public function testAutoloadMainExtension()
{
$container = new ContainerBuilder();
$container->registerExtension(new LoadedExtension()); | y\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
use Symfony\Component\HttpKernel\Tests\Fixtures\AcmeFooBundle\AcmeFooBundle;
#[Grou | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php",
"language": "php",
"file_size": 2970,
"cut_index": 563,
"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\Tests\ControllerMetadata;
use PHPUnit\Framework\TestCase;
use Symfo... | ()
{
$argument = new ArgumentMetadata('foo', 'string', false, true, 'default value', true);
$this->assertTrue($argument->isNullable());
$this->assertTrue($argument->hasDefaultValue());
$this->assertSame('default value', | estWithBcLayerWithDefault()
{
$argument = new ArgumentMetadata('foo', 'string', false, true, 'default value');
$this->assertFalse($argument->isNullable());
}
public function testDefaultValueAvailable | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/ControllerMetadata/ArgumentMetadataTest.php",
"language": "php",
"file_size": 1921,
"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\Event;
use Symfony\Component\ExpressionLanguage\Expres... | act
{
return $this->controllerEvent->getControllerReflector();
}
/**
* @template T of object
*
* @param class-string<T>|'*'|null $className
*
* @return ($className is null ? array<class-string, list<object>> : | vate ControllerEvent $controllerEvent,
) {
}
public function getController(): callable
{
return $this->controllerEvent->getController();
}
public function getReflector(): \ReflectionFunctionAbstr | {
"filepath": "src/Symfony/Component/HttpKernel/Event/ControllerMetadata.php",
"language": "php",
"file_size": 1393,
"cut_index": 524,
"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\Event;
use Symfony\Component\HttpFoundation\R... | {
public function __construct(
HttpKernelInterface $kernel,
Request $request,
private Response $response,
) {
parent::__construct($kernel, $request, HttpKernelInterface::MAIN_REQUEST);
}
public function getR | iggered on main requests, the `getRequestType()` method
* will always return the value of `HttpKernelInterface::MAIN_REQUEST`.
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
final class TerminateEvent extends KernelEvent
| {
"filepath": "src/Symfony/Component/HttpKernel/Event/TerminateEvent.php",
"language": "php",
"file_size": 1066,
"cut_index": 515,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.