Skip to content

Commit d044f82

Browse files
committed
style: also align @phpstan-type and @phpstan-var
1 parent 609be52 commit d044f82

File tree

10 files changed

+67
-19
lines changed

10 files changed

+67
-19
lines changed

.php-cs-fixer.dist.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
'phpstan-param',
6464
'phpstan-property',
6565
'phpstan-return',
66+
'phpstan-type',
67+
'phpstan-var',
6668
'property',
6769
'property-read',
6870
'property-write',

.php-cs-fixer.no-header.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,29 @@
3131

3232
$overrides = [
3333
'phpdoc_array_type' => true,
34+
'phpdoc_align' => [
35+
'align' => 'vertical',
36+
'spacing' => 1,
37+
'tags' => [
38+
'method',
39+
'param',
40+
'phpstan-assert',
41+
'phpstan-assert-if-true',
42+
'phpstan-assert-if-false',
43+
'phpstan-param',
44+
'phpstan-property',
45+
'phpstan-return',
46+
'phpstan-type',
47+
'phpstan-var',
48+
'property',
49+
'property-read',
50+
'property-write',
51+
'return',
52+
'throws',
53+
'type',
54+
'var',
55+
],
56+
],
3457
];
3558

3659
$options = [

.php-cs-fixer.user-guide.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,29 @@
4040
'leading_backslash_in_global_namespace' => true,
4141
],
4242
'phpdoc_array_type' => true,
43+
'phpdoc_align' => [
44+
'align' => 'vertical',
45+
'spacing' => 1,
46+
'tags' => [
47+
'method',
48+
'param',
49+
'phpstan-assert',
50+
'phpstan-assert-if-true',
51+
'phpstan-assert-if-false',
52+
'phpstan-param',
53+
'phpstan-property',
54+
'phpstan-return',
55+
'phpstan-type',
56+
'phpstan-var',
57+
'property',
58+
'property-read',
59+
'property-write',
60+
'return',
61+
'throws',
62+
'type',
63+
'var',
64+
],
65+
],
4366
];
4467

