Skip to content

Commit 1965484

Browse files
committed
Bump minimum PHP to 7.3
1 parent 658c1c2 commit 1965484

File tree

18 files changed

+53
-84
lines changed

18 files changed

+53
-84
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-24.04
1010
strategy:
1111
matrix:
12-
php: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
12+
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1313
name: PHP ${{ matrix.php }}
1414
steps:
1515
- uses: actions/checkout@v6
@@ -32,7 +32,7 @@ jobs:
3232
fetch-depth: 5
3333
- uses: shivammathur/setup-php@v2
3434
with:
35-
php-version: '7.3'
35+
php-version: '7.4'
3636
tools: composer:2
3737
coverage: none
3838
- run: composer update --no-progress --prefer-lowest

.php-cs-fixer.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,34 @@
22

33
use PhpCsFixer\Config;
44
use PhpCsFixer\Finder;
5+
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
56

67
$finder = Finder::create()
78
->exclude('vendor')
89
->in(__DIR__)
910
;
1011

1112
$config = new Config();
12-
return $config->setRules([
13+
return $config
14+
->setParallelConfig(ParallelConfigFactory::detect())
15+
->setRules([
1316
'@PSR12' => true,
1417
'@PSR12:risky' => true,
1518
'@PhpCsFixer' => true,
1619
'@PhpCsFixer:risky' => true,
1720
'@PHP71Migration' => true,
1821
'@PHP71Migration:risky' => true,
1922
'@PHP73Migration' => true,
23+
'@PHP74Migration' => true,
24+
'@PHP74Migration:risky' => true,
2025
'@PHPUnit75Migration:risky' => true,
2126
'@PHPUnit7x5Migration:risky' => true,
2227
'@PHPUnit84Migration:risky' => true,
2328
'@PHPUnit8x4Migration:risky' => true,
2429
'@PHPUnit91Migration:risky' => true,
2530
'@PHPUnit9x1Migration:risky' => true,
31+
'@PHPUnit100Migration:risky' => true,
32+
'@PHPUnit10x0Migration:risky' => true,
2633
'array_syntax' => ['syntax' => 'short'],
2734
'php_unit_test_class_requires_covers' => false,
2835
'backtick_to_shell_exec' => true,

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
}
2323
],
2424
"require": {
25-
"php": "^7.3 || ^8.0",
25+
"php": "^7.4 || ^8.0",
2626
"ext-json": "*",
2727
"ext-pdo": "*"
2828
},
2929
"require-dev": {
30-
"friendsofphp/php-cs-fixer": "^3.0",
31-
"phpstan/phpstan": "^1.12",
32-
"phpstan/phpstan-phpunit": "^1.0",
33-
"phpstan/phpstan-strict-rules": "^1.0",
34-
"phpunit/phpunit": "^9.1 || ^10.0"
30+
"friendsofphp/php-cs-fixer": "^3.57",
31+
"phpstan/phpstan": "^2.0",
32+
"phpstan/phpstan-phpunit": "^2.0",
33+
"phpstan/phpstan-strict-rules": "^2.0",
34+
"phpunit/phpunit": "^10.0"
3535
},
3636
"config": {
3737
"sort-packages": true

lib/MC/Google/Visualization.php

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,40 +55,34 @@ class Visualization
5555
/**
5656
* The default entity that will be used if the "from" part of a query is left out. Setting this to null
5757
* will make a "from" clause required.
58-
*
59-
* @var null|string
6058
*/
61-
protected $defaultEntity;
59+
protected ?string $defaultEntity = null;
6260

6361
/**
6462
* The entity schema that defines which tables are exposed to visualization clients, along with their fields, joins, and callbacks.
6563
*
6664
* @var array<string, Entity>
6765
*/
68-
protected $entities = [];
66+
protected array $entities = [];
6967

7068
/**
7169
* If pivots are being used or MC_Google_Visualization is handling the whole request, this must be a PDO
7270
* connection to your database.
73-
*
74-
* @var null|PDO
7571
*/
76-
protected $db;
72+
protected ?PDO $db;
7773

7874
/**
7975
* The SQL dialect to use when auto-generating SQL statements from the parsed query tokens
8076
* defaults to "mysql". Allowed values are "mysql", "postgres", or "sqlite". Patches are welcome for the rest.
81-
*
82-
* @var string
8377
*/
84-
protected $sqlDialect = 'mysql';
78+
protected string $sqlDialect = 'mysql';
8579

8680
/**
8781
* If a format string is not provided by the query, these will be used to format values by default.
8882
*
8983
* @var array<string, string>
9084
*/
91-
protected $defaultFormat = [
85+
protected array $defaultFormat = [
9286
'date' => 'm/d/Y',
9387
'datetime' => 'm/d/Y h:ia',
9488
'time' => 'h:ia',
@@ -98,10 +92,8 @@ class Visualization
9892

9993
/**
10094
* The current supported version of the Data Source protocol.
101-
*
102-
* @var float
10395
*/
104-
protected $version = 0.5;
96+
protected float $version = 0.5;
10597

10698
/**
10799
* Create a new instance. This must be done before the library can be used. Pass in a PDO connection and
@@ -1007,7 +999,6 @@ protected function generateSQL(array &$meta): string
1007999
$stmt = $this->db->query($pivotSql);
10081000
assert(false !== $stmt);
10091001
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
1010-
assert(false !== $rows);
10111002
foreach ($rows as $row) {
10121003
// Create a version of all function-ed fields for each unique combination of pivot values
10131004
foreach ($funcFields as $field) {

lib/MC/Google/Visualization_Error.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
class Visualization_Error extends Exception
1010
{
11-
/** @var string */
12-
public $type = 'server_error';
11+
public string $type = 'server_error';
1312

14-
/** @var string */
15-
public $summary = 'Server Error';
13+
public string $summary = 'Server Error';
1614
}

lib/MC/Google/Visualization_QueryError.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
class Visualization_QueryError extends Visualization_Error
88
{
9-
/** @var string */
10-
public $type = 'invalid_query';
9+
public string $type = 'invalid_query';
1110

12-
/** @var string */
13-
public $summary = 'Invalid Query';
11+
public string $summary = 'Invalid Query';
1412
}

lib/MC/Parser.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ class Parser
2525
{
2626
/**
2727
* By default, the parser ignores these characters when they occur between tokens.
28-
*
29-
* @var string
3028
*/
31-
public static $whitespace = " \t\n\r";
29+
public static string $whitespace = " \t\n\r";
3230

3331
/**
3432
* Return a Set with the function arguments as the subexpressions.

lib/MC/Parser/Def.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
*/
1313
abstract class Def
1414
{
15-
/** @var null|string */
16-
public $name;
15+
public ?string $name = null;
1716

18-
/** @var bool */
19-
public $suppress = false;
17+
public bool $suppress = false;
2018

2119
/**
2220
* Parse a string, and return the result or throw a parser exception.

lib/MC/Parser/Def/IsEmpty.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
*/
1212
class IsEmpty extends Def
1313
{
14-
/** @var bool */
15-
public $suppress = true;
14+
public bool $suppress = true;
1615

1716
public function _parse(string $str, int $loc): array
1817
{

lib/MC/Parser/Def/Literal.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,22 @@
1010

1111
class Literal extends Def
1212
{
13-
/** @var string */
14-
public $search;
13+
public string $search;
1514

16-
/** @var bool */
17-
public $caseless = false;
15+
public bool $caseless = false;
1816

19-
/** @var bool */
20-
public $fullword = true;
17+
public bool $fullword = true;
2118

2219
/**
2320
* Match against an exact set of characters in the string.
2421
*
25-
* @param string $str the search string
22+
* @param string $search the search string
2623
* @param bool $caseless set to true to ignore case
2724
* @param bool $fullword set to false to allow a literal followed by a non-whitespace character
2825
*/
29-
public function __construct(string $str, bool $caseless = false, bool $fullword = true)
26+
public function __construct(string $search, bool $caseless = false, bool $fullword = true)
3027
{
31-
$this->search = $str;
28+
$this->search = $search;
3229
$this->caseless = $caseless;
3330
$this->fullword = $fullword;
3431
}

0 commit comments

Comments
 (0)