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\Component\ErrorHandler\ErrorEnhancer;
use Symfony\Component\ErrorHandler\Error\FatalError;
use Symfony\Component\E... | $message, $matches);
if (!$matches) {
return null;
}
$className = $matches[1];
$methodName = $matches[2];
$message = \sprintf('Attempted to call an undefined method named "%s" of class "%s".', $methodNa | nce(\Throwable $error): ?\Throwable
{
if ($error instanceof FatalError) {
return null;
}
$message = $error->getMessage();
preg_match('/^Call to undefined method (.*)::(.*)\(\)$/', | {
"filepath": "src/Symfony/Component/ErrorHandler/ErrorEnhancer/UndefinedMethodErrorEnhancer.php",
"language": "php",
"file_size": 2145,
"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\Finder\Tests\Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\Finder\Itera... | terator($inner, $minDepth, $maxDepth);
$actual = array_keys(iterator_to_array($iterator));
sort($expected);
sort($actual);
$this->assertEquals($expected, $actual);
}
public static function getAcceptData()
{
| cted)
{
$inner = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->toAbsolute(), \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
$iterator = new DepthRangeFilterI | {
"filepath": "src/Symfony/Component/Finder/Tests/Iterator/DepthRangeFilterIteratorTest.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\Finder\Tests\Comparator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
... | e, '__construct() throws an \InvalidArgumentException if the test expression is not valid.');
}
try {
new DateComparator('');
$this->fail('__construct() throws an \InvalidArgumentException if the test expression is | oobar');
$this->fail('__construct() throws an \InvalidArgumentException if the test expression is not valid.');
} catch (\Exception $e) {
$this->assertInstanceOf(\InvalidArgumentException::class, $ | {
"filepath": "src/Symfony/Component/Finder/Tests/Comparator/DateComparatorTest.php",
"language": "php",
"file_size": 2472,
"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\Finder\Tests\Iterator;
class MockSplFileInfo extends \SplFileInfo
{
public const TYPE_DIRECTORY = 1;
public const TYPE_FILE = 2;
public const T... | 'file.txt',
'contents' => null,
'mode' => null,
'type' => null,
'relativePath' => null,
'relativePathname' => null,
];
$defaults = array_merge($default | Pathname = null;
public function __construct($param)
{
if (\is_string($param)) {
parent::__construct($param);
} elseif (\is_array($param)) {
$defaults = [
'name' => | {
"filepath": "src/Symfony/Component/Finder/Tests/Iterator/MockSplFileInfo.php",
"language": "php",
"file_size": 3169,
"cut_index": 614,
"middle_length": 229
} |
file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler;
use Symfony\Component\ErrorHandler\Exception\SilencedErr... | t) {
return $throwable->getSeverity();
}
if ($throwable instanceof \ParseError) {
return \E_PARSE;
}
if ($throwable instanceof \TypeError) {
return \E_RECOVERABLE_ERROR;
}
| ception || $throwable instanceof SilencedErrorContex | {
"filepath": "src/Symfony/Component/ErrorHandler/ThrowableUtils.php",
"language": "php",
"file_size": 865,
"cut_index": 529,
"middle_length": 52
} |
* @final since version 3.3.
*/
class FinalClass1
{
// simple comment
}
/**
* @final
*/
class FinalClass2
{
// no comment
}
/**
* @final comment with @@@ and ***
*
* @author John Doe
*/
class FinalClass3
{
// with comment and a tag after
}
/**
* @final
*
* @author John Doe
*/
class FinalClass4
... | mment and a tag before
}
/**
* @author John Doe
*
* @final another
* multiline comment...
*
* @return string
*/
class FinalClass7
{
// with comment and a tag before and after
}
/**
* @author John Doe
* @final
*
* @return string
*/
|
* @final
*/
class FinalClass6
{
// without co | {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/Fixtures/FinalClasses.php",
"language": "php",
"file_size": 962,
"cut_index": 582,
"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\Mailer\Exception;
use Symfony\Contracts\HttpClient\Response... | nseInterface $response,
int $code = 0,
?\Throwable $previous = null,
) {
parent::__construct($message, $code, $previous);
}
public function getResponse(): ResponseInterface
{
return $this->response;
}
}
| private Respo | {
"filepath": "src/Symfony/Component/Mailer/Exception/HttpTransportException.php",
"language": "php",
"file_size": 788,
"cut_index": 518,
"middle_length": 14
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Exception;
use Symfony\Component\Mailer\Bridge;
use Symfony\Component\Mailer\Transport\Dsn;
/**
* @author Konstantin Myakshin <molodchick@gmail.co... | ],
'brevo' => [
'class' => Bridge\Brevo\Transport\BrevoTransportFactory::class,
'package' => 'symfony/brevo-mailer',
],
'gmail' => [
'class' => Bridge\Google\Transport\GmailTransportFactor | portFactory::class,
'package' => 'symfony/aha-send-mailer',
],
'azure' => [
'class' => Bridge\Azure\Transport\AzureTransportFactory::class,
'package' => 'symfony/azure-mailer',
| {
"filepath": "src/Symfony/Component/Mailer/Exception/UnsupportedSchemeException.php",
"language": "php",
"file_size": 4752,
"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\Mailer\DataCollector;
use Symfony\Component\HttpFoundation\Reques... | gerListener $logger)
{
$this->events = $logger->getEvents();
}
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
$this->data['events'] = $this->events;
}
public fu | ventListener\MessageLoggerListener;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
final class MessageDataCollector extends DataCollector
{
private MessageEvents $events;
public function __construct(MessageLog | {
"filepath": "src/Symfony/Component/Mailer/DataCollector/MessageDataCollector.php",
"language": "php",
"file_size": 1382,
"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\Mailer\Transport;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component... | age $sentMessage, Email $email, Envelope $envelope): ResponseInterface;
protected function doSendHttp(SentMessage $message): ResponseInterface
{
try {
$email = MessageConverter::toEmail($message->getOriginalMessage());
|
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class AbstractApiTransport extends AbstractHttpTransport
{
abstract protected function doSendApi(SentMess | {
"filepath": "src/Symfony/Component/Mailer/Transport/AbstractApiTransport.php",
"language": "php",
"file_size": 1586,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Sym... | ected ?int $port = null;
public function __construct(
protected ?HttpClientInterface $client = null,
?EventDispatcherInterface $dispatcher = null,
?LoggerInterface $logger = null,
) {
if (null === $client) {
| ace;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @author Victor Bocharsky <victor@symfonycasts.com>
*/
abstract class AbstractHttpTransport extends AbstractTransport
{
protected ?string $host = null;
prot | {
"filepath": "src/Symfony/Component/Mailer/Transport/AbstractHttpTransport.php",
"language": "php",
"file_size": 2161,
"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\Mailer\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Symfony\Bridge\Twig\Mime\Templ... | essage;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class AbstractTransport implements TransportInterface
{
private LoggerInterface $logger;
private float $rate = 0;
private float $lastSent = 0;
public function __con | tMessageEvent;
use Symfony\Component\Mailer\Exception\LogicException;
use Symfony\Component\Mailer\SentMessage;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\BodyRendererInterface;
use Symfony\Component\Mime\RawM | {
"filepath": "src/Symfony/Component/Mailer/Transport/AbstractTransport.php",
"language": "php",
"file_size": 4006,
"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\Mailer\Transport;
use Psr\EventDispatcher\EventDispatcherInterfac... | rface $client = null,
protected ?LoggerInterface $logger = null,
) {
}
public function supports(Dsn $dsn): bool
{
return \in_array($dsn->getScheme(), $this->getSupportedSchemes(), true);
}
abstract protected functi | hick@gmail.com>
*/
abstract class AbstractTransportFactory implements TransportFactoryInterface
{
public function __construct(
protected ?EventDispatcherInterface $dispatcher = null,
protected ?HttpClientInte | {
"filepath": "src/Symfony/Component/Mailer/Transport/AbstractTransportFactory.php",
"language": "php",
"file_size": 1356,
"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\Mailer\Transport;
use Symfony\Component\Mailer\Exception\InvalidArgumentException;
/**
* @author Konst... | elf
{
if (false === $params = parse_url($dsn)) {
throw new InvalidArgumentException('The mailer DSN is invalid.');
}
if (!isset($params['scheme'])) {
throw new InvalidArgumentException('The mailer DSN mu |
#[\SensitiveParameter] private ?string $password = null,
private ?int $port = null,
private array $options = [],
) {
}
public static function fromString(#[\SensitiveParameter] string $dsn): s | {
"filepath": "src/Symfony/Component/Mailer/Transport/Dsn.php",
"language": "php",
"file_size": 2373,
"cut_index": 563,
"middle_length": 229
} |
n Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Transport;
/**
* Uses several Transports using a failover algorithm.
*
* @author Fabien Potencier <fabien@symfony... | s->isTransportDead($this->currentTransport)) {
$this->currentTransport = parent::getNextTransport();
}
return $this->currentTransport;
}
protected function getInitialCursor(): int
{
return 0;
}
pro | if (null === $this->currentTransport || $thi | {
"filepath": "src/Symfony/Component/Mailer/Transport/FailoverTransport.php",
"language": "php",
"file_size": 971,
"cut_index": 582,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Transport;
use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Maile... | n $dsn): TransportInterface
{
if (!\in_array($dsn->getScheme(), $this->getSupportedSchemes(), true)) {
throw new UnsupportedSchemeException($dsn, 'native', $this->getSupportedSchemes());
}
if ($sendMailPath = ini_ge | res a transport (sendmail or SMTP) based on php.ini settings.
*
* @author Laurent VOULLEMIER <laurent.voullemier@gmail.com>
*/
final class NativeTransportFactory extends AbstractTransportFactory
{
public function create(Ds | {
"filepath": "src/Symfony/Component/Mailer/Transport/NativeTransportFactory.php",
"language": "php",
"file_size": 2203,
"cut_index": 563,
"middle_length": 229
} |
file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Transport;
use Symfony\Component\Mailer\Exception\UnsupportedSc... | eme()) {
return new NullTransport($this->dispatcher, $this->logger);
}
throw new UnsupportedSchemeException($dsn, 'null', $this->getSupportedSchemes());
}
protected function getSupportedSchemes(): array
{
r | tInterface
{
if ('null' === $dsn->getSch | {
"filepath": "src/Symfony/Component/Mailer/Transport/NullTransportFactory.php",
"language": "php",
"file_size": 861,
"cut_index": 529,
"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\Mailer\Transport;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\Transp... | ate \SplObjectStorage $deadTransports;
private int $cursor = -1;
/**
* @param TransportInterface[] $transports
*/
public function __construct(
private array $transports,
private int $retryPeriod = 60,
private | ts using a round robin algorithm.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class RoundRobinTransport implements TransportInterface
{
/**
* @var \SplObjectStorage<TransportInterface, float>
*/
priv | {
"filepath": "src/Symfony/Component/Mailer/Transport/RoundRobinTransport.php",
"language": "php",
"file_size": 3815,
"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\Mailer\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Envelope;
use Symfony\Compone... | nsportFactory:
*
* - SendmailTransportFactory to use most common sendmail path and recommended options
* - NativeTransportFactory when configuration is set via php.ini
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Chris Corbyn
*/
class | \Stream\ProcessStream;
use Symfony\Component\Mime\RawMessage;
/**
* SendmailTransport for sending mail through a Sendmail/Postfix (etc..) binary.
*
* Transport can be instantiated through SendmailTransportFactory or NativeTra | {
"filepath": "src/Symfony/Component/Mailer/Transport/SendmailTransport.php",
"language": "php",
"file_size": 4432,
"cut_index": 614,
"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\Mailer\Transport;
use Symfony\Component\Mailer\Exception\UnsupportedSchemeException;
/**
* @author Konstantin Myakshin <m... | )) {
return new SendmailTransport($dsn->getOption('command'), $this->dispatcher, $this->logger);
}
throw new UnsupportedSchemeException($dsn, 'sendmail', $this->getSupportedSchemes());
}
protected function getSupported | $dsn->getScheme() || 'sendmail' === $dsn->getScheme( | {
"filepath": "src/Symfony/Component/Mailer/Transport/SendmailTransportFactory.php",
"language": "php",
"file_size": 967,
"cut_index": 582,
"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\Mailer\Transport;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Ex... | s they allow asynchronous sending.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface TransportInterface extends \Stringable
{
/**
* @throws TransportExceptionInterface
*/
public function send(RawMessage $message, ?Envelope | u should prefer MailerInterface implementations
* a | {
"filepath": "src/Symfony/Component/Mailer/Transport/TransportInterface.php",
"language": "php",
"file_size": 891,
"cut_index": 547,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Transport;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\InvalidA... | tInterface $default;
/**
* @param iterable<string, TransportInterface> $transports
*/
public function __construct(iterable $transports)
{
foreach ($transports as $name => $transport) {
$this->default ??= $transpor | **
* @author Fabien Potencier <fabien@symfony.com>
*/
final class Transports implements TransportInterface
{
/**
* @var array<string, TransportInterface>
*/
private array $transports = [];
private Transpor | {
"filepath": "src/Symfony/Component/Mailer/Transport/Transports.php",
"language": "php",
"file_size": 2328,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Transport\Smtp;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
use Symfony\Component\Mailer... | private array $authenticators = [];
private string $username = '';
private string $password = '';
private array $capabilities;
private bool $autoTls = true;
private bool $requireTls = false;
public function __construct(string $ | Component\Mailer\Transport\Smtp\Stream\SocketStream;
/**
* Sends Emails over SMTP with ESMTP support.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Chris Corbyn
*/
class EsmtpTransport extends SmtpTransport
{
| {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransport.php",
"language": "php",
"file_size": 8516,
"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\Mailer\Transport\Smtp;
use Symfony\Component\Mailer\Exception\UnsupportedSchemeException;
use Symfony\Component\Mailer\Transport\AbstractTransportFactory;
... | tedSchemes(), true)) {
throw new UnsupportedSchemeException($dsn, 'smtp', $this->getSupportedSchemes());
}
$autoTls = '' === $dsn->getOption('auto_tls') || filter_var($dsn->getOption('auto_tls', true), \FILTER_VALIDATE_BOOL);
| in Myakshin <molodchick@gmail.com>
*/
final class EsmtpTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
if (!\in_array($dsn->getScheme(), $this->getSuppor | {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransportFactory.php",
"language": "php",
"file_size": 3189,
"cut_index": 614,
"middle_length": 229
} |
se Symfony\Component\Mailer\Exception\InvalidArgumentException;
use Symfony\Component\Mailer\Exception\LogicException;
use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
use Symfony\Component\Mailer\Exception\UnexpectedResponseException;
use Sy... | t
{
private bool $started = false;
private int $restartThreshold = 100;
private int $restartThresholdSleep = 0;
private int $restartCounter = 0;
private int $pingThreshold = 100;
private float $lastMessageTime = 0;
private Abstr | ansport\Smtp\Stream\SocketStream;
use Symfony\Component\Mime\RawMessage;
/**
* Sends emails over SMTP.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Chris Corbyn
*/
class SmtpTransport extends AbstractTranspor | {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php",
"language": "php",
"file_size": 12453,
"cut_index": 921,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Transport\Smtp\Stream;
use Symfony\Component\Mailer\Exception\TransportException;
/**
* A stream supporting remote sockets and local processes.
*... | debug = true): void
{
if ($debug) {
$timestamp = (new \DateTimeImmutable())->format('Y-m-d\TH:i:s.up');
foreach (explode("\n", trim($bytes)) as $line) {
$this->debug .= \sprintf("[%s] > %s\n", $timestamp, | ll */
protected $stream;
/** @var resource|null */
protected $in;
/** @var resource|null */
protected $out;
protected $err;
private string $debug = '';
public function write(string $bytes, bool $ | {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php",
"language": "php",
"file_size": 4107,
"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\Mailer\Transport\Smtp\Stream;
use Symfony\Component\Mailer\Exception\TransportException;
/**
* A strea... | $this->interactive = $interactive;
}
public function initialize(): void
{
$descriptorSpec = [
0 => ['pipe', 'r'],
1 => ['pipe', 'w'],
2 => ['pipe', '\\' === \DIRECTORY_SEPARATOR ? 'a' : 'w'],
| ing $command;
private bool $interactive = false;
public function setCommand(string $command): void
{
$this->command = $command;
}
public function setInteractive(bool $interactive): void
{
| {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/Stream/ProcessStream.php",
"language": "php",
"file_size": 2187,
"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\Mailer\Transport\Smtp\Stream;
use Symfony\Component\Mailer\Exception\TransportException;
/**
* A stream supporting remote sockets.
*
* @author Fabien P... | Timeout(float $timeout): static
{
$this->timeout = $timeout;
return $this;
}
public function getTimeout(): float
{
return $this->timeout ?? (float) \ini_get('default_socket_timeout');
}
/**
* Literal | private int $port = 465;
private float $timeout;
private bool $tls = true;
private ?string $sourceIp = null;
private array $streamContextOptions = [];
/**
* @return $this
*/
public function set | {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/Stream/SocketStream.php",
"language": "php",
"file_size": 4624,
"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\Mailer\Transport\Smtp\Auth;
use Symfony\Component\Mailer\Excepti... | *
* @throws TransportExceptionInterface
*/
public function authenticate(EsmtpTransport $client): void;
/**
* Gets the name of the AUTH mechanism this Authenticator handles.
*/
public function getAuthKeyword(): string;
}
|
{
/**
* Tries to authenticate the user.
| {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/Auth/AuthenticatorInterface.php",
"language": "php",
"file_size": 831,
"cut_index": 523,
"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\Mailer\Transport\Smtp\Auth;
use Symfony\Component\Mailer\Exception\InvalidArgu... | d
{
$challenge = $client->executeCommand("AUTH CRAM-MD5\r\n", [334]);
$challenge = base64_decode(substr($challenge, 4));
$message = base64_encode($client->getUsername().' '.$this->getResponse($client->getPassword(), $challenge)) | icatorInterface
{
public function getAuthKeyword(): string
{
return 'CRAM-MD5';
}
/**
* @see https://www.ietf.org/rfc/rfc4954.txt
*/
public function authenticate(EsmtpTransport $client): voi | {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/Auth/CramMd5Authenticator.php",
"language": "php",
"file_size": 1839,
"cut_index": 537,
"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\Mailer\Transport\Smtp\Auth;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
/**
* Handles LOGIN authenticatio... | public function authenticate(EsmtpTransport $client): void
{
$client->executeCommand("AUTH LOGIN\r\n", [334]);
$client->executeCommand(\sprintf("%s\r\n", base64_encode($client->getUsername())), [334]);
$client->executeCommand( | @see https://www.ietf.org/rfc/rfc4954.txt
*/
| {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/Auth/LoginAuthenticator.php",
"language": "php",
"file_size": 965,
"cut_index": 582,
"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\Component\Mailer\Transport\Smtp\Auth;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
/**
* Hand... | /rfc4954.txt
*/
public function authenticate(EsmtpTransport $client): void
{
$client->executeCommand(\sprintf("AUTH PLAIN %s\r\n", base64_encode($client->getUsername().\chr(0).$client->getUsername().\chr(0).$client->getPassword())), [2 |
}
/**
* @see https://www.ietf.org/rfc | {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/Auth/PlainAuthenticator.php",
"language": "php",
"file_size": 881,
"cut_index": 559,
"middle_length": 52
} |
?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Transport\Smtp\Auth;
use Symfony\Component\Mail... | /xoauth2_protocol#the_sasl_xoauth2_mechanism
*/
public function authenticate(EsmtpTransport $client): void
{
$client->executeCommand('AUTH XOAUTH2 '.base64_encode('user='.$client->getUsername()."\1auth=Bearer ".$client->getPassword()." | 2_protocol
*/
class XOAuth2Authenticator implements AuthenticatorInterface
{
public function getAuthKeyword(): string
{
return 'XOAUTH2';
}
/**
* @see https://developers.google.com/google-apps/gmail | {
"filepath": "src/Symfony/Component/Mailer/Transport/Smtp/Auth/XOAuth2Authenticator.php",
"language": "php",
"file_size": 1029,
"cut_index": 513,
"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\Mailer\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command... | ler transports by sending an email')]
final class MailerTestCommand extends Command
{
public function __construct(private TransportInterface $transport)
{
parent::__construct();
}
protected function configure(): void
{
| Output\OutputInterface;
use Symfony\Component\Mailer\Transport\TransportInterface;
use Symfony\Component\Mime\Email;
/**
* A console command to test Mailer transports.
*/
#[AsCommand(name: 'mailer:test', description: 'Test Mai | {
"filepath": "src/Symfony/Component/Mailer/Command/MailerTestCommand.php",
"language": "php",
"file_size": 2629,
"cut_index": 563,
"middle_length": 229
} |
hp
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\EventListener;
use Symfony\Component\EventDispatc... | Event $event): void
{
$message = $event->getMessage();
if (!$message instanceof Message) {
return;
}
$event->setMessage($this->signer->sign($message));
}
public static function getSubscribedEvents(): | IM.
*
* @author Elías Fernández
*/
class DkimSignedMessageListener implements EventSubscriberInterface
{
public function __construct(
private DkimSigner $signer,
) {
}
public function onMessage(Message | {
"filepath": "src/Symfony/Component/Mailer/EventListener/DkimSignedMessageListener.php",
"language": "php",
"file_size": 1107,
"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\Component\Mailer\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Mailer\Event\MessageEvent;
use Symfony\Componen... | string> $recipients
* @param string[] $allowedRecipients An array of regex to match the allowed recipients
*/
public function __construct(
Address|string|null $sender = null,
?array $recipients = null,
pri | .info>
*/
class EnvelopeListener implements EventSubscriberInterface
{
private ?Address $sender = null;
/**
* @var Address[]|null
*/
private ?array $recipients = null;
/**
* @param array<Address| | {
"filepath": "src/Symfony/Component/Mailer/EventListener/EnvelopeListener.php",
"language": "php",
"file_size": 3059,
"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\Mailer\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Mailer\Event\MessageEvent;
use Symfony\Componen... | implements EventSubscriberInterface
{
public const HEADER_SET_IF_EMPTY = 1;
public const HEADER_ADD = 2;
public const HEADER_REPLACE = 3;
public const DEFAULT_RULES = [
'from' => self::HEADER_SET_IF_EMPTY,
'return-path' => s | s;
use Symfony\Component\Mime\Header\MailboxListHeader;
use Symfony\Component\Mime\Message;
/**
* Manipulates the headers and the body of a Message.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class MessageListener | {
"filepath": "src/Symfony/Component/Mailer/EventListener/MessageListener.php",
"language": "php",
"file_size": 3846,
"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\Mailer\EventListener;
use Symfony\Component\EventDispatcher... | s->events = new MessageEvents();
}
public function reset(): void
{
$this->events = new MessageEvents();
}
public function onMessage(MessageEvent $event): void
{
$this->events->add($event);
}
public functio | s.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class MessageLoggerListener implements EventSubscriberInterface, ResetInterface
{
private MessageEvents $events;
public function __construct()
{
$thi | {
"filepath": "src/Symfony/Component/Mailer/EventListener/MessageLoggerListener.php",
"language": "php",
"file_size": 1229,
"cut_index": 518,
"middle_length": 229
} |
ds ReturnTypeGrandParent implements ReturnTypeParentInterface
{
const FOO = 'foo';
/**
* @return void
*/
public function __construct()
{
}
/**
* No return declared here
*/
public function returnTypeGrandParent()
{
}
/**
* @return string
*/
abs... | */
public function oneCommonNonObjectReturnedTypeWithNull()
{
}
/**
* @return void
*/
public function oneNonNullableReturnableType()
{
}
/**
* @return void|null
*/
public function oneNonNullable | |null
*/
abstract public function realReturnTypeIsAlreadyThereWithNull();
/**
* @return resource
*/
public function oneCommonNonObjectReturnedType()
{
}
/**
* @return resource|null
| {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/Fixtures/ReturnTypeParent.php",
"language": "php",
"file_size": 3883,
"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\ErrorHandler\Tests\Command;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Component\Con... | ointLookupInterface;
class ErrorDumpCommandTest extends TestCase
{
private string $tmpDir = '';
protected function setUp(): void
{
$this->tmpDir = sys_get_temp_dir().'/error_pages';
$fs = new Filesystem();
$fs->remove | ler\Exception\FlattenException;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\WebpackEncoreBundle\Asset\Entryp | {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/Command/ErrorDumpCommandTest.php",
"language": "php",
"file_size": 3773,
"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\ErrorHandler\Tests\ErrorRenderer;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\ErrorRe... | HTML
<!-- Foo (500 Internal Server Error) -->
<!DOCTYPE html>
<html lang="en">
%A<title>Foo (500 Internal Server Error)</title>
%A<div class="trace trace-as-html" id="trace-box-1">%A
< | derer, string $expected)
{
$this->assertStringMatchesFormat($expected, $errorRenderer->render($exception)->getAsString());
}
public static function getRenderData(): iterable
{
$expectedDebug = <<< | {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/ErrorRenderer/HtmlErrorRendererTest.php",
"language": "php",
"file_size": 4697,
"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\ErrorHandler\ErrorRenderer;
use Symfony\Component\ErrorHandler\Ex... | arCloner();
$dumper = new class extends CliDumper {
protected function supportsColors(): bool
{
$outputStream = $this->outputStream;
$this->outputStream = fopen('php://stdout', 'w');
| ts(CliDumper::class);
/**
* @author Nicolas Grekas <p@tchwork.com>
*/
class CliErrorRenderer implements ErrorRendererInterface
{
public function render(\Throwable $exception): FlattenException
{
$cloner = new V | {
"filepath": "src/Symfony/Component/ErrorHandler/ErrorRenderer/CliErrorRenderer.php",
"language": "php",
"file_size": 1357,
"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\ErrorHandler\ErrorRenderer;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\... | Stack $requestStack = null,
private ?string $baseDir = null,
private string|\Closure|null $urlFormat = null,
) {
$fileLinkFormat ??= $_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? '';
if (!\is_array($f = $fileLinkFo | kFormat;
/**
* @param string|\Closure $urlFormat The URL format, or a closure that returns it on-demand
*/
public function __construct(
string|array|null $fileLinkFormat = null,
private ?Request | {
"filepath": "src/Symfony/Component/ErrorHandler/ErrorRenderer/FileLinkFormatter.php",
"language": "php",
"file_size": 3184,
"cut_index": 614,
"middle_length": 229
} |
:GHOST_HEART,
'02-29' => self::GHOST_PLUS,
'10-18' => self::GHOST_GIFT,
];
private const GHOST_GIFT = 'M124.00534057617188,5.3606138080358505 C124.40059661865234,4.644828304648399 125.1237564086914,3.712414965033531 123.88127899169922,3.487462028861046 C123.53517150878906,3.3097832053899765 123... | 64062,7.336987480521202 C121.60028076171875,6.076864704489708 121.03211975097656,4.72498320043087 120.16796875,3.562500938773155 C119.11695098876953,2.44033907353878 117.04605865478516,2.940566048026085 116.57544708251953,4.387995228171349 C115.95028686523 | 953613281,5.3830065578222275 122.90142822265625,6.503447040915489 123.3077621459961,6.626829609274864 C123.55027770996094,6.210384353995323 123.7774658203125,5.785196766257286 124.00534057617188,5.3606138080358505 zM122.306304931 | {
"filepath": "src/Symfony/Component/ErrorHandler/ErrorRenderer/HtmlErrorRenderer.php",
"language": "php",
"file_size": 23360,
"cut_index": 1331,
"middle_length": 229
} |
$trace['file'] ? 'sf-toggle' : ''; ?>" data-toggle-selector="#trace-html-<?= $prefix; ?>-<?= $i; ?>" data-toggle-initial="<?= 'expanded' === $style ? 'display' : ''; ?>">
<?php if ($trace['file']) { ?>
<span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square.svg'); ?></span>
... | (isset($trace['args'])) { ?><span class="trace-arguments">(<?= $this->formatArgs($trace['args']); ?>)</span><?php } ?>
<?php } ?>
<?php if ($trace['file']) { ?>
<?php
$lineNumber = $trace['line'] ?: 1;
$fileLink = $this->f | lass="trace-class"><?= $this->abbrClass($trace['class']); ?></span><?php if ($trace['type']) { ?><span class="trace-type"><?= $trace['type']; ?></span><?php } ?><span class="trace-method"><?= $trace['function']; ?></span><?php if | {
"filepath": "src/Symfony/Component/ErrorHandler/Resources/views/trace.html.php",
"language": "php",
"file_size": 2575,
"cut_index": 563,
"middle_length": 229
} |
s="trace-head">
<tr>
<th class="sf-toggle" data-toggle-selector="#trace-text-<?= $index; ?>" data-toggle-initial="<?= 1 === $index ? 'display' : ''; ?>">
<div class="trace-class">
<?php if ($numExceptions > 1) { ?>
<span class="text-muted">... | ?></span>
</div>
</th>
</tr>
</thead>
<tbody id="trace-text-<?= $index; ?>">
<tr>
<td>
<?php if ($exception['trace']) { ?>
<pre class="stacktrace">
<?php
| <span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square-o.svg'); ?></span>
<span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square-o.svg'); | {
"filepath": "src/Symfony/Component/ErrorHandler/Resources/views/traces_text.html.php",
"language": "php",
"file_size": 2064,
"cut_index": 563,
"middle_length": 229
} |
f 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.
*/
if ('cli' !== \PHP_SAPI) {
throw new Exception('This script must be run from the command line.');
}
// Run fr... | and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Internal;
/**
* This class has been generated by extract-tentative-return-types.php.
| tative-return-types.php > /path/to/TentativeTypes.php
echo <<<EOPHP
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright | {
"filepath": "src/Symfony/Component/ErrorHandler/Resources/bin/extract-tentative-return-types.php",
"language": "php",
"file_size": 2122,
"cut_index": 563,
"middle_length": 229
} |
ader::enable();
$functions = spl_autoload_functions();
foreach ($functions as $function) {
if (\is_array($function) && $function[0] instanceof DebugClassLoader) {
$reflClass = new \ReflectionClass($function[0]);
$reflProp = $reflClass->getProperty('classLoade... | lClass->getProperty('vendorPrefixCache');
$remapProp = $reflClass->getProperty('namespaceRemappings');
DebugClassLoader::enable(['App' => 'Symfony']);
$cacheProp->setValue(null, ['App\\Foo' => 'Symfony']);
DebugClassLoader | oader did not register');
}
#[RunInSeparateProcess]
public function testEnableClearsVendorPrefixCacheOnRemapChange()
{
$reflClass = new \ReflectionClass(DebugClassLoader::class);
$cacheProp = $ref | {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/DebugClassLoaderTest.php",
"language": "php",
"file_size": 58131,
"cut_index": 2151,
"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\ErrorHandler\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input... | ception\HttpException;
use Symfony\WebpackEncoreBundle\Asset\EntrypointLookupInterface;
/**
* Dump error pages to plain HTML files that can be directly served by a web server.
*
* @author Loïck Piera <pyrech@gmail.com>
*/
#[AsCommand(
name: 'error | \Console\Style\SymfonyStyle;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Ex | {
"filepath": "src/Symfony/Component/ErrorHandler/Command/ErrorDumpCommand.php",
"language": "php",
"file_size": 3300,
"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\ErrorHandler\Tests\ErrorEnhancer;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\T... | $expectedLine = __LINE__ + 1;
$error = $enhancer->enhance(new \Error($originalMessage));
$this->assertInstanceOf(UndefinedFunctionError::class, $error);
// class names are case-insensitive and PHP do not return the same
$ | Test extends TestCase
{
#[DataProvider('provideUndefinedFunctionData')]
public function testEnhance(string $originalMessage, string $enhancedMessage)
{
$enhancer = new UndefinedFunctionErrorEnhancer();
| {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/ErrorEnhancer/UndefinedFunctionErrorEnhancerTest.php",
"language": "php",
"file_size": 2433,
"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\Mailer;
use Symfony\Component\Mailer\Exception\LogicException;
use Symfony\Component\Mime\Address;
use S... | parent::setSender($sender);
$this->senderSet = true;
}
public function getSender(): Address
{
if (!$this->senderSet) {
parent::setSender(self::getSenderFromHeaders($this->message->getHeaders()));
}
|
{
private bool $senderSet = false;
private bool $recipientsSet = false;
public function __construct(
private Message $message,
) {
}
public function setSender(Address $sender): void
{
| {
"filepath": "src/Symfony/Component/Mailer/DelayedEnvelope.php",
"language": "php",
"file_size": 2416,
"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\Mailer;
use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Mailer\Event\MessageEven... | implements MailerInterface
{
public function __construct(
private TransportInterface $transport,
private ?MessageBusInterface $bus = null,
private ?EventDispatcherInterface $dispatcher = null,
) {
}
public function | ymfony\Component\Messenger\Exception\HandlerFailedException;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Mime\RawMessage;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
final class Mailer | {
"filepath": "src/Symfony/Component/Mailer/Mailer.php",
"language": "php",
"file_size": 2698,
"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\Mailer;
use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\RawMessage;
/**
* @author Fabie... | tanceof Message) {
$message = clone $message;
$headers = $message->getHeaders();
if (!$headers->has('Message-ID')) {
$headers->addIdHeader('Message-ID', $message->generateMessageId());
}
| * @internal
*/
public function __construct(
RawMessage $message,
private Envelope $envelope,
) {
$message->ensureValidity();
$this->original = $message;
if ($message ins | {
"filepath": "src/Symfony/Component/Mailer/SentMessage.php",
"language": "php",
"file_size": 2296,
"cut_index": 563,
"middle_length": 229
} |
r\Tests;
use Symfony\Component\ErrorHandler\Tests\Fixtures\ReturnTypeParent;
use Symfony\Component\ErrorHandler\Tests\Fixtures\ReturnTypeInterface;
class ReturnType extends ReturnTypeParent implements ReturnTypeInterface, Fixtures\OutsideInterface
{
public function __construct() { }
public function returnType... | thNull() { }
public function oneNonNullableReturnableType() { }
public function oneNonNullableReturnableTypeWithNull() { }
public function oneNullableReturnableType() { }
public function oneNullableReturnableTypeWithNull() { }
public fu | ion realReturnTypeIsAlreadyThere(): float { }
public function realReturnTypeIsAlreadyThereWithNull(): ?iterable { }
public function oneCommonNonObjectReturnedType() { }
public function oneCommonNonObjectReturnedTypeWi | {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/Fixtures/ReturnType.php",
"language": "php",
"file_size": 2269,
"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\ErrorHandler\Tests\ErrorRenderer;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\ErrorRe... |
if (get_cfg_var('xdebug.file_link_format')) {
// There is no way to override "xdebug.file_link_format" option in a test.
$this->markTestSkipped('php.ini has a custom option for "xdebug.file_link_format".');
}
| estWhenNoFileLinkFormatAndNoRequest()
{
$sut = new FileLinkFormatter([]);
$this->assertFalse($sut->format('/kernel/root/src/my/very/best/file.php', 3));
}
public function testAfterUnserialize()
{ | {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/ErrorRenderer/FileLinkFormatterTest.php",
"language": "php",
"file_size": 4337,
"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\ErrorHandler\Tests\ErrorRenderer;
use PHPUnit\Framework\TestCase;... | self::assertStringContainsString('<h2>The server returned a "500 Internal Server Error".</h2>', $errorRenderer->render(new \RuntimeException())->getAsString());
}
public function testSerializerContent()
{
$exception = new \Runtim | use Symfony\Component\Serializer\Serializer;
class SerializerErrorRendererTest extends TestCase
{
public function testDefaultContent()
{
$errorRenderer = new SerializerErrorRenderer(new Serializer(), 'html');
| {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/ErrorRenderer/SerializerErrorRendererTest.php",
"language": "php",
"file_size": 1430,
"cut_index": 524,
"middle_length": 229
} |
ert,Critical,Error,Warning,Notice,Info,Debug" data-filters>
<?php $channelIsDefined = isset($logs[0]['channel']); ?>
<thead>
<tr>
<th data-filter="level">Level</th>
<?php if ($channelIsDefined) { ?><th data-filter="channel">Channel</th><?php } ?>
<th class="full-width">Me... | \ErrorHandler\Exception\SilencedErrorContext) {
$severity = $exception->getSeverity();
}
$status = \E_DEPRECATED === $severity || \E_USER_DEPRECATED === $severity ? 'warning' : 'normal';
} ?>
<tr clas | y'] >= 300) {
$status = 'warning';
} else {
$severity = 0;
if (($exception = $log['context']['exception'] ?? null) instanceof \ErrorException || $exception instanceof \Symfony\Component | {
"filepath": "src/Symfony/Component/ErrorHandler/Resources/views/logs.html.php",
"language": "php",
"file_size": 2139,
"cut_index": 563,
"middle_length": 229
} |
1 5.2 3 24.3 24.3 0 0 1 3.4 3.4 24.8 24.8 0 0 1 5 9.4c.5 1.7.8 3.4 1 5.2v14.5h.4l.5.2a7.4 7.4 0 0 0 2.5.2l.2-.2.6-.8.8-1.3-.2-.1a5.5 5.5 0 0 1-.8-.3 5.6 5.6 0 0 1-2.3-1.8 5.7 5.7 0 0 1-.9-1.6 6.5 6.5 0 0 1-.2-2.8 7.3 7.3 0 0 1 .5-2l.3-.3.8-.9.3-.3c.2-.2.5-.3.8-.3H120.7c.2 0 .3-.1.4 0h.4l.2.1.3.2.2-.4.3-.4.1-.1 1.2-1 .... | 0 0 1-1.7 2.8 9.3 9.3 0 0 1-3 2.3 9 9 0 0 1-5.4.7 9 9 0 0 1-3-1 9.4 9.4 0 0 1-2.7-2.5 10 10 0 0 1-1 1.2 9.3 9.3 0 0 1-2 1.3 9 9 0 0 1-2.4 1 9 9 0 0 1-6.5-1.1A9.4 9.4 0 0 1 85 77V77a10.9 10.9 0 0 1-.6.6 9.3 9.3 0 0 1-2.7 2 9 9 0 0 1-6 .8 9 9 0 0 1-2.4-1 9. | 4 0 0 1-1 .5 6.1 6.1 0 0 1-.6.2l-.7.1h-.1a23.4 23.4 0 0 1-.2 1.7 14.3 14.3 0 0 1-.6 2.1l-.8 2a9.2 9.2 0 0 1-.4.6l-.7 1a9.1 9.1 0 0 1-2.3 2.2c-.9.5-2 .6-3 .7l-1.4.1h-.5l-.4.1a15.8 15.8 0 0 1-2.8-.1v4.2a9.7 9.7 0 0 1-.7 3.5 9.6 9.6 | {
"filepath": "src/Symfony/Component/ErrorHandler/Resources/assets/images/symfony-ghost.svg.php",
"language": "php",
"file_size": 8180,
"cut_index": 716,
"middle_length": 229
} |
r\Exception\FlattenException;
use Symfony\Component\ErrorHandler\Tests\Fixtures\StringErrorCodeException;
use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;... | ny\Component\HttpKernel\Exception\PreconditionFailedHttpException;
use Symfony\Component\HttpKernel\Exception\PreconditionRequiredHttpException;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
use Symfony\Component\HttpKernel\Ex | ception;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfo | {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/Exception/FlattenExceptionTest.php",
"language": "php",
"file_size": 12582,
"cut_index": 921,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\ErrorEnhancer;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\T... | dLine = __LINE__ + 1;
$error = $enhancer->enhance(new \Error($originalMessage));
$this->assertInstanceOf(UndefinedMethodError::class, $error);
$this->assertSame($enhancedMessage, $error->getMessage());
$this->assertSame(rea | xtends TestCase
{
#[DataProvider('provideUndefinedMethodData')]
public function testEnhance(string $originalMessage, string $enhancedMessage)
{
$enhancer = new UndefinedMethodErrorEnhancer();
$expecte | {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/ErrorEnhancer/UndefinedMethodErrorEnhancerTest.php",
"language": "php",
"file_size": 2355,
"cut_index": 563,
"middle_length": 229
} |
* @method string interfaceMethod()
* @method static staticReturningMethod()
* @method sameLineInterfaceMethod($arg)
* @method sameLineInterfaceMethodNoBraces
*
* Ignored
* @method
* @method
*
* Not ignored
* @method newLineInterfaceMethod() Some description!
* @method \stdClass newLineInterfaceMethodN... | ethod array<string, int>|string[]|int complexInterfaceMethodTyped($arg, int ...$args) Description ...
*
* Static
* @method static Foo&Bar staticMethod()
* @method static mixed staticMethodNoBraces
* @method static \stdClass staticMethodTyped(int $arg) | complexInterfaceMethod($arg, ...$args)
* @m | {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/Fixtures/VirtualInterface.php",
"language": "php",
"file_size": 994,
"cut_index": 582,
"middle_length": 52
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\ErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Compon... | enderer;
private bool|\Closure $debug;
/**
* @param string|callable(FlattenException): string $format The format as a string or a callable that should return it
* formats not suppo | Serializer for rendering.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class SerializerErrorRenderer implements ErrorRendererInterface
{
private string|\Closure $format;
private ErrorRendererInterface $fallbackErrorR | {
"filepath": "src/Symfony/Component/ErrorHandler/ErrorRenderer/SerializerErrorRenderer.php",
"language": "php",
"file_size": 3287,
"cut_index": 614,
"middle_length": 229
} |
$index; ?>">
<div class="trace-details">
<div class="trace-head">
<div class="sf-toggle" data-toggle-selector="#trace-html-<?= $index; ?>" data-toggle-initial="<?= $expand ? 'display' : ''; ?>">
<span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square-o.s... | arator);
?>
<?php if ('' === $class) { ?>
<br>
<?php } else { ?>
<h3 class="trace-class">
<?php if ('' !== $namespace) { ?>
| xception['class'], '\\');
$separator = false === $separator ? 0 : $separator + 1;
$namespace = substr($exception['class'], 0, $separator);
$class = substr($exception['class'], $sep | {
"filepath": "src/Symfony/Component/ErrorHandler/Resources/views/traces.html.php",
"language": "php",
"file_size": 2815,
"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\Mailer;
use Symfony\Component\Mailer\Exception\InvalidArgumentException;
use Symfony\Component\Mailer\Exception\LogicException;
use Symfony\Component\Mime\... | ction create(RawMessage $message): self
{
if (RawMessage::class === $message::class) {
throw new LogicException('Cannot send a RawMessage instance without an explicit Envelope.');
}
return new DelayedEnvelope($messa | /**
* @param Address[] $recipients
*/
public function __construct(Address $sender, array $recipients)
{
$this->setSender($sender);
$this->setRecipients($recipients);
}
public static fun | {
"filepath": "src/Symfony/Component/Mailer/Envelope.php",
"language": "php",
"file_size": 3634,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Bridge\AhaSend\Transport\AhaSendTransportFactory;
use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
use Symfony\Compo... | sport\MailerSendTransportFactory;
use Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory;
use Symfony\Component\Mailer\Bridge\Mailjet\Transport\MailjetTransportFactory;
use Symfony\Component\Mailer\Bridge\Mailomat\Transport\MailomatT | ransportFactory;
use Symfony\Component\Mailer\Bridge\Infobip\Transport\InfobipTransportFactory;
use Symfony\Component\Mailer\Bridge\Mailchimp\Transport\MandrillTransportFactory;
use Symfony\Component\Mailer\Bridge\MailerSend\Tran | {
"filepath": "src/Symfony/Component/Mailer/Transport.php",
"language": "php",
"file_size": 8211,
"cut_index": 716,
"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\ErrorHandler\ErrorRenderer;
use Symfony\Component\ErrorH... | bl://open?url=file://%f&line=%l',
'phpstorm' => 'phpstorm://open?file=%f&line=%l',
'atom' => 'atom://core/open/file?filename=%f&line=%l',
'vscode' => 'vscode://file/%f:%l',
];
/**
* Renders a Throwable as a FlattenExce | blic const IDE_LINK_FORMATS = [
'textmate' => 'txmt://open?url=file://%f&line=%l',
'macvim' => 'mvim://open?url=file://%f&line=%l',
'emacs' => 'emacs://open?url=file://%f&line=%l',
'sublime' => 'su | {
"filepath": "src/Symfony/Component/ErrorHandler/ErrorRenderer/ErrorRendererInterface.php",
"language": "php",
"file_size": 1086,
"cut_index": 515,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\ErrorHandler\Tests\ErrorEnhancer;
use Composer\Autoload\ClassLoader as ComposerClassLoader;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\DebugClassLoader;
use Symfony\Component\ErrorHandle... | // get class loaders wrapped by DebugClassLoader
if ($function[0] instanceof DebugClassLoader) {
$function = $function[0]->getClassLoader();
if (!\is_array($function)) {
continue;
| est extends TestCase
{
public static function setUpBeforeClass(): void
{
foreach (spl_autoload_functions() as $function) {
if (!\is_array($function)) {
continue;
}
| {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/ErrorEnhancer/ClassNotFoundErrorEnhancerTest.php",
"language": "php",
"file_size": 7702,
"cut_index": 716,
"middle_length": 229
} |
ErrorHandler;
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
use Symfony\Component\ErrorHandler\Tests\Fixtures\ErrorHandlerThatUsesThePreviousOne;
use Symfony\Component\ErrorHandler\Tests\Fixtures\LoggerThatSetAnErrorHandler;
/**
* ErrorHandlerTest.
*
* @author Robert Schönthal <seroscho@googlem... | Handler::class, $handler);
$this->assertSame($handler, ErrorHandler::register());
$newHandler = new ErrorHandler();
$this->assertSame($handler, ErrorHandler::register($newHandler, false));
$h = set_error_ha | ::class, 'exitCode');
$r->setValue(null, 0);
}
#[WithoutErrorHandler]
public function testRegister()
{
$handler = ErrorHandler::register();
try {
$this->assertInstanceOf(Error | {
"filepath": "src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php",
"language": "php",
"file_size": 29810,
"cut_index": 1331,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\Exception\InvalidAr... | rts([
'foo' => $foo = $this->createMock(TransportInterface::class),
'bar' => $bar = $this->createMock(TransportInterface::class),
]);
$foo->expects($this->once())->method('send');
$bar->expects($this->never( | mponent\Mime\Header\Headers;
use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\Part\TextPart;
class TransportsTest extends TestCase
{
public function testDefaultTransport()
{
$transport = new Transpo | {
"filepath": "src/Symfony/Component/Mailer/Tests/Transport/TransportsTest.php",
"language": "php",
"file_size": 2995,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\MailPace\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\HttpTransportException;
use Symfony\Component\Mailer\Header\TagHea... | ort@mailpace.com>
*/
final class MailPaceApiTransport extends AbstractApiTransport
{
private const HOST = 'app.mailpace.com/api/v1';
public function __construct(
#[\SensitiveParameter] private string $key,
?HttpClientInterface $cl | gExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @author Paul Oms <supp | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailPace/Transport/MailPaceApiTransport.php",
"language": "php",
"file_size": 5569,
"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\Mailer\Bridge\MailPace\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerIn... | sitiveParameter] string $id, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null)
{
parent::__construct('smtp.mailpace.com', 587, false, $dispatcher, $logger);
$this->setUsername($id);
$this->setPasswo | ort;
use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\RawMessage;
/**
* @author Paul Oms <support@mailpace.com>
*/
final class MailPaceSmtpTransport extends EsmtpTransport
{
public function __construct(#[\Sen | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailPace/Transport/MailPaceSmtpTransport.php",
"language": "php",
"file_size": 2074,
"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\Mailer\Bridge\MailPace\Transport;
use Symfony\Component\Mailer\Exception\Unsup... | if ('mailpace+api' === $scheme) {
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
$port = $dsn->getPort();
return (new MailPaceApiTransport($this->getUser($dsn), $this->client, $this->dispatcher, $thi | /**
* @author Paul Oms <support@mailpace.com>
*/
final class MailPaceTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
$scheme = $dsn->getScheme();
| {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailPace/Transport/MailPaceTransportFactory.php",
"language": "php",
"file_size": 1539,
"cut_index": 537,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\MailPace\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\HttpCli... | TestCase
{
#[DataProvider('getTransportData')]
public function testToString(MailPaceApiTransport $transport, string $expected)
{
$this->assertSame($expected, (string) $transport);
}
public static function getTransportData(): ar | ortException;
use Symfony\Component\Mailer\Header\TagHeader;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Contracts\HttpClient\ResponseInterface;
final class MailPaceApiTransportTest extends | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailPace/Tests/Transport/MailPaceApiTransportTest.php",
"language": "php",
"file_size": 7224,
"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\Mailer\Bridge\MailPace\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Sy... | od = new \ReflectionMethod(MailPaceSmtpTransport::class, 'addMailPaceHeaders');
$method->invoke($transport, $email);
$this->assertCount(1, $email->getHeaders()->toArray());
$this->assertSame('foo: bar', $email->getHeaders()->get('F | extends TestCase
{
public function testCustomHeader()
{
$email = new Email();
$email->getHeaders()->addTextHeader('foo', 'bar');
$transport = new MailPaceSmtpTransport('ACCESS_KEY');
$meth | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailPace/Tests/Transport/MailPaceSmtpTransportTest.php",
"language": "php",
"file_size": 1808,
"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\Mailer\Bridge\MailPace\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Mailer\Bridge\MailPa... | terface;
final class MailPaceTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function getFactory(): TransportFactoryInterface
{
return new MailPaceTransportFactory(null, new MockHttpC | ;
use Symfony\Component\Mailer\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Mailer\Test\IncompleteDsnTestTrait;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\TransportFactoryIn | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailPace/Tests/Transport/MailPaceTransportFactoryTest.php",
"language": "php",
"file_size": 3104,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\MailerSend\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpClient\Exception\JsonException;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\HttpTr... | 1/email.html
*/
final class MailerSendApiTransport extends AbstractApiTransport
{
public function __construct(
#[\SensitiveParameter] private string $key,
?HttpClientInterface $client = null,
?EventDispatcherInterface $dispatch | se Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @see https://developers.mailersend.com/api/v | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/Transport/MailerSendApiTransport.php",
"language": "php",
"file_size": 5482,
"cut_index": 716,
"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\Mailer\Bridge\MailerSend\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
us... | ameter] string $password, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null)
{
parent::__construct('smtp.mailersend.net', 587, false, $dispatcher, $logger);
$this->setUsername($username);
$this->setP | nction __construct(string $username, #[\SensitivePar | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/Transport/MailerSendSmtpTransport.php",
"language": "php",
"file_size": 883,
"cut_index": 547,
"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\Mailer\Bridge\MailerSend\Transport;
use Symfony\Component\Mailer\... | 'mailersend+api' => (new MailerSendApiTransport($this->getUser($dsn), $this->client, $this->dispatcher, $this->logger))
->setHost('default' === $dsn->getHost() ? null : $dsn->getHost())
->setPort($dsn->getPort()),
| ortInterface;
/**
* @author Yann LUCAS
*/
final class MailerSendTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
return match ($dsn->getScheme()) {
| {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/Transport/MailerSendTransportFactory.php",
"language": "php",
"file_size": 1430,
"cut_index": 524,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\MailerSend\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\HttpC... | tData')]
public function testToString(MailerSendApiTransport $transport, string $expected)
{
$this->assertSame($expected, (string) $transport);
}
public static function getTransportData()
{
yield [
new Maile | nt\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Part\DataPart;
use Symfony\Contracts\HttpClient\ResponseInterface;
class MailerSendApiTransportTest extends TestCase
{
#[DataProvider('getTranspor | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Transport/MailerSendApiTransportTest.php",
"language": "php",
"file_size": 7791,
"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\Mailer\Bridge\MailerSend\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Mailer\Bridge\Mail... | sportFactoryInterface;
class MailerSendTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function getFactory(): TransportFactoryInterface
{
return new MailerSendTransportFactory(null, n | ansportFactory;
use Symfony\Component\Mailer\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Mailer\Test\IncompleteDsnTestTrait;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\Tran | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Transport/MailerSendTransportFactoryTest.php",
"language": "php",
"file_size": 3071,
"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\Mailer\Bridge\MailerSend\Tests\Webhook;
use Symfony\Component\HttpFoundation\R... | nds AbstractRequestParserTestCase
{
protected function createRequestParser(): RequestParserInterface
{
$this->expectException(RejectWebhookException::class);
$this->expectExceptionMessage('Signature is required.');
return n | nent\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class MailerSendMissingSignatureRequestParserTest exte | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/MailerSendMissingSignatureRequestParserTest.php",
"language": "php",
"file_size": 1751,
"cut_index": 537,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\MailerSend\Tests\Webhook;
use Symfony\Component\HttpFoundation\R... | estParserTestCase
{
protected function createRequestParser(): RequestParserInterface
{
return new MailerSendRequestParser(new MailerSendPayloadConverter());
}
public function testWebhookTest()
{
$payload = json_encode([ | nent\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class MailerSendRequestParserTest extends AbstractRequ | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/MailerSendRequestParserTest.php",
"language": "php",
"file_size": 1697,
"cut_index": 537,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\MailerSend\Tests\Webhook;
use Symfony\Component\HttpFoundation\R... | rser(): RequestParserInterface
{
return new MailerSendRequestParser(new MailerSendPayloadConverter());
}
public static function getPayloads(): iterable
{
$filename = 'sent.json';
$currentDir = \dirname((new \Reflect | nent\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class MailerSendSignedRequestParserTest extends AbstractRequestParserTestCase
{
protected function createRequestPa | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/MailerSendSignedRequestParserTest.php",
"language": "php",
"file_size": 1759,
"cut_index": 537,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\MailerSend\Tests\Webhook;
use Symfony\Component\HttpFoundation\R... | bstractRequestParserTestCase
{
protected function createRequestParser(): RequestParserInterface
{
$this->expectException(RejectWebhookException::class);
$this->expectExceptionMessage('Signature is wrong.');
return new Maile | nent\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class MailerSendWrongSecretRequestParserTest extends A | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/Tests/Webhook/MailerSendWrongSecretRequestParserTest.php",
"language": "php",
"file_size": 1934,
"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\Mailer\Bridge\MailerSend\RemoteEvent;
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent;
use Symfony\Component\RemoteEvent\Event\Mailer\Ma... | {
if (\in_array($payload['type'], ['activity.sent', 'activity.delivered', 'activity.soft_bounced', 'activity.hard_bounced'], true)) {
$name = match ($payload['type']) {
'activity.sent' => MailerDeliveryEvent::RECEIVED | nverterInterface;
/**
* @author WoutervanderLoop.nl <info@woutervanderloop.nl>
*/
final class MailerSendPayloadConverter implements PayloadConverterInterface
{
public function convert(array $payload): AbstractMailerEvent
| {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/RemoteEvent/MailerSendPayloadConverter.php",
"language": "php",
"file_size": 3982,
"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\Mailer\Bridge\MailerSend\Webhook;
use Symfony\Component\HttpFoundation\ChainRequestMatcher;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Compo... | omponent\Webhook\Client\AbstractRequestParser;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
final class MailerSendRequestParser extends AbstractRequestParser
{
/**
* Fixed secret that is used by MailerSend when doing a webhook. |
use Symfony\Component\Mailer\Bridge\MailerSend\RemoteEvent\MailerSendPayloadConverter;
use Symfony\Component\RemoteEvent\Event\Mailer\AbstractMailerEvent;
use Symfony\Component\RemoteEvent\Exception\ParseException;
use Symfony\C | {
"filepath": "src/Symfony/Component/Mailer/Bridge/MailerSend/Webhook/MailerSendRequestParser.php",
"language": "php",
"file_size": 3204,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Sweego\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Exception\HttpTransportException;
use Symfony\Component\Mailer\Exception\Inval... | ntInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* @author Mathieu Santostefano <msantostefano@proton.me>
*/
final class SweegoApiTransport extends AbstractApiTransport
{
public function __construct(
#[\SensitiveParameter | ;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClie | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Transport/SweegoApiTransport.php",
"language": "php",
"file_size": 5804,
"cut_index": 716,
"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\Mailer\Bridge\Sweego\Transport;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Transpo... | tring $password, ?EventDispatcherInterface $dispatcher = null, ?LoggerInterface $logger = null)
{
parent::__construct($host, $port, true, $dispatcher, $logger);
$this->setUsername($login);
$this->setPassword($password);
}
} | , int $port, string $login, #[\SensitiveParameter] s | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Transport/SweegoSmtpTransport.php",
"language": "php",
"file_size": 915,
"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\Component\Mailer\Bridge\Sweego\Transport;
use Symfony\Component\Mailer\Exce... | h ($dsn->getScheme()) {
'sweego', 'sweego+smtp' => new SweegoSmtpTransport($dsn->getHost(), $dsn->getPort(), $this->getUser($dsn), $this->getPassword($dsn), $this->dispatcher, $this->logger),
'sweego+api' => (new SweegoApiTransport( | nterface;
/**
* @author Mathieu Santostefano <msantostefano@proton.me>
*/
final class SweegoTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
return matc | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Transport/SweegoTransportFactory.php",
"language": "php",
"file_size": 1454,
"cut_index": 524,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Sweego\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Mailer\Br... | ction testToString(SweegoApiTransport $transport, string $expected)
{
$this->assertSame($expected, (string) $transport);
}
public static function getTransportData(): \Generator
{
yield [
new SweegoApiTransport(' | er;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Contracts\HttpClient\ResponseInterface;
class SweegoApiTransportTest extends TestCase
{
#[DataProvider('getTransportData')]
public fun | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Transport/SweegoApiTransportTest.php",
"language": "php",
"file_size": 7028,
"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\Mailer\Bridge\Sweego\Tests\Transport;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpC... | t\Mailer\Transport\TransportFactoryInterface;
class SweegoTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function getFactory(): TransportFactoryInterface
{
return new SweegoTransport | eego\Transport\SweegoTransportFactory;
use Symfony\Component\Mailer\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Mailer\Test\IncompleteDsnTestTrait;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Componen | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Transport/SweegoTransportFactoryTest.php",
"language": "php",
"file_size": 2940,
"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\Mailer\Bridge\Sweego\Tests\Webhook;
use Symfony\Component\H... | uestParserInterface
{
return new SweegoRequestParser(new SweegoPayloadConverter());
}
protected function createRequest(string $payload): Request
{
return Request::create('/', 'POST', [], [], [], [
'Content-Type' | ent\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class SweegoRequestParserTest extends AbstractRequestParserTestCase
{
protected function createRequestParser(): Req | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Webhook/SweegoRequestParserTest.php",
"language": "php",
"file_size": 1202,
"cut_index": 518,
"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\Mailer\Bridge\Sweego\Tests\Webhook;
use Symfony\Component\HttpFoundation\Reque... | erface
{
return new SweegoRequestParser(new SweegoPayloadConverter());
}
public static function getPayloads(): iterable
{
$filename = 'delivered.json';
$currentDir = \dirname((new \ReflectionClass(static::class))->g | RequestParserInterface;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class SweegoSignedRequestParserTest extends AbstractRequestParserTestCase
{
protected function createRequestParser(): RequestParserInt | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Webhook/SweegoSignedRequestParserTest.php",
"language": "php",
"file_size": 1746,
"cut_index": 537,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Mailer\Bridge\Sweego\Tests\Webhook;
use Symfony\Component\HttpFoundation\Reque... | estCase
{
protected function createRequestParser(): RequestParserInterface
{
$this->expectException(RejectWebhookException::class);
$this->expectExceptionMessage('Invalid signature.');
return new SweegoRequestParser(new Swe | RequestParserInterface;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class SweegoWrongSignatureRequestParserTest extends AbstractRequestParserT | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Webhook/SweegoWrongSignatureRequestParserTest.php",
"language": "php",
"file_size": 1914,
"cut_index": 537,
"middle_length": 229
} |
<?php
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent;
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::DELIVERED, 'd4fbec9d-eed9-44d5-af47-c1126467a5ca', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true));
$wh->setRecipientEmail('recipient@example.com');
$wh->setMetada... | 95953862',
'x-originating-ip' => 'XXX.XXX.XXX.XX',
'x-email-id' => '23',
'x-transaction-id' => 'd4fbec9d-eed9-44d5-af47-c1126467a5ca',
]);
$wh->setDate(\DateTimeImmutable::createFromFormat(\DATE_ATOM, '2024-08-15T16:05:59+00:00'));
return $wh; | 0c8cc711c85e45 | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Webhook/Fixtures/delivered.php",
"language": "php",
"file_size": 783,
"cut_index": 512,
"middle_length": 14
} |
nent\RemoteEvent\Event\Mailer\MailerEngagementEvent;
$wh = new MailerEngagementEvent(MailerEngagementEvent::CLICK, '568c5678-2d03-40f8-89e0-22ffb5cfe63d', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true));
$wh->setRecipientEmail('recipient@example.com');
$wh->setMetadata([
'x-mailer' =>... | n',
'x-campaign-type' => 'default',
'x-originating-ip' => 'XXX.XXX.XXX.XXX',
'x-transaction-id' => '568c5678-2d03-40f8-89e0-22ffb5cfe63d',
]);
$wh->setDate(\DateTimeImmutable::createFromFormat(\DATE_ATOM, '2024-09-02T08:45:05+00:00'));
return | 'fake_campaig | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Webhook/Fixtures/email_clicked.php",
"language": "php",
"file_size": 811,
"cut_index": 536,
"middle_length": 14
} |
nent\RemoteEvent\Event\Mailer\MailerEngagementEvent;
$wh = new MailerEngagementEvent(MailerEngagementEvent::OPEN, '69b90094-872f-4250-97d5-515ac7114b1b', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true));
$wh->setRecipientEmail('recipient@example.com');
$wh->setMetadata([
'x-mailer' => ... | ',
'x-campaign-type' => 'default',
'x-originating-ip' => 'XXX.XXX.XXX.XXX',
'x-transaction-id' => '69b90094-872f-4250-97d5-515ac7114b1b',
]);
$wh->setDate(\DateTimeImmutable::createFromFormat(\DATE_ATOM, '2024-09-02T08:45:05+00:00'));
return $ | 'fake_campaign | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Webhook/Fixtures/email_opened.php",
"language": "php",
"file_size": 810,
"cut_index": 536,
"middle_length": 14
} |
use Symfony\Component\RemoteEvent\Event\Mailer\MailerDeliveryEvent;
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::RECEIVED, '8a3bf3ee-1863-4a02-906d-2e6494914ddb', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true));
$wh->setRecipientEmail('recipient@example.com');
$wh->setMetadata([
... | 44166sj',
'x-originating-ip' => '185.255.28.207',
'x-email-id' => '23',
'x-transaction-id' => '8a3bf3ee-1863-4a02-906d-2e6494914ddb',
]);
$wh->setDate(\DateTimeImmutable::createFromFormat(\DATE_ATOM, '2024-09-02T08:45:05+00:00'));
return $wh;
| 5e45b791894566 | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Webhook/Fixtures/email_sent.php",
"language": "php",
"file_size": 788,
"cut_index": 518,
"middle_length": 14
} |
Mailer\MailerDeliveryEvent;
$wh = new MailerDeliveryEvent(MailerDeliveryEvent::BOUNCE, '8dea05e7-9e8b-43d7-b000-3f7d15304162', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true));
$wh->setRecipientEmail('recipient@example.com');
$wh->setMetadata([
'x-swg-uid' => '01-68d20f85-253e-4986-b7f... | ref' => '895000#N',
'x-campaign-id' => 'b205d7b6-9eb5-4ba7-b3b9-5e2b8cade053',
'x-transaction-id' => '8dea05e7-9e8b-43d7-b000-3f7d15304162',
]);
$wh->setDate(\DateTimeImmutable::createFromFormat(\DATE_ATOM, '2024-08-20T08:48:35+00:00'));
return $w | iginating-ip' => 'XXX.XXX.XXX.XXX',
'x-campaign- | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Webhook/Fixtures/hard_bounce.php",
"language": "php",
"file_size": 870,
"cut_index": 559,
"middle_length": 52
} |
EngagementEvent(MailerEngagementEvent::UNSUBSCRIBE, '861aad97-e4e8-4aaf-9322-1b64835760b9', json_decode(file_get_contents(str_replace('.php', '.json', __FILE__)), true));
$wh->setRecipientEmail('recipient@example.com');
$wh->setMetadata([
'x-campaign-id' => '42',
'x-campaign-tags' => 'billing',
'x-campaign-... | -ref-3' => 'o10icr',
'x-swg-uid' => '02-589edd0e-b7f2-4a1d-a3ea-a333cb9aabc0',
'x-transaction-id' => '861aad97-e4e8-4aaf-9322-1b64835760b9',
]);
$wh->setDate(\DateTimeImmutable::createFromFormat(\DATE_ATOM, '2024-09-02T12:55:09+00:00'));
return $w | ef-1' => '643524',
'x-ref-2' => 'lervcn',
'x | {
"filepath": "src/Symfony/Component/Mailer/Bridge/Sweego/Tests/Webhook/Fixtures/list_unsub.php",
"language": "php",
"file_size": 917,
"cut_index": 606,
"middle_length": 52
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.