4568
$options = [

app/Config/View.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class View extends BaseView
3434
* { title|esc(js) }
3535
* { created_on|date(Y-m-d)|esc(attr) }
3636
*
37-
* @var array<string, string>
37+
* @var array<string, string>
3838
* @phpstan-var array<string, ParserCallableString>
3939
*/
4040
public $filters = [];
@@ -44,7 +44,7 @@ class View extends BaseView
4444
* by the core Parser by creating aliases that will be replaced with
4545
* any callable. Can be single or tag pair.
4646
*
47-
* @var array<string, array<string>|callable|string>
47+
* @var array<string, array<string>|callable|string>
4848
* @phpstan-var array<string, array<ParserCallableString>|ParserCallableString|ParserCallable>
4949
*/
5050
public $plugins = [];

system/BaseModel.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242
* - process various callbacks
4343
* - allow intermingling calls to the db connection
4444
*
45-
* @phpstan-type row_array array<int|string, float|int|null|object|string>
45+
* @phpstan-type row_array array<int|string, float|int|null|object|string>
4646
* @phpstan-type event_data_beforeinsert array{data: row_array}
47-
* @phpstan-type event_data_afterinsert array{id: int|string, data: row_array, result: bool}
48-
* @phpstan-type event_data_beforefind array{id?: int|string, method: string, singleton: bool, limit?: int, offset?: int}
49-
* @phpstan-type event_data_afterfind array{id: int|string|null|list<int|string>, data: row_array|list<row_array>|object|null, method: string, singleton: bool}
47+
* @phpstan-type event_data_afterinsert array{id: int|string, data: row_array, result: bool}
48+
* @phpstan-type event_data_beforefind array{id?: int|string, method: string, singleton: bool, limit?: int, offset?: int}
49+
* @phpstan-type event_data_afterfind array{id: int|string|null|list<int|string>, data: row_array|list<row_array>|object|null, method: string, singleton: bool}
5050
* @phpstan-type event_data_beforeupdate array{id: null|list<int|string>, data: row_array}
51-
* @phpstan-type event_data_afterupdate array{id: null|list<int|string>, data: row_array|object, result: bool}
51+
* @phpstan-type event_data_afterupdate array{id: null|list<int|string>, data: row_array|object, result: bool}
5252
* @phpstan-type event_data_beforedelete array{id: null|list<int|string>, purge: bool}
53-
* @phpstan-type event_data_afterdelete array{id: null|list<int|string>, data: null, purge: bool, result: bool}
53+
* @phpstan-type event_data_afterdelete array{id: null|list<int|string>, data: null, purge: bool, result: bool}
5454
*/
5555
abstract class BaseModel
5656
{

system/Config/View.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class View extends BaseConfig
3939
*
4040
* @psalm-suppress UndefinedDocblockClass
4141
*
42-
* @var array<string, string>
42+
* @var array<string, string>
4343
* @phpstan-var array<string, parser_callable_string>
4444
*/
4545
public $filters = [];
@@ -51,15 +51,15 @@ class View extends BaseConfig
5151
*
5252
* @psalm-suppress UndefinedDocblockClass
5353
*
54-
* @var array<string, array<string>|callable|string>
54+
* @var array<string, array<string>|callable|string>
5555
* @phpstan-var array<string, array<parser_callable_string>|parser_callable_string|parser_callable>
5656
*/
5757
public $plugins = [];
5858

5959
/**
6060
* Built-in View filters.
6161
*
62-
* @var array<string, string>
62+
* @var array<string, string>
6363
* @phpstan-var array<string, parser_callable_string>
6464
*/
6565
protected $coreFilters = [
@@ -89,7 +89,7 @@ class View extends BaseConfig
8989
/**
9090
* Built-in View plugins.
9191
*
92-
* @var array<string, array<string>|callable|string>
92+
* @var array<string, array<string>|callable|string>
9393
* @phpstan-var array<string, array<parser_callable_string>|parser_callable_string|parser_callable>
9494
*/
9595
protected $corePlugins = [

system/Database/BaseConnection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ abstract class BaseConnection implements ConnectionInterface
195195
/**
196196
* Connection ID
197197
*
198-
* @var false|object|resource
198+
* @var false|object|resource
199199
* @phpstan-var false|TConnection
200200
*/
201201
public $connID = false;
202202

203203
/**
204204
* Result ID
205205
*
206-
* @var false|object|resource
206+
* @var false|object|resource
207207
* @phpstan-var false|TResult
208208
*/
209209
public $resultID = false;

system/Database/BasePreparedQuery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
2929
/**
3030
* The prepared statement itself.
3131
*
32-
* @var object|resource|null
32+
* @var object|resource|null
3333
* @phpstan-var TStatement|null
3434
*/
3535
protected $statement;
@@ -59,7 +59,7 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
5959
/**
6060
* A reference to the db connection to use.
6161
*
62-
* @var BaseConnection
62+
* @var BaseConnection
6363
* @phpstan-var BaseConnection<TConnection, TResult>
6464
*/
6565
protected $db;

system/Database/BaseResult.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ abstract class BaseResult implements ResultInterface
2525
/**
2626
* Connection ID
2727
*
28-
* @var object|resource
28+
* @var object|resource
2929
* @phpstan-var TConnection
3030
*/
3131
public $connID;
3232

3333
/**
3434
* Result ID
3535
*
36-
* @var false|object|resource
36+
* @var false|object|resource
3737
* @phpstan-var false|TResult
3838
*/
3939
public $resultID;

system/View/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Parser extends View
6363
/**
6464
* Stores any plugins registered at run-time.
6565
*
66-
* @var array<string, array<string>|callable|string>
66+
* @var array<string, array<string>|callable|string>
6767
* @phpstan-var array<string, array<parser_callable_string>|parser_callable_string|parser_callable>
6868
*/
6969
protected $plugins = [];

0 commit comments

Comments
 (0)