prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
?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\Notifier\Bridge\Matrix\Tests;
use PHPUnit\Framework\Te... | 'm.text', 'format' => 'org.matrix.custom.html'], $options->toArray());
}
public function testGetRecipientId()
{
$options = new MatrixOptions([
'recipient_id' => '@testuser:matrix.io',
]);
$this->assertSame( | 'recipient_id' => '@testuser:matrix.io',
'msgtype' => 'm.text',
'format' => 'org.matrix.custom.html',
]);
$this->assertSame(['recipient_id' => '@testuser:matrix.io', 'msgtype' => | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Matrix/Tests/MatrixOptionsTest.php",
"language": "php",
"file_size": 1058,
"cut_index": 513,
"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\Notifier\Bridge\Matrix\Tests;
use Symfony\Component\Notifier\Bridge\Matrix\Mat... | vider(): iterable
{
yield [
'matrix://host.test',
'matrix://host.test/?accessToken=1234',
];
yield [
'matrix://host.test:8008',
'matrix://host.test:8008/?accessToken=1234',
| xtends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): MatrixTransportFactory
{
return new MatrixTransportFactory();
}
public static function createPro | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Matrix/Tests/MatrixTransportFactoryTest.php",
"language": "php",
"file_size": 1847,
"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\Notifier\Bridge\PagerDuty;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Comp... | mfony\Contracts\HttpClient\HttpClientInterface;
/**
* @author Joseph Bielawski <stloyd@gmail.com>
*/
final class PagerDutyTransport extends AbstractTransport
{
protected const HOST = 'events.pagerduty.com';
public function __construct(
| ifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Sy | {
"filepath": "src/Symfony/Component/Notifier/Bridge/PagerDuty/PagerDutyTransport.php",
"language": "php",
"file_size": 2976,
"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\Notifier\Bridge\PagerDuty;
use Symfony\Component\Notifier\Exception\Incomplete... | ();
if ('pagerduty' !== $scheme) {
throw new UnsupportedSchemeException($dsn, 'pagerduty', $this->getSupportedSchemes());
}
$apiToken = $this->getUser($dsn);
$host = $this->getHost($dsn);
return (new P | sn;
/**
* @author Joseph Bielawski <stloyd@gmail.com>
*/
final class PagerDutyTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): PagerDutyTransport
{
$scheme = $dsn->getScheme | {
"filepath": "src/Symfony/Component/Notifier/Bridge/PagerDuty/PagerDutyTransportFactory.php",
"language": "php",
"file_size": 1644,
"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\Notifier\Bridge\Termii\Tests;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpCli... | DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
final class TermiiTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = n | validArgumentException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\ | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Termii/Tests/TermiiTransportTest.php",
"language": "php",
"file_size": 4158,
"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\Notifier\Bridge\SmsBiuras;
use Symfony\Component\Notifier\Excepti... | throw new UnsupportedSchemeException($dsn, 'smsbiuras', $this->getSupportedSchemes());
}
$uid = $this->getUser($dsn);
$apiKey = $this->getPassword($dsn);
$from = $dsn->getRequiredOption('from');
$testMode = $dsn->g |
*/
final class SmsBiurasTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): SmsBiurasTransport
{
$scheme = $dsn->getScheme();
if ('smsbiuras' !== $scheme) {
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/SmsBiuras/SmsBiurasTransportFactory.php",
"language": "php",
"file_size": 1389,
"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\Notifier\Bridge\SmsBiuras\Tests;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\Ht... |
use Symfony\Contracts\HttpClient\ResponseInterface;
final class SmsBiurasTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null): SmsBiurasTransport
{
return new SmsBiurasTrans | Message;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface; | {
"filepath": "src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportTest.php",
"language": "php",
"file_size": 2735,
"cut_index": 563,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\GoIp;
use Symfony\Component\Notifier\Message\MessageOptionsInterface;
/**
* @author Ahmed Ghanem <ahmedghanem7361@gmail.com>
*/
... | ull;
}
/**
* @return $this
*/
public function setSimSlot(int $simSlot): static
{
$this->options['simSlot'] = $simSlot;
return $this;
}
public function getSimSlot(): ?int
{
return $this->optio | ion getRecipientId(): ?string
{
return n | {
"filepath": "src/Symfony/Component/Notifier/Bridge/GoIp/GoIpOptions.php",
"language": "php",
"file_size": 945,
"cut_index": 606,
"middle_length": 52
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\GoIp\Tests;
use Symfony\Component\Notifier\Bridge\GoIp\GoIpTra... | ait;
public static function createProvider(): iterable
{
yield [
'goip://host.test:9000?sim_slot=31',
'goip://user:pass@host.test:9000?sim_slot=31',
];
}
public static function supportsProvider(): i | iredOptionTestTrait;
/**
* @author Ahmed Ghanem <ahmedghanem7361@gmail.com>
*/
final class GoIpTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTr | {
"filepath": "src/Symfony/Component/Notifier/Bridge/GoIp/Tests/GoIpTransportFactoryTest.php",
"language": "php",
"file_size": 1772,
"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\Notifier\Bridge\Twitter;
use Symfony\Component\Mime\Part\File;
use Symfony\Component\Notifier\Message\MessageOptionsInterface;
/**
* @author Nicolas Grek... | return null;
}
/**
* @param string[] $choices
*
* @return $this
*/
public function poll(array $choices, int $duration): static
{
$this->options['poll'] = [
'options' => $choices,
'duratio | ;
public function __construct(
private array $options = [],
) {
}
public function toArray(): array
{
return $this->options;
}
public function getRecipientId(): ?string
{
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Twitter/TwitterOptions.php",
"language": "php",
"file_size": 4305,
"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\Notifier\Bridge\Matrix;
use Symfony\Component\Notifier\Exce... | n, 'matrix', $this->getSupportedSchemes());
}
$token = $dsn->getRequiredOption('accessToken');
$host = $dsn->getHost();
$port = $dsn->getPort();
$ssl = $dsn->getBooleanOption('ssl', true);
return (new Matri | e>
*/
class MatrixTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): MatrixTransport
{
if ('matrix' !== $dsn->getScheme()) {
throw new UnsupportedSchemeException($ds | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Matrix/MatrixTransportFactory.php",
"language": "php",
"file_size": 1196,
"cut_index": 518,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\PagerDuty;
use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Message\MessageOptionsInterfac... | );
}
if (!\in_array($severity, ['critical', 'warning', 'error', 'info'], true)) {
throw new InvalidArgumentException('Invalid "severity" option given.');
}
if ($this->options['payload']['timestamp'] ?? null) {
| tion, string $severity, private array $options = [])
{
if (!\in_array($eventAction, ['trigger', 'acknowledge', 'resolve'], true)) {
throw new InvalidArgumentException('Invalid "event_action" option given.' | {
"filepath": "src/Symfony/Component/Notifier/Bridge/PagerDuty/PagerDutyOptions.php",
"language": "php",
"file_size": 3076,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\ClickSend\Tests;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Notifier\Bridge\ClickSend\ClickSendOptions;
use Sy... | ts\HttpClient\ResponseInterface;
final class ClickSendTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null, ?string $from = 'test_from', ?string $source = 'test_source', ?int $listId = 99 | \Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contrac | {
"filepath": "src/Symfony/Component/Notifier/Bridge/ClickSend/Tests/ClickSendTransportTest.php",
"language": "php",
"file_size": 5411,
"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\Notifier\Bridge\SmsBiuras\Tests;
use Symfony\Component\Notifier\Bridge\SmsBiuras\SmsBiurasTransportFacto... | ry
{
return new SmsBiurasTransportFactory();
}
public static function createProvider(): iterable
{
yield [
'smsbiuras://host.test?from=0611223344',
'smsbiuras://uid:api_key@host.test?from=0611223344& | estTrait;
final class SmsBiurasTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;
public function createFactory(): SmsBiurasTransportFacto | {
"filepath": "src/Symfony/Component/Notifier/Bridge/SmsBiuras/Tests/SmsBiurasTransportFactoryTest.php",
"language": "php",
"file_size": 2052,
"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\Notifier\Bridge\Twitter\Tests;
use Symfony\Component\Notifier\Bri... | ion createProvider(): iterable
{
yield ['twitter://host.test', 'twitter://A:B:C:D@host.test'];
}
public static function supportsProvider(): iterable
{
yield [true, 'twitter://default'];
yield [false, 'somethingElse: | ctoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): TwitterTransportFactory
{
return new TwitterTransportFactory();
}
public static funct | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Twitter/Tests/TwitterTransportFactoryTest.php",
"language": "php",
"file_size": 1335,
"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\Notifier\Bridge\Matrix\Tests;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Not... | face;
final class MatrixTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null, ?bool $ssl = false): MatrixTransport
{
return new MatrixTransport('apiKey', $ssl, $client ?? new | \ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInter | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Matrix/Tests/MatrixTransportTest.php",
"language": "php",
"file_size": 2302,
"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\Notifier\Bridge\SmsBiuras;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeExce... |
* @author Vasilij Duško <vasilij@prado.lt>
*/
final class SmsBiurasTransport extends AbstractTransport
{
protected const HOST = 'savitarna.smsbiuras.lt';
private const ERROR_CODES = [
1 => 'The message was processed and sent to the mobi | ifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/** | {
"filepath": "src/Symfony/Component/Notifier/Bridge/SmsBiuras/SmsBiurasTransport.php",
"language": "php",
"file_size": 4402,
"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\Notifier\Bridge\Unifonic;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeExcep... | * @author Farhad Safarov <farhad.safarov@gmail.com>
*/
final class UnifonicTransport extends AbstractTransport
{
protected const HOST = 'el.cloud.unifonic.com';
public function __construct(
#[\SensitiveParameter] private readonly string | fier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Unifonic/UnifonicTransport.php",
"language": "php",
"file_size": 3098,
"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\Notifier\Bridge\PagerDuty\Tests;
use Symfony\Component\HttpClient\MockHttpClie... | Contracts\HttpClient\HttpClientInterface;
final class PagerDutyTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null): PagerDutyTransport
{
return (new PagerDutyTransport('test | e Symfony\Component\Notifier\Message\PushMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\ | {
"filepath": "src/Symfony/Component/Notifier/Bridge/PagerDuty/Tests/PagerDutyTransportTest.php",
"language": "php",
"file_size": 1892,
"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\Notifier\Bridge\Unifonic\Tests;
use Symfony\Component\Notifier\Bridge\Unifonic... | on createProvider(): iterable
{
yield [
'unifonic://host.test?from=Sender',
'unifonic://s3cr3t@host.test?from=Sender',
];
yield [
'unifonic://host.test',
'unifonic://s3cr3t@host.te | ryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): UnifonicTransportFactory
{
return new UnifonicTransportFactory();
}
public static functi | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Unifonic/Tests/UnifonicTransportFactoryTest.php",
"language": "php",
"file_size": 1671,
"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\Notifier\Bridge\Unifonic\Tests;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Co... | sponseInterface;
final class UnifonicTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null, ?string $host = null): UnifonicTransport
{
return (new UnifonicTransport('S3cr3t', ' | ier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\Re | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Unifonic/Tests/UnifonicTransportTest.php",
"language": "php",
"file_size": 3260,
"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\Notifier\Bridge\Sipgate;
use Symfony\Component\Notifier\Exception... | n($dsn, 'sipgate', $this->getSupportedSchemes());
}
$tokenId = $this->getUser($dsn);
$token = $this->getPassword($dsn);
$senderId = $dsn->getRequiredOption('senderId');
$host = 'default' === $dsn->getHost() ? null : | */
final class SipgateTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): SipgateTransport
{
if ('sipgate' !== $dsn->getScheme()) {
throw new UnsupportedSchemeExceptio | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Sipgate/SipgateTransportFactory.php",
"language": "php",
"file_size": 1296,
"cut_index": 524,
"middle_length": 229
} |
mfony\Component\Mime\Part\File;
use Symfony\Component\Notifier\Bridge\Twitter\TwitterOptions;
use Symfony\Component\Notifier\Bridge\Twitter\TwitterTransport;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use ... | vider(): iterable
{
yield ['twitter://api.twitter.com', self::createTransport()];
}
public static function supportedMessagesProvider(): iterable
{
yield [new ChatMessage('Hello!')];
}
public static function unsuppo | n createTransport(?HttpClientInterface $client = null): TwitterTransport
{
return new TwitterTransport('APIK', 'APIS', 'TOKEN', 'SECRET', $client ?? new MockHttpClient());
}
public static function toStringPro | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Twitter/Tests/TwitterTransportTest.php",
"language": "php",
"file_size": 9899,
"cut_index": 921,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\PagerDuty\Tests;
use Symfony\Component\Notifier\Bridge\PagerDu... | function createProvider(): iterable
{
yield [
'pagerduty://subdomain.pagerduty.com',
'pagerduty://token@subdomain.pagerduty.com',
];
yield [
'pagerduty://subdomain.eu.pagerduty.com',
| actoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): PagerDutyTransportFactory
{
return new PagerDutyTransportFactory();
}
public static | {
"filepath": "src/Symfony/Component/Notifier/Bridge/PagerDuty/Tests/PagerDutyTransportFactoryTest.php",
"language": "php",
"file_size": 1566,
"cut_index": 537,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Unifonic;
use Symfony\Component\Notifier\Ex... | ortedSchemeException($dsn, 'unifonic', $this->getSupportedSchemes());
}
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
return (new UnifonicTransport(
$this->getUser($dsn),
$dsn->getOption(' | rov@gmail.com>
*/
final class UnifonicTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): UnifonicTransport
{
if ('unifonic' !== $dsn->getScheme()) {
throw new Unsupp | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Unifonic/UnifonicTransportFactory.php",
"language": "php",
"file_size": 1225,
"cut_index": 518,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Sipgate;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeExcept... | * @author Lukas Kaltenbach <lk@wikanet.de>
*/
final class SipgateTransport extends AbstractTransport
{
protected const HOST = 'api.sipgate.com';
public function __construct(
private string $tokenId,
#[\SensitiveParameter] private | ier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Sipgate/SipgateTransport.php",
"language": "php",
"file_size": 3513,
"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\Notifier\Bridge\Sipgate\Tests;
use Symfony\Component\Notifier\Bridge\Sipgate\S... | vider(): iterable
{
yield [
'sipgate://host.test?senderId=s1',
'sipgate://tokenId:token@host.test?senderId=s1',
];
}
public static function supportsProvider(): iterable
{
yield [true, 'sipgat | ends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): SipgateTransportFactory
{
return new SipgateTransportFactory();
}
public static function createPro | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Sipgate/Tests/SipgateTransportFactoryTest.php",
"language": "php",
"file_size": 1570,
"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\Notifier\Bridge\GoIp;
use Symfony\Component\Notifier\Exception\InvalidArgument... | if (self::SCHEME_NAME !== $dsn->getScheme()) {
throw new UnsupportedSchemeException($dsn, self::SCHEME_NAME, $this->getSupportedSchemes());
}
$username = $this->getUser($dsn);
$password = $this->getPassword($dsn |
/**
* @author Ahmed Ghanem <ahmedghanem7361@gmail.com>
*/
final class GoIpTransportFactory extends AbstractTransportFactory
{
private const SCHEME_NAME = 'goip';
public function create(Dsn $dsn): GoIpTransport
{
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/GoIp/GoIpTransportFactory.php",
"language": "php",
"file_size": 1538,
"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\Notifier\Bridge\Sipgate\Tests;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpCl... | e;
use Symfony\Contracts\HttpClient\HttpClientInterface;
class SipgateTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null): SipgateTransport
{
return new SipgateTransport('to | ChatMessage;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessag | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Sipgate/Tests/SipgateTransportTest.php",
"language": "php",
"file_size": 3197,
"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\Notifier\Bridge\Slack\Block;
final class SlackContextBlock extends AbstractSla... | tf('Maximum number of elements should not exceed %d.', self::ELEMENT_LIMIT));
}
$element = [
'type' => $markdown ? 'mrkdwn' : 'plain_text',
'text' => $text,
];
if ($markdown) {
$element[' | tion text(string $text, bool $markdown = true, bool $emoji = true, bool $verbatim = false): static
{
if (self::ELEMENT_LIMIT === \count($this->options['elements'] ?? [])) {
throw new \LogicException(\sprin | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackContextBlock.php",
"language": "php",
"file_size": 1847,
"cut_index": 537,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Slack\Block;
use Symfony\Component\Notifier\Excep... | MIT));
}
$this->options = [
'type' => 'header',
'text' => [
'type' => 'plain_text',
'text' => $text,
],
];
}
/**
* @return $this
*/
public f | t ID_LIMIT = 255;
public function __construct(string $text)
{
if (\strlen($text) > self::TEXT_LIMIT) {
throw new LengthException(\sprintf('Maximum length for the text is %d characters.', self::TEXT_LI | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackHeaderBlock.php",
"language": "php",
"file_size": 1294,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Twilio\Webhook;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestMatcher\MethodRequestMatcher;
use... | ');
}
protected function doParse(Request $request, #[\SensitiveParameter] string $secret): ?SmsEvent
{
// Statuses: https://www.twilio.com/docs/sms/api/message-resource#message-status-values
// Payload examples: https://www.twi | nt\Webhook\Exception\RejectWebhookException;
final class TwilioRequestParser extends AbstractRequestParser
{
protected function getRequestMatcher(): RequestMatcherInterface
{
return new MethodRequestMatcher('POST | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Twilio/Webhook/TwilioRequestParser.php",
"language": "php",
"file_size": 3326,
"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\Notifier\Bridge\Engagespot;
use Symfony\Component\Notifier\Message\MessageOpti... | urn $this->options;
}
public function getRecipientId(): ?string
{
return $this->options['to'];
}
/**
* @return $this
*/
public function campaignName(string $campaignName): static
{
$this->options['cam | ngagespot-rest-api
*/
final class EngagespotOptions implements MessageOptionsInterface
{
public function __construct(
private array $options = [],
) {
}
public function toArray(): array
{
ret | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Engagespot/EngagespotOptions.php",
"language": "php",
"file_size": 1912,
"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\Notifier\Bridge\Engagespot;
use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Exception\TransportException;... | Interface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
* @author Daniel GORGAN <https://github.com/danut007ro>
*/
final class EngagespotTransport extends AbstractTransport
{
protected const HOST = 'api.engagespot.co/2/campaigns';
| ony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportException | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Engagespot/EngagespotTransport.php",
"language": "php",
"file_size": 4259,
"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\Notifier\Bridge\Engagespot;
use Symfony\Component\Notifier\Except... | me) {
throw new UnsupportedSchemeException($dsn, 'engagespot', $this->getSupportedSchemes());
}
$apiKey = $dsn->getUser();
$campaignName = $dsn->getRequiredOption('campaign_name');
$host = 'default' === $dsn->ge | om/danut007ro>
*/
final class EngagespotTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): EngagespotTransport
{
$scheme = $dsn->getScheme();
if ('engagespot' !== $sche | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Engagespot/EngagespotTransportFactory.php",
"language": "php",
"file_size": 1313,
"cut_index": 524,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Engagespot\Tests;
use Symfony\Component\Notifier\... | ory
{
return new EngagespotTransportFactory();
}
public static function createProvider(): iterable
{
yield [
'engagespot://api.engagespot.co/2/campaigns?campaign_name=TEST',
'engagespot://apiKey@defa | Daniel GORGAN <https://github.com/danut007ro>
*/
final class EngagespotTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): EngagespotTransportFact | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Engagespot/Tests/EngagespotTransportFactoryTest.php",
"language": "php",
"file_size": 1496,
"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\Notifier\Bridge\Engagespot\Tests;
use Symfony\Component\HttpClient\MockHttpCli... | lass EngagespotTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null): EngagespotTransport
{
return new EngagespotTransport('apiKey', 'TEST', $client ?? new MockHttpClient());
| mponent\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
* @author Daniel GORGAN <https://github.com/danut007ro>
*/
final c | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Engagespot/Tests/EngagespotTransportTest.php",
"language": "php",
"file_size": 1517,
"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\Notifier\Bridge\Sendberry;
use Symfony\Component\Notifier\Exception\IncompleteDsnException;
use Symfony\Component\Notifier\Exception\TransportException;
us... | rface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
* @author Vasilij Duško <vasilij@prado.lt>
*/
final class SendberryTransport extends AbstractTransport
{
protected const HOST = 'api.sendberry.com';
public function __construct(
| \Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInte | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Sendberry/SendberryTransport.php",
"language": "php",
"file_size": 3626,
"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\Notifier\Bridge\Sendberry;
use Symfony\Component\Notifier\Excepti... | throw new UnsupportedSchemeException($dsn, 'sendberry', $this->getSupportedSchemes());
}
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
$port = $dsn->getPort();
return (new SendberryTransport($this->getUs |
*/
final class SendberryTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): SendberryTransport
{
$scheme = $dsn->getScheme();
if ('sendberry' !== $scheme) {
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Sendberry/SendberryTransportFactory.php",
"language": "php",
"file_size": 1287,
"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\Notifier\Bridge\Sendberry\Tests;
use Symfony\Component\Notifier\Bridge\Sendber... | ): SendberryTransportFactory
{
return new SendberryTransportFactory();
}
public static function createProvider(): iterable
{
yield [
'sendberry://host.test?from=+0611223344',
'sendberry://user:passwo | est\MissingRequiredOptionTestTrait;
final class SendberryTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;
public function createFactory( | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Sendberry/Tests/SendberryTransportFactoryTest.php",
"language": "php",
"file_size": 1942,
"cut_index": 537,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Sendberry\Tests;
use Symfony\Component\HttpClient... |
public static function createTransport(?HttpClientInterface $client = null): SendberryTransport
{
return new SendberryTransport('username', 'password', 'auth_key', 'from', $client ?? new MockHttpClient());
}
public static function | Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
final class SendberryTransportTest extends TransportTestCase
{ | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Sendberry/Tests/SendberryTransportTest.php",
"language": "php",
"file_size": 1431,
"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\Notifier\Bridge\KazInfoTeh;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeExc... | *
* @author Egor Taranov <dev@taranovegor.com>
*/
class KazInfoTehTransport extends AbstractTransport
{
protected const HOST = 'kazinfoteh.org';
public function __construct(
private string $username,
#[\SensitiveParameter] privat | tifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/* | {
"filepath": "src/Symfony/Component/Notifier/Bridge/KazInfoTeh/KazInfoTehTransport.php",
"language": "php",
"file_size": 3716,
"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\Notifier\Bridge\KazInfoTeh;
use Symfony\Component\Notifier\Except... | >getScheme();
if ('kaz-info-teh' !== $scheme) {
throw new UnsupportedSchemeException($dsn, 'kaz-info-teh', $this->getSupportedSchemes());
}
$username = $this->getUser($dsn);
$password = $this->getPassword($dsn) | ortInterface;
/**
* @author Egor Taranov <dev@taranovegor.com>
*/
final class KazInfoTehTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TransportInterface
{
$scheme = $dsn- | {
"filepath": "src/Symfony/Component/Notifier/Bridge/KazInfoTeh/KazInfoTehTransportFactory.php",
"language": "php",
"file_size": 1415,
"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\Notifier\Bridge\KazInfoTeh\Tests;
use Symfony\Component\Notifier\Bridge\KazInfoTeh\KazInfoTehTransportFa... | public function createFactory(): KazInfoTehTransportFactory
{
return new KazInfoTehTransportFactory();
}
public static function createProvider(): iterable
{
yield [
'kaz-info-teh://kazinfoteh.org:9507?sender=s | onTestTrait;
/**
* @author Egor Taranov <dev@taranovegor.com>
*/
final class KazInfoTehTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/KazInfoTeh/Tests/KazInfoTehTransportFactoryTest.php",
"language": "php",
"file_size": 2208,
"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\Notifier\Bridge\KazInfoTeh\Tests;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Htt... | t\HttpClientInterface;
/**
* @author Egor Taranov <dev@taranovegor.com>
*/
final class KazInfoTehTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null): TransportInterface
{
| \Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Component\Notifier\Transport\TransportInterface;
use Symfony\Contracts\HttpClien | {
"filepath": "src/Symfony/Component/Notifier/Bridge/KazInfoTeh/Tests/KazInfoTehTransportTest.php",
"language": "php",
"file_size": 3722,
"cut_index": 614,
"middle_length": 229
} |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Mattermost;
use Symfony\Component\Not... |
public function toArray(): array
{
$options = $this->options;
unset($options['recipient_id']);
return $options;
}
public function getRecipientId(): ?string
{
return $this->options['recipient_id'] ?? n | onstruct(
private array $options = [],
) {
}
/**
* @return $this
*/
public function recipient(string $id): static
{
$this->options['recipient_id'] = $id;
return $this;
} | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Mattermost/MattermostOptions.php",
"language": "php",
"file_size": 1011,
"cut_index": 512,
"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\Notifier\Bridge\Mattermost;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeExc... | **
* @author Emanuele Panzeri <thepanz@gmail.com>
*/
final class MattermostTransport extends AbstractTransport
{
public function __construct(
#[\SensitiveParameter] private string $token,
private string $channel,
private ?stri | otifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/ | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Mattermost/MattermostTransport.php",
"language": "php",
"file_size": 3214,
"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\Notifier\Bridge\Mattermost;
use Symfony\Component\Notifier\Except... | throw new UnsupportedSchemeException($dsn, 'mattermost', $this->getSupportedSchemes());
}
$path = $dsn->getPath();
$token = $this->getUser($dsn);
$channel = $dsn->getRequiredOption('channel');
$host = $dsn- | .com>
*/
final class MattermostTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): MattermostTransport
{
$scheme = $dsn->getScheme();
if ('mattermost' !== $scheme) {
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Mattermost/MattermostTransportFactory.php",
"language": "php",
"file_size": 1292,
"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\Notifier\Bridge\Mattermost\Tests;
use Symfony\Component\Notifier\Bridge\Mattermost\MattermostTransportFa... | ;
public function createFactory(): MattermostTransportFactory
{
return new MattermostTransportFactory();
}
public static function createProvider(): iterable
{
yield [
'mattermost://host.test?channel=testCha | onTestTrait;
/**
* @author Oskar Stark <oskarstark@googlemail.com>
*/
final class MattermostTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Mattermost/Tests/MattermostTransportFactoryTest.php",
"language": "php",
"file_size": 2399,
"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\Notifier\Bridge\Mattermost\Tests;
use Symfony\Component\HttpClient\MockHttpCli... | attermostTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null): MattermostTransport
{
return (new MattermostTransport('testAccessToken', 'testChannel', null, $client ?? new Moc | mponent\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
* @author Oskar Stark <oskarstark@googlemail.com>
*/
final class M | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Mattermost/Tests/MattermostTransportTest.php",
"language": "php",
"file_size": 1518,
"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\Notifier\Bridge\Isendpro;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeExcep... | nInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
final class IsendproTransport extends AbstractTransport
{
protected const HOST = 'apirest.isendpro.com';
public function __construct(
#[\SensitiveParameter] private string | fier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptio | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Isendpro/IsendproTransport.php",
"language": "php",
"file_size": 4300,
"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\Notifier\Bridge\Isendpro;
use Symfony\Component\Notifier\Exceptio... | );
}
$keyid = $this->getUser($dsn);
$from = $dsn->getOption('from', null);
$noStop = $dsn->getBooleanOption('no_stop');
$sandbox = $dsn->getBooleanOption('sandbox');
$host = 'default' === $dsn->getHost() ? n | tractTransportFactory
{
public function create(Dsn $dsn): IsendproTransport
{
if ('isendpro' !== $dsn->getScheme()) {
throw new UnsupportedSchemeException($dsn, 'isendpro', $this->getSupportedSchemes() | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Isendpro/IsendproTransportFactory.php",
"language": "php",
"file_size": 1308,
"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\Notifier\Bridge\Isendpro\Tests;
use Symfony\Component\Notifier\Bridge\Isendpro\IsendproTransportFactory;... | ble
{
yield [
'isendpro://host.test?no_stop=0&sandbox=0',
'isendpro://account_key_id@host.test',
];
yield [
'isendpro://host.test?from=FROM&no_stop=0&sandbox=0',
'isendpro://accou | nsportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): IsendproTransportFactory
{
return new IsendproTransportFactory();
}
public static function createProvider(): itera | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Isendpro/Tests/IsendproTransportFactoryTest.php",
"language": "php",
"file_size": 2442,
"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\Notifier\Bridge\Isendpro\Tests;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\H... | tInterface;
final class IsendproTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null): IsendproTransport
{
return (new IsendproTransport('accound_key_id', null, false, false, | essage\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClien | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Isendpro/Tests/IsendproTransportTest.php",
"language": "php",
"file_size": 2984,
"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\Notifier\Bridge\AmazonSns;
use AsyncAws\Sns\Input\PublishInput;
use Symfony\Co... | {
return $this->recipient;
}
/**
* @param string $topic The Topic ARN for SNS message
*
* @return $this
*/
public function recipient(string $topic): static
{
$this->recipient = $topic;
return $ | _construct(
private string $recipient,
private array $options = [],
) {
}
public function toArray(): array
{
return $this->options;
}
public function getRecipientId(): ?string
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/AmazonSns/AmazonSnsOptions.php",
"language": "php",
"file_size": 1509,
"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\Notifier\Bridge\AmazonSns;
use AsyncAws\Sns\SnsClient;
use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Ex... | atcherInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
* @author Adrien Chinour <github@chinour.fr>
*/
final class AmazonSnsTransport extends AbstractTransport
{
public function __construct(
private SnsClient $snsClient,
| \MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDisp | {
"filepath": "src/Symfony/Component/Notifier/Bridge/AmazonSns/AmazonSnsTransport.php",
"language": "php",
"file_size": 3130,
"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\Notifier\Bridge\AmazonSns;
use AsyncAws\Sns\SnsClient;
use Symfony\Component\N... | throw new UnsupportedSchemeException($dsn, 'sns', $this->getSupportedSchemes());
}
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
$port = $dsn->getPort();
$protocol = 'disable' === $dsn->getOpti | ithub@chinour.fr>
*/
final class AmazonSnsTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): AmazonSnsTransport
{
$scheme = $dsn->getScheme();
if ('sns' !== $scheme) {
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/AmazonSns/AmazonSnsTransportFactory.php",
"language": "php",
"file_size": 1831,
"cut_index": 537,
"middle_length": 229
} |
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\Component\Notifier\Bridge\AmazonSns\Tests;
use PHPUnit\Framework\Te... | me('my-topic', $options->getRecipientId());
}
public function testToArray()
{
$options = new AmazonSnsOptions('my-topic');
$options->subject('value');
$this->assertSame(['Subject' => 'value'], $options->toArray());
| mazonSnsOptions('my-topic');
$this->assertSa | {
"filepath": "src/Symfony/Component/Notifier/Bridge/AmazonSns/Tests/AmazonSnsOptionsTest.php",
"language": "php",
"file_size": 828,
"cut_index": 516,
"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\Notifier\Bridge\AmazonSns\Tests;
use Symfony\Component\Notifier\Bridge\AmazonS... | n names will bypass default options retrieved by \AsyncAws\Core::get
$_ENV['AWS_PROFILE'] = 'not-existing';
$_ENV['AWS_REGION'] = 'us-east-1';
return new AmazonSnsTransportFactory();
}
public static function createProvider | unction createFactory(): AmazonSnsTransportFactory
{
// Tests will fail if a ~/.aws/config file exists with a default.region value,
// or if AWS_REGION env variable is set.
// Setting a profile & regio | {
"filepath": "src/Symfony/Component/Notifier/Bridge/AmazonSns/Tests/AmazonSnsTransportFactoryTest.php",
"language": "php",
"file_size": 1577,
"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\Notifier\Bridge\AmazonSns\Tests;
use AsyncAws\Sns\Result\PublishResponse;
use AsyncAws\Sns\SnsClient;
use Symfony\Component\HttpClient\MockHttpClient;
use ... | fony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
class AmazonSnsTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null): AmazonSns | ion;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Fixtures\TestOptions;
use Sym | {
"filepath": "src/Symfony/Component/Notifier/Bridge/AmazonSns/Tests/AmazonSnsTransportTest.php",
"language": "php",
"file_size": 3777,
"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\Notifier\Bridge\Chatwork;
/**
* @author Ippei Sumida <ippey.s@gm... | $this->body = $body;
return $this;
}
public function selfUnread(bool $selfUnread): self
{
$this->selfUnread = $selfUnread;
return $this;
}
public function getMessageBody(): array
{
$content = | self
{
if (\is_array($userIds)) {
$this->to = $userIds;
} else {
$this->to = [$userIds];
}
return $this;
}
public function body(string $body): self
{
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Chatwork/ChatworkMessageBodyBuilder.php",
"language": "php",
"file_size": 1262,
"cut_index": 524,
"middle_length": 229
} |
hp
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Chatwork;
use Symfony\Component\Notifier... | */
public function to(array|string $userIds): static
{
$this->options['to'] = $userIds;
return $this;
}
/**
* @return $this
*/
public function selfUnread(bool $selfUnread): static
{
$this->op | te array $options = [],
) {
}
public function toArray(): array
{
return $this->options;
}
public function getRecipientId(): ?string
{
return null;
}
/**
* @return $this
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Chatwork/ChatworkOptions.php",
"language": "php",
"file_size": 1066,
"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\Notifier\Bridge\Chatwork;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\TransportExceptionInterface... | * @author Ippei Sumida <ippey.s@gmail.com>
*/
class ChatworkTransport extends AbstractTransport
{
protected const HOST = 'api.chatwork.com';
public function __construct(
#[\SensitiveParameter] private string $apiToken,
private str | fony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Chatwork/ChatworkTransport.php",
"language": "php",
"file_size": 3309,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Slack\Tests;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Slack\Block\SlackDividerBlock;
use Symfony\Component\Notifier\Bridge\Slack\Block\SlackSectionBlock;
use Symfony... | cted = null)
{
$this->assertSame($expected ?? $options, (new SlackOptions($options))->toArray());
}
public static function toArrayProvider(): iterable
{
yield 'empty is allowed' => [
[],
[],
| skarstark@googlemail.com>
*/
final class SlackOptionsTest extends TestCase
{
#[DataProvider('toArrayProvider')]
#[DataProvider('toArraySimpleOptionsProvider')]
public function testToArray(array $options, ?array $expe | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Tests/SlackOptionsTest.php",
"language": "php",
"file_size": 6751,
"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\Notifier\Bridge\Slack\Tests;
use Symfony\Component\Notifier\Bridge\Slack\Slack... | ): iterable
{
yield [
'slack://host.test',
'slack://xoxb-TestToken@host.test',
];
yield 'with path' => [
'slack://host.test?channel=testChannel',
'slack://xoxb-TestToken@host.test | ds AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): SlackTransportFactory
{
return new SlackTransportFactory();
}
public static function createProvider( | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Tests/SlackTransportFactoryTest.php",
"language": "php",
"file_size": 1759,
"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\Notifier\Bridge\Slack\Tests\Block;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Slack\Block\SlackActionsBlock;
final class SlackA... | n text',
null,
null,
'test-value-4',
[
'title' => [
'type' => 'plain_text',
'text' => 'test-confirm-title-4',
| org', null, 'test-value')
->button('second button text', 'https://example.org/slack', 'danger')
->button('third button text', null, null, 'test-value-3')
->button(
'fourth butto | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Tests/Block/SlackActionsBlockTest.php",
"language": "php",
"file_size": 4258,
"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\Notifier\Bridge\Slack\Tests\Block;
use PHPUnit\Framework\TestCase... | 'type' => 'plain_text',
'text' => 'header text',
],
'block_id' => 'header_id',
], $header->toArray());
}
public function testThrowsWhenTextExceedsCharacterLimit()
{
$this->expectException | function testCanBeInstantiated()
{
$header = new SlackHeaderBlock('header text');
$header->id('header_id');
$this->assertSame([
'type' => 'header',
'text' => [
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Tests/Block/SlackHeaderBlockTest.php",
"language": "php",
"file_size": 1506,
"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\Notifier\Bridge\Slack\Tests\Block;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge... | ection->field('section field in plain text with verbatim', false, true, true);
$section->accessory(new SlackImageBlockElement('https://example.com/image.jpg', 'an image'));
$this->assertSame([
'type' => 'section',
' | tantiated()
{
$section = new SlackSectionBlock();
$section->text('section text');
$section->field('section field');
$section->field('section field with verbatim', true, true, false);
$s | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Tests/Block/SlackSectionBlockTest.php",
"language": "php",
"file_size": 2366,
"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\Notifier\Bridge\Twilio;
use Symfony\Component\Notifier\Exception\... | new UnsupportedSchemeException($dsn, 'twilio', $this->getSupportedSchemes());
}
$accountSid = $this->getUser($dsn);
$authToken = $this->getPassword($dsn);
$from = $dsn->getRequiredOption('from');
$host = 'default' = | m>
*/
final class TwilioTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): TwilioTransport
{
$scheme = $dsn->getScheme();
if ('twilio' !== $scheme) {
throw | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Twilio/TwilioTransportFactory.php",
"language": "php",
"file_size": 1324,
"cut_index": 524,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Twilio\Tests;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Notifier\Bridge\Twilio\TwilioTransport;
use Symfony\C... | ransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null, string $from = 'from'): TwilioTransport
{
return new TwilioTransport('accountSid', 'authToken', $from, $client ?? new MockHttpClient());
}
| \TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
final class TwilioTransportTest extends T | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Twilio/Tests/TwilioTransportTest.php",
"language": "php",
"file_size": 5262,
"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\Notifier\Bridge\SmsFactor;
use Symfony\Component\Notifier\Exception\Unsupporte... | throw new UnsupportedSchemeException($dsn, 'sms-factor', $this->getSupportedSchemes());
}
$tokenApi = $this->getUser($dsn);
$sender = $dsn->getOption('sender');
$pushType = $this->getPushType($dsn);
$host = 'de | m>
*/
final class SmsFactorTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): SmsFactorTransport
{
$scheme = $dsn->getScheme();
if ('sms-factor' !== $scheme) {
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/SmsFactor/SmsFactorTransportFactory.php",
"language": "php",
"file_size": 1606,
"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\Notifier\Bridge\SmsFactor\Tests;
use Symfony\Component\Notifier\Bridge\SmsFact... | function createProvider(): iterable
{
yield [
'sms-factor://api.smsfactor.com?sender=MyCompany&push_type=alert',
'sms-factor://TOKEN@default?push_type=alert&sender=MyCompany',
];
yield [
'sms- | actoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): SmsFactorTransportFactory
{
return new SmsFactorTransportFactory();
}
public static | {
"filepath": "src/Symfony/Component/Notifier/Bridge/SmsFactor/Tests/SmsFactorTransportFactoryTest.php",
"language": "php",
"file_size": 1957,
"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\Notifier\Bridge\SmsFactor\Tests;
use Symfony\Component\HttpClient\MockHttpClie... | ass SmsFactorTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null): SmsFactorTransport
{
return (new SmsFactorTransport('TOKEN', 'MY_COMPANY', SmsFactorPushType::Alert, $client | se Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
final cl | {
"filepath": "src/Symfony/Component/Notifier/Bridge/SmsFactor/Tests/SmsFactorTransportTest.php",
"language": "php",
"file_size": 1557,
"cut_index": 537,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\RocketChat;
use Symfony\Component\Notifier\Except... |
throw new UnsupportedSchemeException($dsn, 'rocketchat', $this->getSupportedSchemes());
}
$accessToken = $this->getUser($dsn);
$channel = $dsn->getOption('channel');
$host = 'default' === $dsn->getHost() ? null | /Jeroeny>
*/
final class RocketChatTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): RocketChatTransport
{
$scheme = $dsn->getScheme();
if ('rocketchat' !== $scheme) { | {
"filepath": "src/Symfony/Component/Notifier/Bridge/RocketChat/RocketChatTransportFactory.php",
"language": "php",
"file_size": 1299,
"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\Notifier\Bridge\RocketChat\Tests;
use Symfony\Component\Notifier\Bridge\Rocket... | eturn new RocketChatTransportFactory();
}
public static function createProvider(): iterable
{
yield [
'rocketchat://host.test?channel=testChannel',
'rocketchat://accessToken@host.test?channel=testChannel',
| oskarstark@googlemail.com>
*/
final class RocketChatTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): RocketChatTransportFactory
{
r | {
"filepath": "src/Symfony/Component/Notifier/Bridge/RocketChat/Tests/RocketChatTransportFactoryTest.php",
"language": "php",
"file_size": 1546,
"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\Notifier\Bridge\RocketChat\Tests;
use Symfony\Component\HttpClient\MockHttpCli... | ocketChatTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null, ?string $channel = null): RocketChatTransport
{
return new RocketChatTransport('testAccessToken', $channel, $clie | mponent\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
* @author Oskar Stark <oskarstark@googlemail.com>
*/
final class R | {
"filepath": "src/Symfony/Component/Notifier/Bridge/RocketChat/Tests/RocketChatTransportTest.php",
"language": "php",
"file_size": 1604,
"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\Notifier\Bridge\Slack;
use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Exception\TransportException;
use ... | erface;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
final class SlackTransport extends AbstractTransport
{
protected const HOST = 'slack.com';
public function __construct(
#[\SensitiveParameter] private string $accessToken,
| omponent\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInt | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/SlackTransport.php",
"language": "php",
"file_size": 4177,
"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\Notifier\Bridge\Slack\Block;
/**
* @author Fabien Potencie... | {
throw new \LogicException('Maximum number of buttons should not exceed 25.');
}
$element = new SlackButtonBlockElement($text, $url, $style, $value, $confirm);
$this->options['elements'][] = $element->toArray();
| @return $this
*/
public function button(string $text, ?string $url = null, ?string $style = null, ?string $value = null, ?array $confirm = null): static
{
if (25 === \count($this->options['elements'] ?? [])) | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackActionsBlock.php",
"language": "php",
"file_size": 1187,
"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\Notifier\Bridge\Slack\Block;
/**
* @author Fabien Potencier <fabien@symfony.c... | 'text' => $text,
];
// verbatim is only available for markdown
if ($markdown) {
$this->options['text']['verbatim'] = $verbatim;
} else {
$this->options['text']['emoji'] = $emoji;
}
r | */
public function text(string $text, bool $markdown = true, bool $emoji = true, bool $verbatim = false): static
{
$this->options['text'] = [
'type' => $markdown ? 'mrkdwn' : 'plain_text',
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackSectionBlock.php",
"language": "php",
"file_size": 1949,
"cut_index": 537,
"middle_length": 229
} |
\HttpClient\Response\MockResponse;
use Symfony\Component\Notifier\Bridge\Slack\SlackOptions;
use Symfony\Component\Notifier\Bridge\Slack\SlackSentMessage;
use Symfony\Component\Notifier\Bridge\Slack\SlackTransport;
use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Excepti... | ackTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null, ?string $channel = null): SlackTransport
{
return new SlackTransport('xoxb-TestToken', $channel, $client ?? new MockHtt | ony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
final class Sl | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Tests/SlackTransportTest.php",
"language": "php",
"file_size": 9445,
"cut_index": 921,
"middle_length": 229
} |
*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Twilio;
use Symfony\Component\Notifier\Messag... | ions;
}
public function getRecipientId(): ?string
{
return null;
}
/**
* @return $this
*/
public function webhookUrl(string $url): static
{
$this->options['webhook_url'] = $url;
return $this; | ion toArray(): array
{
return $this->opt | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Twilio/TwilioOptions.php",
"language": "php",
"file_size": 837,
"cut_index": 520,
"middle_length": 52
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\Twilio;
use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Exception\TransportException;
use... | face;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
final class TwilioTransport extends AbstractTransport
{
protected const HOST = 'api.twilio.com';
public function __construct(
| Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInter | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Twilio/TwilioTransport.php",
"language": "php",
"file_size": 3601,
"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\Notifier\Bridge\Twilio\Tests\Webhook;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Notifier\Bridge\Twilio\Webhook\TwilioRequestParse... | uest(string $payload): Request
{
parse_str(trim($payload), $parameters);
return Request::create('/', 'POST', $parameters, [], [], [
'Content-Type' => 'application/x-www-form-urlencoded',
]);
}
protected sta | ;
class TwilioRequestParserTest extends AbstractRequestParserTestCase
{
protected function createRequestParser(): RequestParserInterface
{
return new TwilioRequestParser();
}
protected function createReq | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Twilio/Tests/Webhook/TwilioRequestParserTest.php",
"language": "php",
"file_size": 3929,
"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\Notifier\Bridge\RocketChat;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeExc... | **
* @author Jeroen Spee <https://github.com/Jeroeny>
*/
final class RocketChatTransport extends AbstractTransport
{
protected const HOST = 'rocketchat.com';
public function __construct(
#[\SensitiveParameter] private string $accessToken | otifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/ | {
"filepath": "src/Symfony/Component/Notifier/Bridge/RocketChat/RocketChatTransport.php",
"language": "php",
"file_size": 3367,
"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\Notifier\Bridge\Slack;
use Symfony\Component\Notifier\Bridge\Slack\Block\SlackBlockInterface;
use Symfony\Component\Notifier\Bridge\Slack\Block\SlackDivide... | tion __construct(
private array $options = [],
) {
if (\count($this->options['blocks'] ?? []) > self::MAX_BLOCKS) {
throw new LogicException(\sprintf('Maximum number of "blocks" has been reached (%d).', self::MAX_BLOCKS));
| face;
use Symfony\Component\Notifier\Notification\Notification;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
class SlackOptions implements MessageOptionsInterface
{
private const MAX_BLOCKS = 50;
public func | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/SlackOptions.php",
"language": "php",
"file_size": 4569,
"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\Notifier\Bridge\Slack;
use Symfony\Component\Notifier\Excep... | tion($dsn, 'slack', $this->getSupportedSchemes());
}
$accessToken = $this->getUser($dsn);
$channel = $dsn->getOption('channel');
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
$port = $dsn->getPort( | ny.com>
*/
final class SlackTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): SlackTransport
{
if ('slack' !== $dsn->getScheme()) {
throw new UnsupportedSchemeExcep | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/SlackTransportFactory.php",
"language": "php",
"file_size": 1233,
"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\Notifier\Bridge\Slack\Tests\Block;
use PHPUnit\Framework\TestCase;
use Symfony... | context->id('context_id');
$this->assertSame([
'type' => 'context',
'elements' => [
[
'type' => 'plain_text',
'text' => 'context text without emoji',
| ntextBlock();
$context->text('context text without emoji', false, false);
$context->text('context text verbatim', true, false, true);
$context->image('https://example.com/image.jpg', 'an image');
$ | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Tests/Block/SlackContextBlockTest.php",
"language": "php",
"file_size": 2007,
"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\Notifier\Bridge\Twilio\Tests;
use Symfony\Component\Notifier\Bridge\Twilio\Twi... | nsportFactory
{
return new TwilioTransportFactory();
}
public static function createProvider(): iterable
{
yield [
'twilio://host.test?from=0611223344',
'twilio://accountSid:authToken@host.test?from= | ngRequiredOptionTestTrait;
final class TwilioTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;
public function createFactory(): TwilioTra | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Twilio/Tests/TwilioTransportFactoryTest.php",
"language": "php",
"file_size": 1902,
"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\Notifier\Bridge\RocketChat\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\... | > 'Test Text',
'color' => '#FF0000',
]],
], $options->toArray());
$this->assertNull($options->getRecipientId());
}
public function testRocketChatOptionsWithChannel()
{
$options = (new Rocket | tle' => 'Test Title',
'text' => 'Test Text',
'color' => '#FF0000',
]);
$this->assertSame([
'attachments' => [[
'title' => 'Test Title',
'text' = | {
"filepath": "src/Symfony/Component/Notifier/Bridge/RocketChat/Tests/RocketChatOptionsTest.php",
"language": "php",
"file_size": 2757,
"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\Notifier\Bridge\Slack\Block;
/**
* @author Christophe V... | ],
];
if ($url) {
$this->options['url'] = $url;
}
if ($style) {
// primary or danger
$this->options['style'] = $style;
}
if ($value) {
$this->options['valu | e = null, ?string $value = null, ?array $confirm = null)
{
$this->options = [
'type' => 'button',
'text' => [
'type' => 'plain_text',
'text' => $text,
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackButtonBlockElement.php",
"language": "php",
"file_size": 1117,
"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\Notifier\Bridge\SmsFactor;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeExce... |
* @author Thibault Buathier <thibault.buathier@gmail.com>
*/
final class SmsFactorTransport extends AbstractTransport
{
protected const HOST = 'api.smsfactor.com';
public function __construct(
#[\SensitiveParameter] private string $toke | ifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/** | {
"filepath": "src/Symfony/Component/Notifier/Bridge/SmsFactor/SmsFactorTransport.php",
"language": "php",
"file_size": 3609,
"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\Notifier\Bridge\Slack;
use Symfony\Component\Notifier\Messa... | :__construct($original, $transport);
$this->setMessageId($messageId);
}
public function getChannelId(): string
{
return $this->channelId;
}
public function getUpdateMessage(string $subject, array $options = []): ChatMe | al class SlackSentMessage extends SentMessage
{
public function __construct(
MessageInterface $original,
string $transport,
private string $channelId,
string $messageId,
) {
parent: | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Slack/SlackSentMessage.php",
"language": "php",
"file_size": 1147,
"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\Notifier\Bridge\RocketChat;
use Symfony\Component\Notifier\Message\MessageOpti... | @var string[]|string[][] */
private array $attachments;
/** @var string[] */
private array $payload;
/**
* @param string[]|string[][] $attachments
* @param string[] $payload
*/
public function __construct(arr | i/rest-api/endpoints/core-endpoints/chat-endpoints/postmessage
*/
final class RocketChatOptions implements MessageOptionsInterface
{
/** prefix with '@' for personal messages */
private ?string $channel = null;
/** | {
"filepath": "src/Symfony/Component/Notifier/Bridge/RocketChat/RocketChatOptions.php",
"language": "php",
"file_size": 1668,
"cut_index": 537,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Notifier\Bridge\SmsSluzba;
use Symfony\Component\Notifier\Message\MessageOptionsInterface;
final class SmsSluzbaOptions implements MessageOptionsI... | null;
}
/**
* @return $this
*/
public function sendAt(\DateTime $sendAt): static
{
$sendAt->setTimezone(new \DateTimeZone('Europe/Prague'));
$this->options['send_at'] = $sendAt->format('YmdHis');
return | tion getRecipientId(): ?string
{
return | {
"filepath": "src/Symfony/Component/Notifier/Bridge/SmsSluzba/SmsSluzbaOptions.php",
"language": "php",
"file_size": 929,
"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\Notifier\Bridge\Esendex;
use Symfony\Component\Notifier\Exception... | ->getSupportedSchemes());
}
$email = $this->getUser($dsn);
$password = $this->getPassword($dsn);
$accountReference = $dsn->getRequiredOption('accountreference');
$from = $dsn->getRequiredOption('from');
$hos | actTransportFactory
{
public function create(Dsn $dsn): EsendexTransport
{
$scheme = $dsn->getScheme();
if ('esendex' !== $scheme) {
throw new UnsupportedSchemeException($dsn, 'esendex', $this | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Esendex/EsendexTransportFactory.php",
"language": "php",
"file_size": 1354,
"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\Notifier\Bridge\Esendex\Tests;
use Symfony\Component\Notifier\Bridge\Esendex\EsendexTransportFactory;
us... | return new EsendexTransportFactory();
}
public static function createProvider(): iterable
{
yield [
'esendex://host.test?accountreference=ACCOUNTREFERENCE&from=FROM',
'esendex://email:password@host.test?a | it;
final class EsendexTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;
public function createFactory(): EsendexTransportFactory
{
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Esendex/Tests/EsendexTransportFactoryTest.php",
"language": "php",
"file_size": 2318,
"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\Notifier\Bridge\Esendex\Tests;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Compone... | ttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
final class EsendexTransportTest extends TransportTestCase
{
public static function createTransport(?HttpClientInterface $client = null): EsendexTransport
{
return (ne | tifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\H | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Esendex/Tests/EsendexTransportTest.php",
"language": "php",
"file_size": 4176,
"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\Notifier\Bridge\Clickatell;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeExc... | *
* @author Kevin Auvinet <k.auvinet@gmail.com>
*/
final class ClickatellTransport extends AbstractTransport
{
protected const HOST = 'api.clickatell.com';
public function __construct(
#[\SensitiveParameter] private string $authToken,
| tifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
/* | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Clickatell/ClickatellTransport.php",
"language": "php",
"file_size": 3514,
"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\Notifier\Bridge\Clickatell;
use Symfony\Component\Notifier\Except... | throw new UnsupportedSchemeException($dsn, 'clickatell', $this->getSupportedSchemes());
}
$authToken = $this->getUser($dsn);
$from = $dsn->getOption('from');
$host = 'default' === $dsn->getHost() ? null : $dsn->getH | com>
*/
final class ClickatellTransportFactory extends AbstractTransportFactory
{
public function create(Dsn $dsn): ClickatellTransport
{
$scheme = $dsn->getScheme();
if ('clickatell' !== $scheme) {
| {
"filepath": "src/Symfony/Component/Notifier/Bridge/Clickatell/ClickatellTransportFactory.php",
"language": "php",
"file_size": 1281,
"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\Notifier\Bridge\Clickatell\Tests;
use Symfony\Component\Notifier\Bridge\Clicka... | function createProvider(): iterable
{
yield [
'clickatell://host.test?from=0611223344',
'clickatell://authtoken@host.test?from=0611223344',
];
}
public static function supportsProvider(): iterable
{
| toryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
public function createFactory(): ClickatellTransportFactory
{
return new ClickatellTransportFactory();
}
public static | {
"filepath": "src/Symfony/Component/Notifier/Bridge/Clickatell/Tests/ClickatellTransportFactoryTest.php",
"language": "php",
"file_size": 1542,
"cut_index": 537,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.