diff --git a/composer.json b/composer.json index f5f071b7..c3ddd5e2 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "orchestra/testbench": "*", "guzzlehttp/guzzle": "^7.3", "guzzlehttp/psr7": "^1.7 || ^2.0", - "phpstan/phpstan": "^1.10", + "phpstan/phpstan": "^2.0", "phpunit/phpunit": "^10.2" }, "autoload": { diff --git a/docs/classes/LINE-Laravel-Tests-Facades-FacadesTest.html b/docs/classes/LINE-Laravel-Tests-Facades-FacadesTest.html index 608157d3..27954284 100644 --- a/docs/classes/LINE-Laravel-Tests-Facades-FacadesTest.html +++ b/docs/classes/LINE-Laravel-Tests-Facades-FacadesTest.html @@ -167,7 +167,7 @@
-

(PHPMD.CouplingBetweenObjects)

+

("PHPMD.CouplingBetweenObjects")

@@ -294,7 +294,7 @@
-

(PHPMD.UnusedFormalParameter)

+

("PHPMD.UnusedFormalParameter")

@@ -352,7 +352,7 @@
-

(PHPMD.UnusedFormalParameter)

+

("PHPMD.UnusedFormalParameter")

@@ -410,7 +410,7 @@
-

(PHPMD.UnusedFormalParameter)

+

("PHPMD.UnusedFormalParameter")

diff --git a/docs/classes/LINE-Parser-EventRequestParser.html b/docs/classes/LINE-Parser-EventRequestParser.html index 4ab2d6fd..c1e1a3fa 100644 --- a/docs/classes/LINE-Parser-EventRequestParser.html +++ b/docs/classes/LINE-Parser-EventRequestParser.html @@ -162,7 +162,7 @@
-

(PHPMD.CouplingBetweenObjects)

+

("PHPMD.CouplingBetweenObjects")

diff --git a/docs/classes/LINE-Parser-Tests-EventRequestParserTest.html b/docs/classes/LINE-Parser-Tests-EventRequestParserTest.html index 83b6fe14..d24c9fab 100644 --- a/docs/classes/LINE-Parser-Tests-EventRequestParserTest.html +++ b/docs/classes/LINE-Parser-Tests-EventRequestParserTest.html @@ -1223,7 +1223,7 @@

diff --git a/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleRestaurant.php b/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleRestaurant.php index 7576c589..89dcf20d 100644 --- a/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleRestaurant.php +++ b/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleRestaurant.php @@ -49,7 +49,7 @@ use LINE\Constants\MessageType; /** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") */ class FlexSampleRestaurant { diff --git a/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleShopping.php b/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleShopping.php index e3b5c174..62994e2c 100644 --- a/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleShopping.php +++ b/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/Flex/FlexSampleShopping.php @@ -43,7 +43,7 @@ use LINE\Constants\MessageType; /** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") */ class FlexSampleShopping { diff --git a/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/ImageMessageHandler.php b/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/ImageMessageHandler.php index f3306ea2..33537a2a 100644 --- a/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/ImageMessageHandler.php +++ b/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/ImageMessageHandler.php @@ -30,7 +30,7 @@ use LINE\Webhook\Model\MessageEvent; /** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") */ class ImageMessageHandler implements EventHandler { diff --git a/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/TextMessageHandler.php b/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/TextMessageHandler.php index ad7b666b..4c68291e 100644 --- a/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/TextMessageHandler.php +++ b/examples/KitchenSink/src/LINEBot/KitchenSink/EventHandler/MessageHandler/TextMessageHandler.php @@ -57,9 +57,9 @@ use LINE\Webhook\Model\TextMessageContent; /** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") + * @SuppressWarnings("PHPMD.CyclomaticComplexity") + * @SuppressWarnings("PHPMD.ExcessiveMethodLength") */ class TextMessageHandler implements EventHandler { diff --git a/src/laravel/test/Facades/FacadesTest.php b/src/laravel/test/Facades/FacadesTest.php index 50d6098c..c306df92 100644 --- a/src/laravel/test/Facades/FacadesTest.php +++ b/src/laravel/test/Facades/FacadesTest.php @@ -19,14 +19,14 @@ namespace LINE\Laravel\Tests\Facades; /** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") */ class FacadesTest extends \Orchestra\Testbench\TestCase { /** * Load package service provider * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @SuppressWarnings("PHPMD.UnusedFormalParameter") * @param \Illuminate\Foundation\Application $app * @return array */ @@ -38,7 +38,7 @@ protected function getPackageProviders($app) /** * Load package alias * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @SuppressWarnings("PHPMD.UnusedFormalParameter") * @param \Illuminate\Foundation\Application $app * @return array */ @@ -69,7 +69,7 @@ public function testConfigLoaded() /** * Testing LINEBot facade instance * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @SuppressWarnings("PHPMD.UnusedFormalParameter") * @return void */ public function testLINEBotFacadeInstance() diff --git a/src/parser/lib/EventRequestParser.php b/src/parser/lib/EventRequestParser.php index e64bc275..5317560d 100644 --- a/src/parser/lib/EventRequestParser.php +++ b/src/parser/lib/EventRequestParser.php @@ -44,7 +44,7 @@ use LINE\Webhook\Model\UserMentionee; /** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings("PHPMD.CouplingBetweenObjects") */ class EventRequestParser { diff --git a/src/parser/test/EventRequestParserTest.php b/src/parser/test/EventRequestParserTest.php index 58f8eb69..7967bc92 100644 --- a/src/parser/test/EventRequestParserTest.php +++ b/src/parser/test/EventRequestParserTest.php @@ -1234,11 +1234,10 @@ public function testParseEventRequest() $this->assertEquals('__unknown__', $event->jsonSerialize()->type); // with unprocessed event body $this->assertEquals(12345678901234, $event->getTimestamp()); $this->assertEquals('active', $event->getMode()); - $this->assertTrue($source instanceof UserSource); + $this->assertInstanceOf(UserSource::class, $source); $this->assertEquals('userid', $source->getUserId()); $this->assertEquals('testwebhookeventid', $event->getWebhookEventId()); $this->assertFalse($event->getDeliveryContext()->getIsRedelivery()); - $this->assertEquals(true, $source instanceof UserSource); } {