Skip to content

Commit

Permalink
Support phpstan 2.0 (#635)
Browse files Browse the repository at this point in the history
I made adjustments due to breaking changes in PHPStan 2.0. 
When the Suppress annotation contains a period, quotes are now required.
phpstan/phpdoc-parser#256

close #622
  • Loading branch information
eucyt authored Dec 24, 2024
1 parent 5db381c commit ab04435
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions docs/classes/LINE-Laravel-Tests-Facades-FacadesTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h5 class="phpdocumentor-tag-list__heading" id="tags">
</dt>
<dd class="phpdocumentor-tag-list__definition">

<section class="phpdocumentor-description"><p>(PHPMD.CouplingBetweenObjects)</p>
<section class="phpdocumentor-description"><p>(&quot;PHPMD.CouplingBetweenObjects&quot;)</p>
</section>

</dd>
Expand Down Expand Up @@ -294,7 +294,7 @@ <h5 class="phpdocumentor-tag-list__heading" id="tags">
</dt>
<dd class="phpdocumentor-tag-list__definition">

<section class="phpdocumentor-description"><p>(PHPMD.UnusedFormalParameter)</p>
<section class="phpdocumentor-description"><p>(&quot;PHPMD.UnusedFormalParameter&quot;)</p>
</section>

</dd>
Expand Down Expand Up @@ -352,7 +352,7 @@ <h5 class="phpdocumentor-tag-list__heading" id="tags">
</dt>
<dd class="phpdocumentor-tag-list__definition">

<section class="phpdocumentor-description"><p>(PHPMD.UnusedFormalParameter)</p>
<section class="phpdocumentor-description"><p>(&quot;PHPMD.UnusedFormalParameter&quot;)</p>
</section>

</dd>
Expand Down Expand Up @@ -410,7 +410,7 @@ <h5 class="phpdocumentor-tag-list__heading" id="tags">
</dt>
<dd class="phpdocumentor-tag-list__definition">

<section class="phpdocumentor-description"><p>(PHPMD.UnusedFormalParameter)</p>
<section class="phpdocumentor-description"><p>(&quot;PHPMD.UnusedFormalParameter&quot;)</p>
</section>

</dd>
Expand Down
2 changes: 1 addition & 1 deletion docs/classes/LINE-Parser-EventRequestParser.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ <h5 class="phpdocumentor-tag-list__heading" id="tags">
</dt>
<dd class="phpdocumentor-tag-list__definition">

<section class="phpdocumentor-description"><p>(PHPMD.CouplingBetweenObjects)</p>
<section class="phpdocumentor-description"><p>(&quot;PHPMD.CouplingBetweenObjects&quot;)</p>
</section>

</dd>
Expand Down
2 changes: 1 addition & 1 deletion docs/classes/LINE-Parser-Tests-EventRequestParserTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ <h4 class="phpdocumentor-element__name" id="method_getSignature">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="src/parser/test/EventRequestParserTest.php"><a href="files/src-parser-test-eventrequestparsertest.html"><abbr title="src/parser/test/EventRequestParserTest.php">EventRequestParserTest.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">1715</span>
<span class="phpdocumentor-element-found-in__line">1714</span>

</aside>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
use LINE\Constants\MessageType;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
*/
class FlexSampleRestaurant
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
use LINE\Constants\MessageType;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
*/
class FlexSampleShopping
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
use LINE\Webhook\Model\MessageEvent;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
*/
class ImageMessageHandler implements EventHandler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions src/laravel/test/Facades/FacadesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -38,7 +38,7 @@ protected function getPackageProviders($app)
/**
* Load package alias
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
* @param \Illuminate\Foundation\Application $app
* @return array
*/
Expand Down Expand Up @@ -69,7 +69,7 @@ public function testConfigLoaded()
/**
* Testing LINEBot facade instance
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
* @return void
*/
public function testLINEBotFacadeInstance()
Expand Down
2 changes: 1 addition & 1 deletion src/parser/lib/EventRequestParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
use LINE\Webhook\Model\UserMentionee;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
*/
class EventRequestParser
{
Expand Down
3 changes: 1 addition & 2 deletions src/parser/test/EventRequestParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

{
Expand Down

0 comments on commit ab04435

Please sign in to comment.