We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21c5aea commit e01f3e6Copy full SHA for e01f3e6
src/DependencyInjection/Factory/NutgramFactory.php
@@ -10,17 +10,24 @@
10
use SergiX44\Nutgram\RunningMode\Webhook;
11
use Symfony\Component\Cache\Psr16Cache;
12
use Symfony\Component\HttpFoundation\RequestStack;
13
+use Symfony\Component\HttpKernel\KernelInterface;
14
15
class NutgramFactory
16
{
17
public function createNutgram(
18
array $config,
19
ContainerInterface $container,
20
RequestStack $requestStack,
21
+ KernelInterface $kernel,
22
?CacheItemPoolInterface $nutgramCache,
23
?LoggerInterface $nutgramLogger,
24
?LoggerInterface $nutgramConsoleLogger
25
): Nutgram {
26
+
27
+ if ($kernel->getEnvironment() === 'test') {
28
+ return Nutgram::fake();
29
+ }
30
31
$isCli = \PHP_SAPI === 'cli' || \PHP_SAPI === 'phpdbg';
32
33
$bot = new Nutgram($config['token'], array_merge([
0 commit comments