Skip to content

Commit 52ca60d

Browse files
Copilotegorsmkv
andcommitted
Fix PHP warnings: add strict_types and replace isset with explicit checks
Co-authored-by: egorsmkv <7875085+egorsmkv@users.noreply.github.com>
1 parent aa8db2d commit 52ca60d

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

packages/default/notifier/index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Symfony\Component\Notifier\Bridge\Telegram\TelegramOptions;
46
use Symfony\Component\Notifier\Bridge\Telegram\TelegramTransportFactory;
57
use Symfony\Component\Notifier\Chatter;
@@ -42,7 +44,7 @@ function main(array $args): array
4244

4345
// Check required arguments
4446
foreach ($requiredArgs as $arg) {
45-
if (!isset($args[$arg])) {
47+
if (!array_key_exists($arg, $args) || $args[$arg] === null) {
4648
return wrap(['error' => sprintf('Please supply %s argument.', $arg)]);
4749
}
4850
}

packages/default/notifier/test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
error_reporting(E_ALL & ~E_DEPRECATED);
46

57
require __DIR__ . '/vendor/autoload.php';

test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
require __DIR__ . '/packages/default/notifier/vendor/autoload.php';
46

57
// Constants

0 commit comments

Comments
 (0)