Skip to content

Commit 8ddcf41

Browse files
committed
Release PHP 7.4 downgraded
1 parent 12c9877 commit 8ddcf41

File tree

7 files changed

+71
-20
lines changed

7 files changed

+71
-20
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "phpstan-extension",
55
"license": "MIT",
66
"require": {
7-
"php": "^8.3"
7+
"php": "^7.4 || ^8.0"
88
},
99
"require-dev": {
1010
"phpunit/phpunit": "^9.5|^10.0",

src/Rules/Laravel/EnforceCollationRule.php

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,35 @@
2424
*/
2525
final class EnforceCollationRule extends LaravelRule
2626
{
27+
/**
28+
* @readonly
29+
*/
30+
private string $requiredCollation;
2731
// Same identifier as Phinx (as requested)
28-
private const string RULE_IDENTIFIER = 'laravel.schema.requiredCollation';
29-
30-
private const string MESSAGE_MISSING =
32+
/**
33+
* @var string
34+
*/
35+
private const RULE_IDENTIFIER = 'laravel.schema.requiredCollation';
36+
37+
/**
38+
* @var string
39+
*/
40+
private const MESSAGE_MISSING =
3141
'Required: table collation must be "%s". '
3242
. 'Why: prevents environment-dependent defaults and keeps schema consistent. '
3343
. 'Fix: set the table collation explicitly in the migration.';
3444

35-
private const string MESSAGE_WRONG =
45+
/**
46+
* @var string
47+
*/
48+
private const MESSAGE_WRONG =
3649
'Required: table collation must be "%s". Found: "%s". '
3750
. 'Why: prevents environment-dependent defaults and keeps schema consistent. '
3851
. 'Fix: set the table collation explicitly in the migration.';
3952

40-
public function __construct(
41-
private readonly string $requiredCollation
42-
) {
53+
public function __construct(string $requiredCollation)
54+
{
55+
$this->requiredCollation = $requiredCollation;
4356
}
4457

4558
public function getNodeType(): string

src/Rules/Laravel/ForbidAfterRule.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@
1616
*/
1717
final class ForbidAfterRule extends LaravelRule
1818
{
19-
private const string RULE_IDENTIFIER = 'laravel.schema.afterForbidden';
19+
/**
20+
* @var string
21+
*/
22+
private const RULE_IDENTIFIER = 'laravel.schema.afterForbidden';
2023

21-
private const string MESSAGE =
24+
/**
25+
* @var string
26+
*/
27+
private const MESSAGE =
2228
'Forbidden: column positioning ("after"). '
2329
. 'Why: can trigger a full table rewrite or long locks depending on the engine. '
2430
. 'Fix: avoid column ordering in migrations.';

src/Rules/Laravel/ForbidMultipleTableCreationsRule.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@
1616
*/
1717
final class ForbidMultipleTableCreationsRule extends LaravelRule
1818
{
19-
private const string RULE_IDENTIFIER = 'laravel.schema.multipleTableCreationsForbidden';
19+
/**
20+
* @var string
21+
*/
22+
private const RULE_IDENTIFIER = 'laravel.schema.multipleTableCreationsForbidden';
2023

21-
private const string MESSAGE =
24+
/**
25+
* @var string
26+
*/
27+
private const MESSAGE =
2228
'Forbidden: creating multiple tables in a single migration. '
2329
. 'Why: reduces reviewability and rollback safety. '
2430
. 'Fix: split into one migration per table.';

src/Rules/Phinx/EnforceCollationRule.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,35 @@
1717
*/
1818
final class EnforceCollationRule extends PhinxRule
1919
{
20+
/**
21+
* @readonly
22+
*/
23+
private string $requiredCollation;
2024
// Same identifier as Laravel
21-
private const string RULE_IDENTIFIER = 'phinx.schema.requiredCollation';
25+
/**
26+
* @var string
27+
*/
28+
private const RULE_IDENTIFIER = 'phinx.schema.requiredCollation';
2229

23-
private const string MESSAGE_MISSING =
30+
/**
31+
* @var string
32+
*/
33+
private const MESSAGE_MISSING =
2434
'Required: table collation must be "%s". '
2535
. 'Why: prevents environment-dependent defaults and keeps schema consistent. '
2636
. 'Fix: set the table collation explicitly in the migration.';
2737

28-
private const string MESSAGE_WRONG =
38+
/**
39+
* @var string
40+
*/
41+
private const MESSAGE_WRONG =
2942
'Required: table collation must be "%s". Found: "%s". '
3043
. 'Why: prevents environment-dependent defaults and keeps schema consistent. '
3144
. 'Fix: set the table collation explicitly in the migration.';
3245

33-
public function __construct(private readonly string $requiredCollation)
46+
public function __construct(string $requiredCollation)
3447
{
48+
$this->requiredCollation = $requiredCollation;
3549
}
3650

3751
public function getNodeType(): string

src/Rules/Phinx/ForbidAfterRule.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@
1717
*/
1818
final class ForbidAfterRule extends PhinxRule
1919
{
20-
private const string RULE_IDENTIFIER = 'phinx.schema.afterForbidden';
20+
/**
21+
* @var string
22+
*/
23+
private const RULE_IDENTIFIER = 'phinx.schema.afterForbidden';
2124

22-
private const string MESSAGE =
25+
/**
26+
* @var string
27+
*/
28+
private const MESSAGE =
2329
'Forbidden: column positioning ("after"). '
2430
. 'Why: can trigger a full table rewrite or long locks depending on the engine. '
2531
. 'Fix: avoid column ordering in migrations.';

src/Rules/Phinx/ForbidMultipleTableCreationsRule.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@
1515
*/
1616
final class ForbidMultipleTableCreationsRule extends PhinxRule
1717
{
18-
private const string RULE_IDENTIFIER = 'phinx.schema.multipleTableCreationsForbidden';
18+
/**
19+
* @var string
20+
*/
21+
private const RULE_IDENTIFIER = 'phinx.schema.multipleTableCreationsForbidden';
1922

20-
private const string MESSAGE =
23+
/**
24+
* @var string
25+
*/
26+
private const MESSAGE =
2127
'Forbidden: creating multiple tables in a single migration. '
2228
. 'Why: reduces reviewability and rollback safety. '
2329
. 'Fix: split into one migration per table.';

0 commit comments

Comments
 (0)