Skip to content

Commit bd10dea

Browse files
authored
Stricter PHPStan level to 8 (#671)
Related #669 PHPStan (static code analysis) allows you to choose the type of warnings based on levels. https://phpstan.org/user-guide/rule-levels It is currently set to level 5 (the maximum is 10). Let's make it stricter and refactor the code for better quality. I've raised it to level 8 in this PR for now.
1 parent 9d43363 commit bd10dea

12 files changed

+221
-170
lines changed

docs/classes/LINE-Laravel-LINEBotServiceProvider.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ <h3 id="toc">
178178
<dt class="phpdocumentor-table-of-contents__entry -property -private">
179179
<a href="classes/LINE-Laravel-LINEBotServiceProvider.html#property_apiBindings">$apiBindings</a>
180180
<span>
181-
&nbsp;: mixed </span>
181+
&nbsp;: array&lt;string|int, mixed&gt; </span>
182182
</dt>
183183
<dd></dd>
184184

@@ -199,7 +199,7 @@ <h3 id="toc">
199199
<dt class="phpdocumentor-table-of-contents__entry -method -private">
200200
<a href="classes/LINE-Laravel-LINEBotServiceProvider.html#method_bindApis">bindApis()</a>
201201
<span>
202-
&nbsp;: mixed </span>
202+
&nbsp;: void </span>
203203
</dt>
204204
<dd></dd>
205205

@@ -222,7 +222,7 @@ <h4 class="phpdocumentor-element__name" id="constant_CONFIG_PATH">
222222
<aside class="phpdocumentor-element-found-in">
223223
<abbr class="phpdocumentor-element-found-in__file" title="src/laravel/lib/LINEBotServiceProvider.php"><a href="files/src-laravel-lib-linebotserviceprovider.html"><abbr title="src/laravel/lib/LINEBotServiceProvider.php">LINEBotServiceProvider.php</abbr></a></abbr>
224224
:
225-
<span class="phpdocumentor-element-found-in__line">56</span>
225+
<span class="phpdocumentor-element-found-in__line">59</span>
226226

227227
</aside>
228228

@@ -266,20 +266,20 @@ <h4 class="phpdocumentor-element__name" id="property_apiBindings">
266266
<aside class="phpdocumentor-element-found-in">
267267
<abbr class="phpdocumentor-element-found-in__file" title="src/laravel/lib/LINEBotServiceProvider.php"><a href="files/src-laravel-lib-linebotserviceprovider.html"><abbr title="src/laravel/lib/LINEBotServiceProvider.php">LINEBotServiceProvider.php</abbr></a></abbr>
268268
:
269-
<span class="phpdocumentor-element-found-in__line">25</span>
269+
<span class="phpdocumentor-element-found-in__line">28</span>
270270

271271
</aside>
272272

273273

274274
<code class="phpdocumentor-code phpdocumentor-signature ">
275275
<span class="phpdocumentor-signature__visibility">private</span>
276-
<span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__type">mixed</span>
276+
<span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__type">array&lt;string|int, mixed&gt;</span>
277277
<span class="phpdocumentor-signature__name">$apiBindings</span>
278278
= <span class="phpdocumentor-signature__default-value">[&#039;line-bot-channel-access-token-api&#039; =&gt; [&#039;config&#039; =&gt; \LINE\Clients\ChannelAccessToken\Configuration::class, &#039;api&#039; =&gt; \LINE\Clients\ChannelAccessToken\Api\ChannelAccessTokenApi::class], &#039;line-bot-insight-api&#039; =&gt; [&#039;config&#039; =&gt; \LINE\Clients\Insight\Configuration::class, &#039;api&#039; =&gt; \LINE\Clients\Insight\Api\InsightApi::class], &#039;line-bot-liff-api&#039; =&gt; [&#039;config&#039; =&gt; \LINE\Clients\Liff\Configuration::class, &#039;api&#039; =&gt; \LINE\Clients\Liff\Api\LiffApi::class], &#039;line-bot-manage-audience-api&#039; =&gt; [&#039;config&#039; =&gt; \LINE\Clients\ManageAudience\Configuration::class, &#039;api&#039; =&gt; \LINE\Clients\ManageAudience\Api\ManageAudienceApi::class], &#039;line-bot-manage-audience-blob-api&#039; =&gt; [&#039;config&#039; =&gt; \LINE\Clients\ManageAudience\Configuration::class, &#039;api&#039; =&gt; \LINE\Clients\ManageAudience\Api\ManageAudienceBlobApi::class], &#039;line-bot-messaging-api&#039; =&gt; [&#039;config&#039; =&gt; \LINE\Clients\MessagingApi\Configuration::class, &#039;api&#039; =&gt; \LINE\Clients\MessagingApi\Api\MessagingApiApi::class], &#039;line-bot-messaging-blob-api&#039; =&gt; [&#039;config&#039; =&gt; \LINE\Clients\MessagingApi\Configuration::class, &#039;api&#039; =&gt; \LINE\Clients\MessagingApi\Api\MessagingApiBlobApi::class]]</span></code>
279279

280-
<section class="phpdocumentor-description"></section>
281-
282-
<section class="phpdocumentor-description"></section>
280+
281+
<section class="phpdocumentor-description"><p>array&lt;string, array{config: class-string, api: class-string}&gt;</p>
282+
</section>
283283

284284

285285

@@ -304,7 +304,7 @@ <h4 class="phpdocumentor-element__name" id="method_boot">
304304
<aside class="phpdocumentor-element-found-in">
305305
<abbr class="phpdocumentor-element-found-in__file" title="src/laravel/lib/LINEBotServiceProvider.php"><a href="files/src-laravel-lib-linebotserviceprovider.html"><abbr title="src/laravel/lib/LINEBotServiceProvider.php">LINEBotServiceProvider.php</abbr></a></abbr>
306306
:
307-
<span class="phpdocumentor-element-found-in__line">63</span>
307+
<span class="phpdocumentor-element-found-in__line">66</span>
308308

309309
</aside>
310310

@@ -337,7 +337,7 @@ <h4 class="phpdocumentor-element__name" id="method_register">
337337
<aside class="phpdocumentor-element-found-in">
338338
<abbr class="phpdocumentor-element-found-in__file" title="src/laravel/lib/LINEBotServiceProvider.php"><a href="files/src-laravel-lib-linebotserviceprovider.html"><abbr title="src/laravel/lib/LINEBotServiceProvider.php">LINEBotServiceProvider.php</abbr></a></abbr>
339339
:
340-
<span class="phpdocumentor-element-found-in__line">82</span>
340+
<span class="phpdocumentor-element-found-in__line">85</span>
341341

342342
</aside>
343343

@@ -370,38 +370,38 @@ <h4 class="phpdocumentor-element__name" id="method_bindApis">
370370
<aside class="phpdocumentor-element-found-in">
371371
<abbr class="phpdocumentor-element-found-in__file" title="src/laravel/lib/LINEBotServiceProvider.php"><a href="files/src-laravel-lib-linebotserviceprovider.html"><abbr title="src/laravel/lib/LINEBotServiceProvider.php">LINEBotServiceProvider.php</abbr></a></abbr>
372372
:
373-
<span class="phpdocumentor-element-found-in__line">98</span>
373+
<span class="phpdocumentor-element-found-in__line">101</span>
374374

375375
</aside>
376376

377377

378378
<code class="phpdocumentor-code phpdocumentor-signature ">
379379
<span class="phpdocumentor-signature__visibility">private</span>
380-
<span class="phpdocumentor-signature__name">bindApis</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$facadeName</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$clientClass</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$configClass</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
380+
<span class="phpdocumentor-signature__name">bindApis</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$facadeName</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$clientClass</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$configClass</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">void</span></code>
381381

382382
<section class="phpdocumentor-description"></section>
383383

384384
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
385385
<dl class="phpdocumentor-argument-list">
386386
<dt class="phpdocumentor-argument-list__entry">
387387
<span class="phpdocumentor-signature__argument__name">$facadeName</span>
388-
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
388+
: <span class="phpdocumentor-signature__argument__return-type">string</span>
389389
</dt>
390390
<dd class="phpdocumentor-argument-list__definition">
391391
<section class="phpdocumentor-description"></section>
392392

393393
</dd>
394394
<dt class="phpdocumentor-argument-list__entry">
395395
<span class="phpdocumentor-signature__argument__name">$clientClass</span>
396-
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
396+
: <span class="phpdocumentor-signature__argument__return-type">string</span>
397397
</dt>
398398
<dd class="phpdocumentor-argument-list__definition">
399399
<section class="phpdocumentor-description"></section>
400400

401401
</dd>
402402
<dt class="phpdocumentor-argument-list__entry">
403403
<span class="phpdocumentor-signature__argument__name">$configClass</span>
404-
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
404+
: <span class="phpdocumentor-signature__argument__return-type">string</span>
405405
</dt>
406406
<dd class="phpdocumentor-argument-list__definition">
407407
<section class="phpdocumentor-description"></section>
@@ -412,7 +412,7 @@ <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
412412

413413

414414
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
415-
<span class="phpdocumentor-signature__response_type">mixed</span>
415+
<span class="phpdocumentor-signature__response_type">void</span>
416416
&mdash;
417417

418418

docs/classes/LINE-Laravel-Tests-Facades-FacadesTest.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,14 @@ <h3 id="toc">
201201
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
202202
<a href="classes/LINE-Laravel-Tests-Facades-FacadesTest.html#method_getPackageAliases">getPackageAliases()</a>
203203
<span>
204-
&nbsp;: array&lt;string|int, mixed&gt; </span>
204+
&nbsp;: array&lt;string, class-string&gt; </span>
205205
</dt>
206206
<dd>Load package alias</dd>
207207

208208
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
209209
<a href="classes/LINE-Laravel-Tests-Facades-FacadesTest.html#method_getPackageProviders">getPackageProviders()</a>
210210
<span>
211-
&nbsp;: array&lt;string|int, mixed&gt; </span>
211+
&nbsp;: array&lt;string|int, string&gt; </span>
212212
</dt>
213213
<dd>Load package service provider</dd>
214214

@@ -327,7 +327,7 @@ <h4 class="phpdocumentor-element__name" id="method_getPackageAliases">
327327

328328
<code class="phpdocumentor-code phpdocumentor-signature ">
329329
<span class="phpdocumentor-signature__visibility">protected</span>
330-
<span class="phpdocumentor-signature__name">getPackageAliases</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Illuminate\Foundation\Application">Application</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$app</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
330+
<span class="phpdocumentor-signature__name">getPackageAliases</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Illuminate\Foundation\Application">Application</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$app</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string, class-string&gt;</span></code>
331331

332332

333333
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
@@ -359,7 +359,7 @@ <h5 class="phpdocumentor-tag-list__heading" id="tags">
359359
</dl>
360360

361361
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
362-
<span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
362+
<span class="phpdocumentor-signature__response_type">array&lt;string, class-string&gt;</span>
363363
&mdash;
364364

365365

@@ -385,7 +385,7 @@ <h4 class="phpdocumentor-element__name" id="method_getPackageProviders">
385385

386386
<code class="phpdocumentor-code phpdocumentor-signature ">
387387
<span class="phpdocumentor-signature__visibility">protected</span>
388-
<span class="phpdocumentor-signature__name">getPackageProviders</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Illuminate\Foundation\Application">Application</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$app</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
388+
<span class="phpdocumentor-signature__name">getPackageProviders</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\Illuminate\Foundation\Application">Application</abbr>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$app</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, string&gt;</span></code>
389389

390390

391391
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
@@ -417,7 +417,7 @@ <h5 class="phpdocumentor-tag-list__heading" id="tags">
417417
</dl>
418418

419419
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
420-
<span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
420+
<span class="phpdocumentor-signature__response_type">array&lt;string|int, string&gt;</span>
421421
&mdash;
422422

423423

0 commit comments

Comments
 (0)