prefix
stringlengths
512
512
suffix
stringlengths
256
256
middle
stringlengths
14
229
meta
dict
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\Bridge\Doctrine\CacheWarmer; use Doctrine\Persistence\ManagerRegistry; use Symfony\Component\HttpKernel\CacheWarme...
private readonly ManagerRegistry $registry, ) { } /** * This cache warmer is not optional, without proxies fatal error occurs! */ public function isOptional(): bool { return false; } public function warm
e this information is necessary to build the proxies in the first place. * * @author Benjamin Eberlei <kontakt@beberlei.de> */ final class ProxyCacheWarmer implements CacheWarmerInterface { public function __construct(
{ "filepath": "src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php", "language": "php", "file_size": 2403, "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\Bridge\Monolog\Tests\Handler\FingersCrossed; use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; use Monolog\Level; use PHPUnit\Framework\Attributes\Dat...
onsWithoutCode() { $this->expectException(\LogicException::class); new HttpCodeActivationStrategy(new RequestStack(), [['urls' => []]], new ErrorLevelActivationStrategy(Level::Warning)); } public function testExclusionsWithoutU
ttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; class HttpCodeActivationStrategyTest extends TestCase { public function testExclusi
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/HttpCodeActivationStrategyTest.php", "language": "php", "file_size": 3725, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Monolog\Handler; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\HtmlFormatter; use Monolog\Formatter\LineFormatter; use Monolog\Handler\AbstractProcessingHandler; use Monolog\Level; use Monolog\LogRecord; use Symfony\Component\Mailer\MailerInt...
disable truncation, otherwise the value must be at * least the length of self::TRUNCATION_MARKER. When triggered, * the trailing characters are replaced with the marker, so
ARKER = '[...]'; private \Closure|Email $messageTemplate; /** * @param int<0, max> $subjectMaxLength The maximum number of characters of the formatted subject; * pass 0 to
{ "filepath": "src/Symfony/Bridge/Monolog/Handler/MailerHandler.php", "language": "php", "file_size": 5501, "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\Bridge\Monolog\Handler; use Monolog\Formatter\FormatterInterface; use Monolog\Handler\AbstractProcessingHandler; use Monolog\Level; use Monolog\LogRecord; use Symfon...
bool $bubble = true, array $context = []) { parent::__construct($level, $bubble); if (!str_contains($host, '://')) { $host = 'tcp://'.$host; } $this->host = $host; $this->context = stream_context_c
vate string $host; /** * @var resource */ private $context; /** * @var resource|null */ private $socket; public function __construct(string $host, string|int|Level $level = Level::Debug,
{ "filepath": "src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php", "language": "php", "file_size": 3352, "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\Bridge\Monolog\Handler\FingersCrossed; use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; use Monolog...
s each exclusion must have a "code" and "urls" keys */ public function __construct( private RequestStack $requestStack, private array $exclusions, private ActivationStrategyInterface $inner, ) { foreach ($exclus
* * @author Shaun Simmons <shaun@envysphere.com> * @author Pierrick Vignand <pierrick.vignand@gmail.com> */ final class HttpCodeActivationStrategy implements ActivationStrategyInterface { /** * @param array $exclusion
{ "filepath": "src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php", "language": "php", "file_size": 2250, "cut_index": 563, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Doctrine; use Doctrine\Common\EventArgs; use Doctrine\Common\EventManager; use Doctrine\Common\EventSubscriber; use Psr\Container\ContainerInterface; /** * Allows lazy loading of listener and subscriber services. * * @author Johannes M. Schmitt <schmittjoh...
$container, private array $listeners = [], ) { } public function dispatchEvent(string $eventName, ?EventArgs $eventArgs = null): void { if (!$this->initializedSubscribers) { $this->initializeSubscribers();
hMapping = []; private array $methods = []; /** * @param list<array{string[], string|object}> $listeners List of [events, listener] tuples */ public function __construct( private ContainerInterface
{ "filepath": "src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php", "language": "php", "file_size": 6615, "cut_index": 716, "middle_length": 229 }
s 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\Bridge\Doctrine\IdGenerator; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\...
te readonly ?UlidFactory $factory = null, ) { } public function generateId(EntityManagerInterface $em, $entity): Ulid { if ($this->factory) { return $this->factory->create(); } return new Ulid(); }
priva
{ "filepath": "src/Symfony/Bridge/Doctrine/IdGenerator/UlidGenerator.php", "language": "php", "file_size": 808, "cut_index": 536, "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\Bridge\Doctrine\IdGenerator; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Id\AbstractIdGenerator; use...
meBasedUuidFactory $factory; private ?string $entityGetter = null; public function __construct(?UuidFactory $factory = null) { $this->protoFactory = $this->factory = $factory ?? new UuidFactory(); } public function generateId(
\Factory\UuidFactory; use Symfony\Component\Uid\Uuid; final class UuidGenerator extends AbstractIdGenerator { private readonly UuidFactory $protoFactory; private UuidFactory|NameBasedUuidFactory|RandomBasedUuidFactory|Ti
{ "filepath": "src/Symfony/Bridge/Doctrine/IdGenerator/UuidGenerator.php", "language": "php", "file_size": 2164, "cut_index": 563, "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\Bridge\Monolog\Tests; use Monolog\Level; use Monolog\Logger; use Monolog\LogRecord; class RecordFactory { ...
{ return new LogRecord( message: (string) $message, context: $context, level: Logger::toMonologLevel($level), channel: $channel, datetime: $datetime, extra: $extra, );
eTimeImmutable(), array $extra = []): LogRecord
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/RecordFactory.php", "language": "php", "file_size": 875, "cut_index": 559, "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\Bridge\Monolog\Tests\Processor; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Monolog\Processor\ConsoleComman...
n']; private const TEST_NAME = 'some:test'; public function testProcessor() { $processor = new ConsoleCommandProcessor(); $processor->addCommandData($this->getConsoleEvent()); $record = $processor(RecordFactory::create
\InputInterface; use Symfony\Component\Console\Output\NullOutput; class ConsoleCommandProcessorTest extends TestCase { private const TEST_ARGUMENTS = ['test' => 'argument']; private const TEST_OPTIONS = ['test' => 'optio
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Processor/ConsoleCommandProcessorTest.php", "language": "php", "file_size": 2411, "cut_index": 563, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Monolog\Tests\Processor; use Monolog\LogRecord; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Monolog\Processor\RouteProcessor; use Symfony\Bridge\Monolog\Tests\RecordFactory; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\...
t = $this->mockFilledRequest(); $processor = new RouteProcessor(); $processor->addRouteData($this->getRequestEvent($request)); $record = $processor($this->createRecord()); $this->assertArrayHasKey('requests', $record['extr
nst TEST_CONTROLLER = 'App\Controller\SomeController::someMethod'; private const TEST_ROUTE = 'someRouteName'; private const TEST_PARAMS = ['param1' => 'value1']; public function testProcessor() { $reques
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Processor/RouteProcessorTest.php", "language": "php", "file_size": 5806, "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\Bridge\Monolog\Tests\Processor; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Monol...
* @author Igor Timoshenko <igor.timoshenko@i.ua> */ class SwitchUserTokenProcessorTest extends TestCase { public function testProcessor() { $originalToken = new UsernamePasswordToken(new InMemoryUser('original_user', 'password', ['ROLE_S
rity\Core\Authentication\Token\SwitchUserToken; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\User\InMemoryUser; /** * Tests the SwitchUserTokenProcessor. *
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Processor/SwitchUserTokenProcessorTest.php", "language": "php", "file_size": 1759, "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\Bridge\Monolog\Tests\Handler; use PHPUnit\Framework\TestCase; use ...
$request = Request::create('/'); $request->headers->remove('User-Agent'); $response = new Response('foo'); $event = new ResponseEvent($this->createStub(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUES
nt; use Symfony\Component\HttpKernel\HttpKernelInterface; class ChromePhpHandlerTest extends TestCase { public function testOnKernelResponseShouldNotTriggerDeprecation() { $this->expectNotToPerformAssertions();
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Handler/ChromePhpHandlerTest.php", "language": "php", "file_size": 1113, "cut_index": 515, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Monolog\Tests\Handler; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LogstashFormatter; use Monolog\Level; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Monolog\Handler\ElasticsearchLogstashHandler; use Symfony\Bridge\Monolog\Tests\Recor...
{"@timestamp":"2020-01-01T00:00:00.000000+01:00","@version":1,"host":"my hostname","message":"My info message","type":"application","channel":"app","level":"INFO","monolog_level":200} EOBODY; // Monolog 1X if (\
n testHandle() { $callCount = 0; $responseFactory = function ($method, $url, $options) use (&$callCount) { $body = <<<EOBODY {"index":{"_index":"log","_type":"_doc"}}
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Handler/ElasticsearchLogstashHandlerTest.php", "language": "php", "file_size": 5961, "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\Bridge\Monolog\Tests\Handler; use Monolog\Logger; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Monolog\Handler\FirePHPHandler; use Symfony\Component\EventDispa...
new Logger('my_logger', [$handler]); $logger->warning('This does not look right.'); $request = new Request(); $request->headers->set('User-Agent', 'Mozilla/5.0 (FirePHP/1.0)'); $response = $this->dispatchResponseEvent($ha
HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\KernelEvents; class FirePHPHandlerTest extends TestCase { public function testLogHandling() { $handler = $this->createHandler(); $logger =
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Handler/FirePHPHandlerTest.php", "language": "php", "file_size": 4728, "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\Bridge\Monolog\Tests\Formatter; use PHPUnit\Framework\TestCase; use Symfony...
<fg=cyan>WARNING </> <comment>[test]</> test\n", $formatter->format($record)); } public function testPlaceholderInMessageWithDataContext() { $formatter = new ConsoleFormatter(['colors' => false]); // LogRecord::$context must
public function testFormat() { $record = RecordFactory::create(datetime: new \DateTimeImmutable('2013-01-13 12:34:56 Europe/Berlin')); $formatter = new ConsoleFormatter(); self::assertSame("12:34:56
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Formatter/ConsoleFormatterTest.php", "language": "php", "file_size": 1293, "cut_index": 524, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Monolog\Handler; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LogstashFormatter; use Monolog\Handler\AbstractHandler; use Monolog\Handler\FormattableHandlerTrait; use Monolog\Handler\ProcessableHandlerTrait; use Monolog\Level; use Monolog\Lo...
w down your application if Elasticsearch takes times to * answer. Even if all HTTP calls are done asynchronously. * * In a development environment, it's fine to keep the default configuration: * for each log, an HTTP request will be made to push the lo
\HttpClient\ResponseInterface; /** * Push logs directly to Elasticsearch and format them according to Logstash specification. * * This handler dials directly with the HTTP interface of Elasticsearch. This * means it will slo
{ "filepath": "src/Symfony/Bridge/Monolog/Handler/ElasticsearchLogstashHandler.php", "language": "php", "file_size": 5480, "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\Bridge\Monolog\Formatter; use Monolog\Formatter\FormatterInterface; u...
d = $record->toArray(); $record['context'] = $this->cloner->cloneVar($record['context']); $record['extra'] = $this->cloner->cloneVar($record['extra']); return $record; } public function formatBatch(array $records): mixed
private VarCloner $cloner; public function __construct(?VarCloner $cloner = null) { $this->cloner = $cloner ?? new VarCloner(); } public function format(LogRecord $record): mixed { $recor
{ "filepath": "src/Symfony/Bridge/Monolog/Formatter/VarDumperFormatter.php", "language": "php", "file_size": 1150, "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\Bridge\Monolog; use Monolog\Level; use Monolog\LogRecord; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Monolog\Processor\DebugProcessor; use Symfony\Bridge\Mon...
bugProcessor(); $processor($record); $records = $processor->getLogs(); self::assertCount(1, $records); self::assertSame(1546300860, $records[0]['timestamp']); } public function testDatetimeRfc3339Format() {
tack; class DebugProcessorTest extends TestCase { public function testDatetimeFormat() { $record = RecordFactory::create(datetime: new \DateTimeImmutable('2019-01-01T00:01:00+00:00')); $processor = new De
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Processor/DebugProcessorTest.php", "language": "php", "file_size": 3452, "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\Bridge\Monolog\Tests\Processor; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Monolog\Processor\TokenProcesso...
aillard93b@gmail.com> */ class TokenProcessorTest extends TestCase { public function testProcessor() { $token = new UsernamePasswordToken(new InMemoryUser('user', 'password', ['ROLE_USER']), 'provider', ['ROLE_USER']); $tokenStorag
ge\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\User\InMemoryUser; /** * Tests the TokenProcessor. * * @author Dany Maillard <danym
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Processor/TokenProcessorTest.php", "language": "php", "file_size": 2631, "cut_index": 563, "middle_length": 229 }
PHPUnit\Framework\TestCase; use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter; use Symfony\Bridge\Monolog\Handler\ConsoleHandler; use Symfony\Bridge\Monolog\Tests\RecordFactory; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\ConsoleEvents; use Symfony\Component\Console\Event\ConsoleCo...
he ConsoleFormatter. * * @author Tobias Schultze <http://tobion.de> */ class ConsoleHandlerTest extends TestCase { public function testConstructor() { $handler = new ConsoleHandler(null, false); $this->assertFalse($handler->getBu
\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\EventDispatcher\EventDispatcher; /** * Tests the ConsoleHandler and also t
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php", "language": "php", "file_size": 14666, "cut_index": 921, "middle_length": 229 }
PUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Monolog\Handler\MailerHandler; use Symfony\Bridge\Monolog\Tests\RecordFactory; use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mime\Email; class MailerHandlerTest extends TestCase { private MockObject&Mail...
'send') ->with($this->callback(static fn (Email $email) => 'Alert: WARNING message' === $email->getSubject() && null === $email->getHtmlBody())) ; $handler->handle($this->getRecord(Level::Warning, 'message')); } public
er = new MailerHandler($this->mailer, (new Email())->subject('Alert: %level_name% %message%')); $handler->setFormatter(new LineFormatter()); $this->mailer ->expects($this->once()) ->method(
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Handler/MailerHandlerTest.php", "language": "php", "file_size": 9279, "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\Bridge\Monolog\Handler; use Monolog\Handler\FirePHPHandler as BaseFirePHPHandler; use Sy...
(ResponseEvent $event): void { if (!$event->isMainRequest()) { return; } $request = $event->getRequest(); if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $request->headers->get('User-Agent', '')) && !$
FirePHPHandler extends BaseFirePHPHandler { private array $headers = []; private ?Response $response = null; /** * Adds the headers to the response once it's created. */ public function onKernelResponse
{ "filepath": "src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php", "language": "php", "file_size": 1885, "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\Bridge\Monolog\Handler; use Monolog\Handler\AbstractHandler; use Monolog\Level; use Monolog\Logger; use Monolog\Lo...
) { parent::__construct(Logger::toMonologLevel($level)->isLowerThan(Level::Error) ? Level::Error : $level, $bubble); } public function handle(LogRecord $record): bool { if (!$this->isHandling($record)) { return
ien@symfony.com> */ final class NotifierHandler extends AbstractHandler { public function __construct( private NotifierInterface $notifier, string|int|Level $level = Level::Error, bool $bubble = true,
{ "filepath": "src/Symfony/Bridge/Monolog/Handler/NotifierHandler.php", "language": "php", "file_size": 2218, "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\Bridge\Doctrine; use Doctrine\Persistence\AbstractManagerRegistry; use Symfony\Component\DependencyInjection\Conta...
resetService($name): void { if (!$this->container->initialized($name)) { return; } $manager = $this->container->get($name); if ($manager instanceof LazyObjectInterface) { if (!$manager->resetLaz
stract class ManagerRegistry extends AbstractManagerRegistry { protected Container $container; protected function getService($name): object { return $this->container->get($name); } protected function
{ "filepath": "src/Symfony/Bridge/Doctrine/ManagerRegistry.php", "language": "php", "file_size": 2856, "cut_index": 563, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Monolog\Command; use Monolog\Formatter\FormatterInterface; use Monolog\Handler\HandlerInterface; use Monolog\Level; use Monolog\LogRecord; use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter; use Symfony\Bridge\Monolog\Handler\ConsoleHandler; use Symfony\Com...
ony\Component\VarDumper\Cloner\Data; use Symfony\Component\VarDumper\Cloner\Stub; /** * @author Grégoire Pineau <lyrixx@lyrixx.info> */ #[AsCommand(name: 'server:log', description: 'Start a log server that displays logs in real time')] class ServerLogCo
ion; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use Symf
{ "filepath": "src/Symfony/Bridge/Monolog/Command/ServerLogCommand.php", "language": "php", "file_size": 6536, "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\Bridge\Monolog\Tests\Handler; use Monolog\Formatter\JsonFormatter; use Monolog\Level; use Monolog\Processor\ProcessIdProcessor; use PHPUnit\Framework\TestCase; use S...
.0.0.1:9999'); $this->assertInstanceOf(VarDumperFormatter::class, $handler->getFormatter()); $formatter = new JsonFormatter(); $handler->setFormatter($formatter); $this->assertSame($formatter, $handler->getFormatter());
Data; use Symfony\Component\VarDumper\Cloner\Stub; /** * Tests the ServerLogHandler. */ class ServerLogHandlerTest extends TestCase { public function testFormatter() { $handler = new ServerLogHandler('tcp://127
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Handler/ServerLogHandlerTest.php", "language": "php", "file_size": 4293, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Monolog\Formatter; use Monolog\Formatter\FormatterInterface; use Monolog\Level; use Monolog\LogRecord; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\VarDumper\Cloner\Data; use Symfony\Component\VarDumper\Cloner\Stub; use Symfon...
% <comment>[%channel%]</> %message%%context%%extra%\n"; public const SIMPLE_DATE = 'H:i:s'; private const LEVEL_COLOR_MAP = [ Level::Debug->value => 'fg=white', Level::Info->value => 'fg=green', Level::Notice->value => 'fg=
thor Tobias Schultze <http://tobion.de> * @author Grégoire Pineau <lyrixx@lyrixx.info> */ final class ConsoleFormatter implements FormatterInterface { public const SIMPLE_FORMAT = "%datetime% %start_tag%%level_name%%end_tag
{ "filepath": "src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php", "language": "php", "file_size": 6430, "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\Bridge\Monolog\Processor; use Monolog\Processor\WebProcessor as BaseWebProc...
uct(?array $extraFields = null) { // Pass an empty array as the default null value would access $_SERVER parent::__construct([], $extraFields); } public function onKernelRequest(RequestEvent $event): void { if ($eve
override to read from the HttpFoundation's Request. * * @author Jordi Boggiano <j.boggiano@seld.be> * * @final */ class WebProcessor extends BaseWebProcessor implements EventSubscriberInterface { public function __constr
{ "filepath": "src/Symfony/Bridge/Monolog/Processor/WebProcessor.php", "language": "php", "file_size": 1364, "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\Bridge\Doctrine\Validator; use Doctrine\Persistence\ManagerRegistry; use ...
ts ObjectInitializerInterface { public function __construct( protected ManagerRegistry $registry, ) { } public function initialize(object $object): void { $this->registry->getManagerForClass($object::class)?->initialize
lizer implemen
{ "filepath": "src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php", "language": "php", "file_size": 817, "cut_index": 522, "middle_length": 14 }
pository; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader; use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface; use Symfony\Bridge\Doctrine\Form\ChoiceList\IdReader; use Symfony\Component\Form\ChoiceList\ArrayChoiceList; use Symfony\Component\Form\Exception...
tUp(): void { $this->om = $this->createStub(ObjectManager::class); $this->repository = $this->createMock(ObjectRepository::class); $this->class = 'stdClass'; $this->idReader = $this->createStub(IdReader::class);
sitory; private string $class; private IdReader $idReader; private EntityLoaderInterface $objectLoader; private \stdClass $obj1; private \stdClass $obj2; private \stdClass $obj3; protected function se
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php", "language": "php", "file_size": 12001, "cut_index": 921, "middle_length": 229 }
e\ORM\AbstractQuery; use Doctrine\ORM\Query; use Doctrine\ORM\QueryBuilder; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader; use Symfony\Bridge\Doctrine\Tests\DoctrineTestHelper;...
ponent\Form\Exception\TransformationFailedException; use Symfony\Component\Uid\Uuid; class ORMQueryBuilderLoaderTest extends TestCase { protected function tearDown(): void { if (Type::hasType('uuid')) { Type::overrideType('uuid
se Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity; use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity; use Symfony\Bridge\Doctrine\Types\UlidType; use Symfony\Bridge\Doctrine\Types\UuidType; use Symfony\Com
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php", "language": "php", "file_size": 9366, "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\Bridge\Doctrine\Tests\Form\Type; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Tools\SchemaTool; use Doctrine\Persistence\ManagerRegistry; use PHPUnit\Framework\A...
reDeprecations] #[Group('doctrine-dbal-workaround')] class EntityTypePerformanceTest extends FormPerformanceTestCase { private const ENTITY_CLASS = SingleIntIdEntity::class; private EntityManager $em; protected function getExtensions(): array
ridge\Doctrine\Tests\Fixtures\SingleIntIdEntity; use Symfony\Component\Form\Extension\Core\CoreExtension; use Symfony\Component\Form\Test\FormPerformanceTestCase; /** * @author Bernhard Schussek <bschussek@gmail.com> */ #[Igno
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php", "language": "php", "file_size": 3879, "cut_index": 614, "middle_length": 229 }
:hasType('uuid')) { Type::overrideType('uuid', UuidType::class); } else { Type::addType('uuid', UuidType::class); } if (!Type::hasType('ulid')) { Type::addType('ulid', UlidType::class); } $this->em = DoctrineTestHelper::createTestEntityManager...
lf::SINGLE_STRING_IDENT_CLASS), $this->em->getClassMetadata(self::SINGLE_ASSOC_IDENT_CLASS), $this->em->getClassMetadata(self::SINGLE_STRING_CASTABLE_IDENT_CLASS), $this->em->getClassMetadata(self::COMPOSITE_IDENT_CLASS)
tClassMetadata(self::ITEM_GROUP_CLASS), $this->em->getClassMetadata(self::SINGLE_IDENT_CLASS), $this->em->getClassMetadata(self::SINGLE_IDENT_NO_TO_STRING_CLASS), $this->em->getClassMetadata(se
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php", "language": "php", "file_size": 73406, "cut_index": 3790, "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\Bridge\Doctrine\Tests\Form\EventListener; use Doctrine\Common\Collections\ArrayCollection; use PHPUnit\Framework\T...
ate EventDispatcher $dispatcher; private FormFactoryInterface $factory; protected function setUp(): void { $this->collection = new ArrayCollection(['test']); $this->dispatcher = new EventDispatcher(); $this->factory = $
ony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormFactoryInterface; class MergeDoctrineCollectionListenerTest extends TestCase { private ArrayCollection $collection; priv
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Form/EventListener/MergeDoctrineCollectionListenerTest.php", "language": "php", "file_size": 2085, "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\Bridge\Doctrine\Tests\Form\DataTransformer; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ReadableCollection; use PHPUnit\Framewor...
ArrayTransformer(); } public function testTransform() { $array = [ 2 => 'foo', 3 => 'bar', ]; $this->assertSame($array, $this->transformer->transform(new ArrayCollection($array))); } /*
<bschussek@gmail.com> */ class CollectionToArrayTransformerTest extends TestCase { private CollectionToArrayTransformer $transformer; protected function setUp(): void { $this->transformer = new CollectionTo
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php", "language": "php", "file_size": 4860, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Doctrine\Tests\PropertyInfo; use Doctrine\Common\Collections\Collection; use Doctrine\Common\EventManager; use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory; use Doctrine\DBAL\Types\Type as DBALType; use Doctrine\ORM\EntityM...
ures\DoctrineEnum; use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineGeneratedValue; use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineRelation; use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineWithEmbedded; use S
ropertyInfo\DoctrineExtractor; use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineDummy; use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineEmbeddable; use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixt
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php", "language": "php", "file_size": 7470, "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\Bridge\Doctrine\Tests\PropertyInfo\Fixtures; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use...
#[ManyToMany(targetEntity: DoctrineRelation::class, indexBy: 'rguid')] protected $indexedRguid; #[ManyToMany(targetEntity: DoctrineRelation::class, indexBy: 'rguid_column')] protected $indexedBar; #[OneToMany(targetEntity: DoctrineR
ntity] class DoctrineDummy { #[Id, Column(type: 'smallint')] public $id; #[ManyToOne(targetEntity: DoctrineRelation::class)] public $foo; #[ManyToMany(targetEntity: DoctrineRelation::class)] public $bar;
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineDummy.php", "language": "php", "file_size": 2526, "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\Bridge\Doctrine\Tests\PropertyInfo\Fixtures; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\Id; #[Entity] class ...
olumn(type: 'array', enumType: EnumString::class)] protected $enumStringArray; #[Column(type: 'simple_array', enumType: EnumInt::class)] protected $enumIntArray; #[Column(type: 'custom_foo', enumType: EnumInt::class)] protected $enumC
e: EnumInt::class)] protected $enumInt; #[C
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineEnum.php", "language": "php", "file_size": 923, "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\Bridge\Doctrine\Tests\PropertyInfo\Fixtures; use Doctrine\DBAL\Platforms\AbstractPlatfor...
ypeDeclarationSQL([]); } public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string { if (null === $value) { return null; } if (!$value instanceof Foo) { throw new Conver
E = 'foo'; public function getName(): string { return self::NAME; } public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string { return $platform->getClobT
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php", "language": "php", "file_size": 1672, "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\Bridge\Doctrine\Tests\PropertyInfo\Fixtures; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\GeneratedValue; use D...
#[Column] public $foo; #[Column(type: 'integer', name: 'gen_value_col_id')] public $valueId; #[OneToMany(targetEntity: DoctrineRelation::class, mappedBy: 'generatedValueRelation', indexBy: 'rguid_column', orphanRemoval: true)] protec
UTO'), Column(type: 'integer')] public $id;
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineGeneratedValue.php", "language": "php", "file_size": 936, "cut_index": 606, "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\Bridge\Doctrine\Tests\PropertyInfo\Fixtures; use Doctrine\ORM\Mapping\Colum...
mmy::class, inversedBy: 'indexedFoo')] protected $foo; #[ManyToOne(targetEntity: DoctrineDummy::class)] protected $baz; #[Column(type: 'datetime')] private $dt; #[Column(type: 'foo')] private $customType; #[Column(type:
#[Entity] class DoctrineRelation { #[Id, Column(type: 'smallint')] public $id; #[Column(type: 'guid', name: 'rguid_column')] protected $rguid; #[Column(type: 'guid')] #[ManyToOne(targetEntity: DoctrineDu
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineRelation.php", "language": "php", "file_size": 1490, "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\Bridge\Doctrine\Tests\Middleware\IdleConnection; use Doctrine\DBAL\Driver a...
eateStub(ConnectionInterface::class); $driverMock->expects($this->once()) ->method('connect') ->willReturn($connectionMock); $connectionExpiries = new \ArrayObject(); $driver = new Driver($driverMock, $con
leConnection\Driver; class DriverTest extends TestCase { #[Group('time-sensitive')] public function testConnect() { $driverMock = $this->createMock(DriverInterface::class); $connectionMock = $this->cr
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Middleware/IdleConnection/DriverTest.php", "language": "php", "file_size": 1290, "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\Bridge\Doctrine\Tests\Middleware\IdleConnection; use Doctrine\DBAL\Connection as Connect...
nExpiries = new \ArrayObject(['connectionone' => time() - 30, 'connectiontwo' => time() + 40]); $connectionOneMock = $this->createStub(ConnectionInterface::class); $container = new Container(); $container->set('doctrine.dbal.conne
ndation\Request; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; class ListenerTest extends TestCase { public function testOnKernelRequest() { $connectio
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Middleware/IdleConnection/ListenerTest.php", "language": "php", "file_size": 1950, "cut_index": 537, "middle_length": 229 }
L\Result; use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory; use Doctrine\DBAL\Statement; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\ORMSetup; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\RequiresPhpExtension; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\Middlew...
hClockMock(false); } private function init(bool $withStopwatch = true): void { $this->stopwatch = $withStopwatch ? new Stopwatch() : null; $config = ORMSetup::createConfiguration(true); $config->setSchemaManagerFactory
o_sqlite')] class MiddlewareTest extends TestCase { private DebugDataHolder $debugDataHolder; private Connection $conn; private ?Stopwatch $stopwatch; protected function setUp(): void { ClockMock::wit
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Middleware/Debug/MiddlewareTest.php", "language": "php", "file_size": 10256, "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 SchemaListener; use Doctrine\DBAL\Connection; use Doctrine\DBAL\DriverManager; use PHPUnit\Frame...
inct in-memory SQLite databases $connection1 = DriverManager::getConnection($connectionParams); $connection2 = DriverManager::getConnection($connectionParams); self::assertTrue($this->getIsSameDatabaseChecker($connection1)($connect
hemaListenerTest extends TestCase { public function testSameDatabaseChecker() { $connectionParams = [ 'dbname' => ':memory:', 'driver' => 'pdo_sqlite', ]; // Create two dist
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/SchemaListener/AbstractSchemaListenerTest.php", "language": "php", "file_size": 1871, "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\Bridge\Doctrine\Tests\SchemaListener; use Doctrine\DBAL\Configuration; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Table;...
$dbalConnection = $this->createStub(Connection::class); $dbalConnection->method('getConfiguration')->willReturn(new Configuration()); $entityManager = $this->createMock(EntityManagerInterface::class); $entityManager->expects(
terSchemaListener; use Symfony\Component\Cache\Adapter\DoctrineDbalAdapter; class DoctrineDbalCacheAdapterSchemaListenerTest extends TestCase { public function testPostGenerateSchema() { $schema = new Schema();
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/SchemaListener/DoctrineDbalCacheAdapterSchemaListenerTest.php", "language": "php", "file_size": 3104, "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\Bridge\Doctrine\Tests\SchemaListener; use Doctrine\DBAL\Configuration; use Doctrine\DBAL\Connection; use Doctrine\...
chema = new Schema(); $dbalConnection = $this->createStub(Connection::class); $dbalConnection->method('getConfiguration')->willReturn(new Configuration()); $entityManager = $this->createMock(EntityManagerInterface::class); $
ridge\Doctrine\SchemaListener\LockStoreSchemaListener; use Symfony\Component\Lock\Store\DoctrineDbalStore; class LockStoreSchemaListenerTest extends TestCase { public function testPostGenerateSchemaLockPdo() { $s
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/SchemaListener/LockStoreSchemaListenerTest.php", "language": "php", "file_size": 2993, "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\Bridge\Doctrine\Tests\Fixtures; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\DiscriminatorColumn; use Doctrine\ORM\Mapping\DiscriminatorMap; use...
ee' => 'Employee'])] class Person { public function __construct( #[Id, Column] protected int $id, #[Column] public string $name, ) { } public function __toString(): string { return $this->name;
g'), DiscriminatorMap(['person' => 'Person', 'employ
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/Person.php", "language": "php", "file_size": 922, "cut_index": 606, "middle_length": 52 }
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\Bridge\Doctrine\Tests\Fixtures; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping\Column; use Doctrine\O...
__construct( #[Id, Column(type: 'integer')] protected int $id, #[Column(type: 'string', nullable: true)] public ?string $name, ) { } public function __toString(): string { return (string) $this->na
ublic mixed $phoneNumbers = []; public function
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php", "language": "php", "file_size": 879, "cut_index": 559, "middle_length": 52 }
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\Bridge\Doctrine\Tests\Fixtures; use Doctrine\ORM\Mapping\Column; u...
astableObjectIdentity($id); } public function __toString(): string { return (string) $this->name; } } class StringCastableObjectIdentity { public function __construct( protected readonly int $id, ) { } pub
dValue(strategy: 'NONE')] protected StringCastableObjectIdentity $id; public function __construct( int $id, #[Column(nullable: true)] public ?string $name, ) { $this->id = new StringC
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringCastableIdEntity.php", "language": "php", "file_size": 1083, "cut_index": 515, "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\Bridge\Doctrine\Tests\Fixtures; class UpdateCompositeObjectNoToStringIdEntity { /** * @var SingleIntIdNoToStringEntity ...
{ $this->object1 = $object1; $this->object2 = $object2; $this->name = $name; } public function getObject1(): SingleIntIdNoToStringEntity { return $this->object1; } public function getObject2(): Singl
ect1, SingleIntIdNoToStringEntity $object2, $name)
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/UpdateCompositeObjectNoToStringIdEntity.php", "language": "php", "file_size": 958, "cut_index": 582, "middle_length": 52 }
buted with this source code. */ namespace Symfony\Bridge\Doctrine\Tests\Form; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\JoinColumnMapping; use Doctrine\ORM\Mapping\ManyToOneAssociationMapping; use Doctrine\Persistence\ManagerRegistry; use Doctrine\Persistence\Obj...
cted) { $classMetadata = $this->createMock(ClassMetadata::class); $classMetadata->fieldMappings['field'] = true; $classMetadata->expects($this->once())->method('getTypeOfField')->with('field')->willReturn($type); $this-
Symfony\Component\Form\Guess\TypeGuess; use Symfony\Component\Form\Guess\ValueGuess; class DoctrineOrmTypeGuesserTest extends TestCase { #[DataProvider('requiredType')] public function testTypeGuesser(string $type, $expe
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php", "language": "php", "file_size": 6185, "cut_index": 716, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Doctrine\Validator; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\ClassMetadata as OrmClassMetadata; use Doctrine\ORM\Mapping\FieldMapping; use Doctrine\ORM\Mapping\MappingException as OrmMappingException; use Doctrine\Persistence\Mapping\M...
erface; /** * Guesses and loads the appropriate constraints using Doctrine's metadata. * * @author Kévin Dunglas <dunglas@gmail.com> */ final class DoctrineLoader implements LoaderInterface { use AutoMappingTrait; public function __construct(
ony\Component\Validator\Mapping\AutoMappingStrategy; use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Mapping\Loader\AutoMappingTrait; use Symfony\Component\Validator\Mapping\Loader\LoaderInt
{ "filepath": "src/Symfony/Bridge/Doctrine/Validator/DoctrineLoader.php", "language": "php", "file_size": 5828, "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\Bridge\Doctrine\Validator\Constraints; use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; /** * Constraint fo...
y used.'; public string $service = 'doctrine.orm.validator.unique'; public ?string $em = null; public ?string $entityClass = null; public string $repositoryMethod = 'findBy'; public array|string $fields = []; public ?string $errorPa
t { public const NOT_UNIQUE_ERROR = '23bd9dbf-6b9b-41cd-a99e-4844bcf3077f'; protected const ERROR_NAMES = [ self::NOT_UNIQUE_ERROR => 'NOT_UNIQUE_ERROR', ]; public string $message = 'This value is alread
{ "filepath": "src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php", "language": "php", "file_size": 3503, "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\Bridge\Doctrine\Tests; use Doctrine\Common\EventManager; use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Schema...
* @author Bernhard Schussek <bschussek@gmail.com> */ final class DoctrineTestHelper { /** * Returns an entity manager for testing. */ public static function createTestEntityManager(?Configuration $config = null): EntityManager {
ctrine\ORM\ORMSetup; use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; use Doctrine\Persistence\Mapping\Driver\SymfonyFileLocator; use PHPUnit\Framework\TestCase; /** * Provides utility functions needed in tests. *
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/DoctrineTestHelper.php", "language": "php", "file_size": 2791, "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\Bridge\Doctrine\Tests; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityR...
->getRepositoryHash($entityManager, $entityName); return $this->repositoryList[$repositoryHash] ??= $this->createRepository($entityManager, $entityName); } public function setRepository(EntityManagerInterface $entityManager, string $entit
* @var array<string, EntityRepository> */ private array $repositoryList = []; public function getRepository(EntityManagerInterface $entityManager, $entityName): EntityRepository { $repositoryHash = $this
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/TestRepositoryFactory.php", "language": "php", "file_size": 1851, "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\Bridge\Doctrine\Tests\IdGenerator; use Doctrine\ORM\EntityManager; use Doct...
$ulid = $generator->generateId($em, new Entity()); $this->assertInstanceOf(Ulid::class, $ulid); $this->assertTrue(Ulid::isValid($ulid)); } public function testUlidFactory() { $ulid = new Ulid('00000000000000000
class UlidGeneratorTest extends TestCase { public function testUlidCanBeGenerated() { $em = (new \ReflectionClass(EntityManager::class))->newInstanceWithoutConstructor(); $generator = new UlidGenerator();
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UlidGeneratorTest.php", "language": "php", "file_size": 1390, "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\Bridge\Doctrine\Tests\Types; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\...
e { Type::addType($name, DayPointType::class); } } protected function setUp(): void { if (!class_exists(DatePoint::class)) { self::markTestSkipped('The DatePoint class is not available.'); }
vate DayPointType $type; public static function setUpBeforeClass(): void { $name = DayPointType::NAME; if (Type::hasType($name)) { Type::overrideType($name, DayPointType::class); } els
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Types/DayPointTypeTest.php", "language": "php", "file_size": 3262, "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\Bridge\Doctrine\Tests\Types; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\MariaDBPlatform; use Doctrine\DBAL\Platforms\MySQLPlatform; us...
DUMMY_ULID = '01EEDQEK6ZAZE93J8KG5B4MBJC'; private UlidType $type; public static function setUpBeforeClass(): void { if (Type::hasType('ulid')) { Type::overrideType('ulid', UlidType::class); } else { T
butes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\Types\UlidType; use Symfony\Component\Uid\AbstractUid; use Symfony\Component\Uid\Ulid; final class UlidTypeTest extends TestCase { private const
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Types/UlidTypeTest.php", "language": "php", "file_size": 4520, "cut_index": 614, "middle_length": 229 }
ine\Persistence\ManagerRegistry; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector; use Symfony\Bridge\Doctrine\Middleware\Debug\DebugDataHolder; use Symfony\Bridge\Doctrine\Middleware\Debug\Query; use Symfony\Bridge\PhpUnit\Cl...
nections() { $c = $this->createCollector([]); $c->collect(new Request(), new Response()); $c = unserialize(serialize($c)); $this->assertEquals(['default' => 'doctrine.dbal.default_connection'], $c->getConnections());
per; class DoctrineDataCollectorTest extends TestCase { protected function setUp(): void { ClockMock::register(self::class); ClockMock::withClockMock(1500000000); } public function testCollectCon
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php", "language": "php", "file_size": 10794, "cut_index": 921, "middle_length": 229 }
ce\ObjectRepository; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\ArgumentResolver\Console\EntityValueResolver; use Symfony\Bridge\Doctrine\Attribute\MapEntity; use Symfony\Component\Console\ArgumentResolver\Exception\NearMissValueResolverException; use Symfony\Component\Console\ArgumentResolver\ValueRes...
lass EntityValueResolverTest extends TestCase { public static function setUpBeforeClass(): void { if (!interface_exists(ValueResolverInterface::class)) { self::markTestSkipped('Requires symfony/console >= 8.1'); } }
\ArrayInput; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; c
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Console/ArgumentResolver/EntityValueResolverTest.php", "language": "php", "file_size": 16520, "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\Bridge\Doctrine\Tests\Fixtures; use Doctrine\ORM\Mapping as ORM; use Symfon...
\Length(min: 5)] public $mergedMaxLength; #[ORM\Column(length: 20), Assert\Length(min: 1, max: 10)] public $alreadyMappedMaxLength; #[ORM\Column(unique: true)] public $unique; #[ORM\Column(unique: true)] public $alreadyMapped
elds: ["alreadyMappedUnique"])] class DoctrineLoaderEntity extends DoctrineLoaderParentEntity { #[ORM\Id, ORM\Column] public $id; #[ORM\Column(length: 20)] public $maxLength; #[ORM\Column(length: 20), Assert
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/DoctrineLoaderEntity.php", "language": "php", "file_size": 1437, "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\Bridge\Doctrine\Tests\Fixtures; use Doctrine\Persistence\Mapping\ClassMetad...
{ } public function merge($object) { } public function clear($objectName = null): void { } public function detach($object): void { } public function refresh($object): void { } public function flu
public $bar; public function __construct() { } public function find($className, $id): ?object { } public function persist($object): void { } public function remove($object): void
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/DummyManager.php", "language": "php", "file_size": 1452, "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\Bridge\Doctrine\Tests\Fixtures; use Doctrine\ORM\Mapping\Column; use ...
#[Column] public string $name, ) { } public function getRoles(): array { } public function getPassword(): ?string { } public function getUserIdentifier(): string { return $this->name; } #[
#[Entity] class User implements UserInterface, PasswordAuthenticatedUserInterface { public function __construct( #[Id, Column] protected ?int $id1, #[Id, Column] protected ?int $id2,
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/User.php", "language": "php", "file_size": 1136, "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\Bridge\Monolog\Tests\Processor; use Monolog\Level; use Monolog\LogRecord; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Monolog\Processor\WebProcessor; use Symf...
est($event); $record = $processor($this->getRecord()); $this->assertCount(5, $record['extra']); $this->assertEquals($server['REQUEST_URI'], $record['extra']['url']); $this->assertEquals($server['REMOTE_ADDR'], $record['extr
class WebProcessorTest extends TestCase { public function testUsesRequestServerData() { [$event, $server] = $this->createRequestEvent(); $processor = new WebProcessor(); $processor->onKernelRequ
{ "filepath": "src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php", "language": "php", "file_size": 4193, "cut_index": 614, "middle_length": 229 }
octrine\Persistence\Mapping\ClassMetadata; use Doctrine\Persistence\Mapping\MappingException as PersistenceMappingException; use Doctrine\Persistence\ObjectManager; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\ConstraintDefini...
istry $registry, ) { } /** * @throws UnexpectedTypeException * @throws ConstraintDefinitionException */ public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof UniqueEnt
one or a set of fields contain unique values. * * @author Benjamin Eberlei <kontakt@beberlei.de> */ class UniqueEntityValidator extends ConstraintValidator { public function __construct( private readonly ManagerReg
{ "filepath": "src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php", "language": "php", "file_size": 12828, "cut_index": 921, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Doctrine\Tests; use Doctrine\Common\EventSubscriber; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\ContainerAwareEventManager; use Symfony\Component\DependencyInjection\Container; class ContainerAwareEventManagerTest extends TestCase { priva...
->container->set('list1', $listener1 = new MyListener()); $this->container->set('list2', $listener2 = new MyListener()); $this->assertSame([$listener1, $listener2], array_values($this->evm->getListeners('foo'))); } public function
AwareEventManager($this->container); } public function testDispatchEventRespectOrder() { $this->evm = new ContainerAwareEventManager($this->container, [[['foo'], 'list1'], [['foo'], 'list2']]); $this
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php", "language": "php", "file_size": 8893, "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\Bridge\Doctrine\Tests\Types; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Platforms\SQLitePla...
pe::class); } else { Type::addType($name, DatePointType::class); } } protected function setUp(): void { $this->type = Type::getType(DatePointType::NAME); } public function testDatePointConvertsToDat
nds TestCase { private DatePointType $type; public static function setUpBeforeClass(): void { $name = DatePointType::NAME; if (Type::hasType($name)) { Type::overrideType($name, DatePointTy
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Types/DatePointTypeTest.php", "language": "php", "file_size": 2574, "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\Bridge\Doctrine\Tests\Types; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\...
} else { Type::addType($name, TimePointType::class); } } protected function setUp(): void { if (!class_exists(DatePoint::class)) { self::markTestSkipped('The DatePoint class is not available.');
rivate TimePointType $type; public static function setUpBeforeClass(): void { $name = TimePointType::NAME; if (Type::hasType($name)) { Type::overrideType($name, TimePointType::class);
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Types/TimePointTypeTest.php", "language": "php", "file_size": 3264, "cut_index": 614, "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\Bridge\Doctrine\Tests\Fixtures; use Doctrine\ORM\Mapping as ORM; ...
#[ORM\JoinColumn(name: 'object_two_id')] protected SingleIntIdNoToStringEntity $objectTwo, ) { } public function getObjectOne(): SingleIntIdNoToStringEntity { return $this->objectOne; } public function getObje
M\Id] #[ORM\ManyToOne(cascade: ['persist'])] #[ORM\JoinColumn(name: 'object_one_id')] protected SingleIntIdNoToStringEntity $objectOne, #[ORM\Id] #[ORM\ManyToOne(cascade: ['persist'])]
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeObjectNoToStringIdEntity.php", "language": "php", "file_size": 1084, "cut_index": 515, "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\Bridge\Doctrine\Tests\Fixtures; use Doctrine\ORM\Mapping\Column; use...
id, #[Column(type: 'string', nullable: true)] private ?string $name, ) { } public function getName(): ?string { return $this->name; } public function __toString(): string { return (string) $thi
rotected int $
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdWithPrivateNameEntity.php", "language": "php", "file_size": 804, "cut_index": 517, "middle_length": 14 }
p /* * 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\Bridge\Doctrine\Tests\Fixtures\Type; use Doctrine\DBAL\Platforms\Ab...
lue->getString() : null; } public function convertToPHPValue($value, AbstractPlatform $platform): StringWrapper { return new StringWrapper($value); } public function getName(): string { return 'string_wrapper';
return $value instanceof StringWrapper ? $va
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/Type/StringWrapperType.php", "language": "php", "file_size": 829, "cut_index": 516, "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\Bridge\Doctrine\Tests\IdGenerator; use Doctrine\ORM\EntityManager; use PHPUnit\Framework\TestCase; use Symfony\Bri...
nerator(); $uuid = $generator->generateId($em, new Entity()); $this->assertInstanceOf(Uuid::class, $uuid); } public function testCustomUuidfactory() { $uuid = new UuidV4(); $em = (new \ReflectionClass(EntityMan
d\UuidV4; class UuidGeneratorTest extends TestCase { public function testUuidCanBeGenerated() { $em = (new \ReflectionClass(EntityManager::class))->newInstanceWithoutConstructor(); $generator = new UuidGe
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UuidGeneratorTest.php", "language": "php", "file_size": 3020, "cut_index": 563, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Doctrine\Tests; use Doctrine\Persistence\ObjectManager; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\Tests\Fixtures\DummyManager; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symf...
ue); $container->getDefinition('foo')->setLazy(true)->addTag('proxy', ['interface' => ObjectManager::class]); $container->compile(); $dumper = new PhpDumper($container); eval('?>'.$dumper->dump(['class' => 'LazyServiceDoctr
\LazyObjectInterface; class ManagerRegistryTest extends TestCase { public function testResetService() { $container = new ContainerBuilder(); $container->register('foo', DummyManager::class)->setPublic(tr
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/ManagerRegistryTest.php", "language": "php", "file_size": 6669, "cut_index": 716, "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\Bridge\Doctrine\Tests\Fixtures; use Doctrine\ORM\Mapping\Column; ...
ade: ['ALL'])] #[JoinColumn()] protected SingleIntIdNoToStringEntity $entity, #[Column(nullable: true)] public ?string $name, ) { } public function __toString(): string { return $this->name; } }
ic function __construct( #[Id, OneToOne(casc
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleAssociationToIntIdEntity.php", "language": "php", "file_size": 823, "cut_index": 514, "middle_length": 52 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bridge\Doctrine\Tests\Types; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\MariaDBPlatform; use Doctrine\DBAL\Platforms\MySQLPlatform; us...
DUMMY_UUID = '9f755235-5a2d-4aba-9605-e9962b312e50'; private UuidType $type; public static function setUpBeforeClass(): void { if (Type::hasType('uuid')) { Type::overrideType('uuid', UuidType::class); } else {
butes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\Types\UuidType; use Symfony\Component\Uid\AbstractUid; use Symfony\Component\Uid\Uuid; final class UuidTypeTest extends TestCase { private const
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Types/UuidTypeTest.php", "language": "php", "file_size": 4839, "cut_index": 614, "middle_length": 229 }
m; use Doctrine\DBAL\Result; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ManagerRegistry; use Symfony\Bridge\Doctrine\Messenger\DoctrinePingConnectionMiddleware; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException; use Symfony\C...
entityManager = $this->createStub(EntityManagerInterface::class); $entityManager->method('getConnection')->willReturn($connection); $managerRegistry = $this->createStub(ManagerRegistry::class); $managerRegistry->method('getManager')
private string $entityManagerName = 'default'; public function testMiddlewarePingOk() { $connection = $this->createMock(Connection::class); $connection->method('isConnected')->willReturn(true); $
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php", "language": "php", "file_size": 10187, "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\Bridge\Doctrine\Tests\Messenger; use Doctrine\DBAL\Connection; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ManagerRegistry; use PHPUnit\Framewo...
ManagerInterface $entityManager; private DoctrineTransactionMiddleware $middleware; protected function setUp(): void { $this->connection = $this->createMock(Connection::class); $this->entityManager = $this->createStub(EntityMa
MessageHandlingException; use Symfony\Component\Messenger\Test\Middleware\MiddlewareTestCase; class DoctrineTransactionMiddlewareTest extends MiddlewareTestCase { private MockObject&Connection $connection; private Entity
{ "filepath": "src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineTransactionMiddlewareTest.php", "language": "php", "file_size": 4518, "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\Bridge\Doctrine\DependencyInjection\CompilerPass; use Symfony\Component\DependencyInject...
$this->updateValidatorMappingFiles($container, 'xml', 'xml'); $this->updateValidatorMappingFiles($container, 'yaml', 'yml'); } /** * Gets the validation mapping files for the format and extends them with * files matching
/ class DoctrineValidationPass implements CompilerPassInterface { public function __construct( private readonly string $managerType, ) { } public function process(ContainerBuilder $container): void {
{ "filepath": "src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php", "language": "php", "file_size": 1979, "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\Bridge\Doctrine\DependencyInjection\CompilerPass; use Symfony\Bridge\Doctri...
er): void { if (!class_exists(DatePoint::class)) { return; } if (!$container->hasParameter('doctrine.dbal.connection_factory.types')) { return; } $types = $container->getParameter('doctr
Injection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; final class RegisterDatePointTypePass implements CompilerPassInterface { public function process(ContainerBuilder $contain
{ "filepath": "src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterDatePointTypePass.php", "language": "php", "file_size": 1342, "cut_index": 524, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass; use Symfony\Bridge\Doctrine\ContainerAwareEventManager; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\Depend...
connections. * * @author Jeremy Mikola <jmikola@gmail.com> * @author Alexander <iam.asm89@gmail.com> * @author David Maicher <mail@dmaicher.de> */ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface { private array $con
Injection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Reference; /** * Registers event listeners to the available doctrine
{ "filepath": "src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php", "language": "php", "file_size": 5757, "cut_index": 716, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\Depende...
gsPass classes * in the DoctrineBundle resp. * DoctrineMongodbBundle, DoctrineCouchdbBundle and DoctrinePhpcrBundle. * * @author David Buchmann <david@liip.ch> */ abstract class RegisterMappingsPass implements CompilerPassInterface { /** * Th
to register doctrine mappings. * * The compiler pass is meant to register the mappings with the metadata * chain driver corresponding to one of the object managers. * * For concrete implementations, see the RegisterXyMappin
{ "filepath": "src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php", "language": "php", "file_size": 7769, "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\Bridge\Doctrine\DependencyInjection\CompilerPass; use Symfony\Bridge\Doctri...
return; } if (!$container->hasParameter('doctrine.dbal.connection_factory.types')) { return; } $typeDefinition = $container->getParameter('doctrine.dbal.connection_factory.types'); if (!is
der; use Symfony\Component\Uid\AbstractUid; final class RegisterUidTypePass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (!class_exists(AbstractUid::class)) {
{ "filepath": "src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterUidTypePass.php", "language": "php", "file_size": 1347, "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\Bridge\PsrHttpMessage; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Symfony\Component\Htt...
* Creates a Symfony Request instance from a PSR-7 one. */ public function createRequest(ServerRequestInterface $psrRequest, bool $streamed = false): Request; /** * Creates a Symfony Response instance from a PSR-7 one. */ pub
interface HttpFoundationFactoryInterface { /**
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/HttpFoundationFactoryInterface.php", "language": "php", "file_size": 988, "cut_index": 582, "middle_length": 52 }
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\Bridge\PsrHttpMessage; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Symfony\Component\Htt...
* Creates a PSR-7 Request instance from a Symfony one. */ public function createRequest(Request $symfonyRequest): ServerRequestInterface; /** * Creates a PSR-7 Response instance from a Symfony one. */ public function createR
*/ interface HttpMessageFactoryInterface { /**
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/HttpMessageFactoryInterface.php", "language": "php", "file_size": 948, "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\Bridge\PsrHttpMessage\Factory; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamInterface; use Psr\Htt...
/** * @param int $responseBufferMaxLength The maximum output buffering size for each iteration when sending the response */ public function __construct( private readonly int $responseBufferMaxLength = 16372, ) { } public
e Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\StreamedResponse; /** * @author Kévin Dunglas <dunglas@gmail.com> */ class HttpFoundationFactory implements HttpFoundationFactoryInterface {
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Factory/HttpFoundationFactory.php", "language": "php", "file_size": 4769, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bridge\PsrHttpMessage\Factory; use Http\Discovery\Psr17Factory as DiscoveryPsr17Factory; use Nyholm\Psr7\Factory\Psr17Factory as NyholmPsr17Factory; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequ...
quest; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\StreamedResponse; /** * Builds Psr\HttpMessage instances using a PSR-17 implementation. * * @author Antonio J. García Lagar <aj@garcialagar.es> * @author Auréli
ileInterface; use Symfony\Bridge\PsrHttpMessage\HttpMessageFactoryInterface; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Re
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Factory/PsrHttpFactory.php", "language": "php", "file_size": 7837, "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\Bridge\PsrHttpMessage\Factory; use Psr\Http\Message\UploadedFileInterface; use Symfony\Component\HttpFoundation\Fi...
adedFileInterface $psrUploadedFile, callable $getTemporaryPath, ) { $error = $psrUploadedFile->getError(); $path = ''; if (\UPLOAD_ERR_NO_FILE !== $error) { $path = $psrUploadedFile->getStream()->getMetadata
k.com> */ class UploadedFile extends BaseUploadedFile { private bool $test = false; /** * @param-immediately-invoked-callable $getTemporaryPath */ public function __construct( private readonly Uplo
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Factory/UploadedFile.php", "language": "php", "file_size": 2109, "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\Bridge\PsrHttpMessage\EventListener; use Psr\Http\Message\ResponseInterface; use Symfony...
ander M. Turek <me@derrabus.de> */ final class PsrResponseListener implements EventSubscriberInterface { private readonly HttpFoundationFactoryInterface $httpFoundationFactory; public function __construct(?HttpFoundationFactoryInterface $httpFoun
ony\Component\HttpKernel\Event\ViewEvent; use Symfony\Component\HttpKernel\KernelEvents; /** * Converts PSR-7 Response to HttpFoundation Response using the bridge. * * @author Kévin Dunglas <dunglas@gmail.com> * @author Alex
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/EventListener/PsrResponseListener.php", "language": "php", "file_size": 1711, "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\Bridge\PsrHttpMessage\Tests\Functional; use Symfony\Bridge\PsrHttpMessage\T...
$crawler->text()); } public function testRequestAction() { $client = self::createClient(); $crawler = $client->request('POST', '/request', [], [], [], 'some content'); self::assertResponseStatusCodeSame(403); s
ic function testServerRequestAction() { $client = self::createClient(); $crawler = $client->request('GET', '/server-request'); self::assertResponseStatusCodeSame(200); self::assertSame('GET',
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Tests/Functional/ControllerTest.php", "language": "php", "file_size": 1478, "cut_index": 524, "middle_length": 229 }
Psr7Request; use Nyholm\Psr7\Stream as Psr7Stream; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory; use Symfony\Bridge\PsrHttpMessage\Facto...
t lose data. * * @author Tobias Nyholm <tobias.nyholm@gmail.com> */ class CovertTest extends TestCase { protected function setUp(): void { if (!class_exists(Psr7Request::class)) { $this->markTestSkipped('nyholm/psr7 is not in
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; /** * Test to convert a request/response back and forth to make sure we do no
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Tests/Functional/CovertTest.php", "language": "php", "file_size": 11045, "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\Bridge\PsrHttpMessage\Tests\Fixtures; use Psr\Http\Message\MessageInterface; use Psr\Http\Message\StreamInterface;...
ion withProtocolVersion($version): never { throw new \BadMethodCallException('Not implemented.'); } public function getHeaders(): array { return $this->headers; } public function hasHeader($name): bool {
.1', private array $headers = [], private readonly StreamInterface $body = new Stream(), ) { } public function getProtocolVersion(): string { return $this->version; } public funct
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Tests/Fixtures/Message.php", "language": "php", "file_size": 2022, "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\Bridge\PsrHttpMessage\Tests\Fixtures; use Psr\Http\Message\Respons...
} public function getStatusCode(): int { return $this->statusCode; } public function withStatus($code, $reasonPhrase = ''): never { throw new \BadMethodCallException('Not implemented.'); } public function ge
truct( string $version = '1.1', array $headers = [], StreamInterface $body = new Stream(), private readonly int $statusCode = 200, ) { parent::__construct($version, $headers, $body);
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Tests/Fixtures/Response.php", "language": "php", "file_size": 1101, "cut_index": 515, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bridge\PsrHttpMessage\Tests\Fixtures; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UriInterface; /** * @...
g|null $uri = null, private readonly array $server = [], private readonly array $cookies = [], private readonly array $query = [], private readonly array $uploadedFiles = [], private readonly array|object|null $data
string $version = '1.1', array $headers = [], ?StreamInterface $body = null, private readonly string $requestTarget = '/', private readonly string $method = 'GET', UriInterface|strin
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Tests/Fixtures/ServerRequest.php", "language": "php", "file_size": 3509, "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\Bridge\PsrHttpMessage\Tests\Fixtures; use Psr\Http\Message\StreamInterface; /** * @aut...
t/plain,'.$this->stringContent, 'r'); } public function getSize(): ?int { return null; } public function tell(): int { return 0; } public function eof(): bool { return $this->eof; } pu
nt = '', ) { } public function __toString(): string { return $this->stringContent; } public function close(): void { } public function detach() { return fopen('data://tex
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Tests/Fixtures/Stream.php", "language": "php", "file_size": 1772, "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\Bridge\PsrHttpMessage\Tests\Fixtures; use Psr\Http\Message\StreamInterface;...
entMediaType = null, ) { } public function getStream(): StreamInterface { return new Stream(file_get_contents($this->filePath)); } public function moveTo($targetPath): void { rename($this->filePath, $targetPath
private readonly string $filePath, private readonly ?int $size = null, private readonly int $error = \UPLOAD_ERR_OK, private readonly ?string $clientFileName = null, private readonly ?string $cli
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Tests/Fixtures/UploadedFile.php", "language": "php", "file_size": 1378, "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\Bridge\PsrHttpMessage\Tests\Fixtures; use Psr\Http\Message\UriInterface; /** * @author Rougin Royce Gutib <rougi...
se_url($uriString); $this->scheme = $parts['scheme'] ?? ''; $this->userInfo = $parts['user'] ?? ''; $this->host = $parts['host'] ?? ''; $this->port = $parts['port'] ?? null; $this->path = $parts['path'] ?? '';
tring $port; private readonly string $path; private readonly string $query; private readonly string $fragment; public function __construct( private readonly string $uriString, ) { $parts = par
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Tests/Fixtures/Uri.php", "language": "php", "file_size": 2997, "cut_index": 563, "middle_length": 229 }
s\Fixtures\App; use Nyholm\Psr7\Factory\Psr17Factory; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ServerRequestFactoryInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Message\UploadedFileFactoryInterface; use Psr\Log\NullLogger; use Symfony\Bridge\PsrHttpMessage\ArgumentValu...
PsrRequestController; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symfony\Component\HttpKernel\Kern
HttpMessage\Factory\PsrHttpFactory; use Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface; use Symfony\Bridge\PsrHttpMessage\HttpMessageFactoryInterface; use Symfony\Bridge\PsrHttpMessage\Tests\Fixtures\App\Controller\
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Tests/Fixtures/App/Kernel.php", "language": "php", "file_size": 3027, "cut_index": 563, "middle_length": 229 }
Bridge\PsrHttpMessage\Tests\Fixtures\App\Controller; use Psr\Http\Message\MessageInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; final clas...
teStream(sprintf('<html><body>%s</body></html>', $request->getMethod()))); } public function requestAction(RequestInterface $request): ResponseInterface { return $this->responseFactory ->createResponse() ->withS
) { } public function serverRequestAction(ServerRequestInterface $request): ResponseInterface { return $this->responseFactory ->createResponse() ->withBody($this->streamFactory->crea
{ "filepath": "src/Symfony/Bridge/PsrHttpMessage/Tests/Fixtures/App/Controller/PsrRequestController.php", "language": "php", "file_size": 1536, "cut_index": 537, "middle_length": 229 }