Skip to content

Commit d24e598

Browse files
authored
(Changed) Update to PHP 8.3 and Enforce Explicit Type Declarations (#43)
* chore!: Set minimum required PHP version to 8.3 - Remove references to PHP 8.2 in workflows and configuration files - Update composer constraints to reflect the new requirement - Align development and production environments with PHP 8.3 BREAKING CHANGE: Environments must now use PHP 8.3 or higher. * style: Add type hints and formatting - Introduce explicit type declarations for clarity and type safety - Remove redundant comments to streamline the code - Correct formatting for improved readability and consistency These changes align the codebase with established style guidelines, making it easier to maintain and collaborate on.
1 parent 678d6d8 commit d24e598

16 files changed

Lines changed: 27 additions & 48 deletions

.github/workflows/codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
with:
1010
fetch-depth: 0
1111

12-
- name: Set up php 8.2
12+
- name: Set up php 8.3
1313
uses: shivammathur/setup-php@v2
1414
with:
15-
php-version: "8.2"
15+
php-version: "8.3"
1616
extensions: mbstring, xml, zip, pdo_mysql, xhprof
1717

1818
- name: Install dependencies

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
php-versions: ["8.2", "8.3", "8.4"]
18+
php-versions: ["8.3", "8.4"]
1919

2020
steps:
2121
# This step checks out a copy of your repository.

.phan/config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
//
5555
// Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist.
5656
// (See `backward_compatibility_checks` for additional options)
57-
// Automatically inferred from composer.json requirement for "php" of "^8.2"
58-
'target_php_version' => '8.2',
57+
// Automatically inferred from composer.json requirement for "php" of "^8.3"
58+
'target_php_version' => '8.3',
5959

6060
// If enabled, missing properties will be created when
6161
// they are first seen. If false, we'll report an

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ And to run tests matching a specific name pattern:
209209

210210
## System Requirements
211211

212-
- PHP 8.2 or later.
212+
- PHP 8.3 or later.
213213

214214
## Support
215215

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"minimum-stability": "stable",
4444
"require": {
45-
"php": ">=8.2.0|>=8.3.0|>=8.4.0"
45+
"php": ">=8.3.0|>=8.4.0"
4646
},
4747
"require-dev": {
4848
"enlightn/security-checker": ">=2.0",

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
parameters:
22
level: max
3-
phpVersion: 80200
3+
phpVersion: 80300
44
treatPhpDocTypesAsCertain: false
55
tipsOfTheDay: false
66
reportWrongPhpDocTypeInVarTag: true

rector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@
4343
$rectorConfig->rule(SeparateMultiUseImportsRector::class);
4444
$rectorConfig->rule(SplitDoubleAssignRector::class);
4545

46-
$rectorConfig->phpVersion(PhpVersion::PHP_82);
46+
$rectorConfig->phpVersion(PhpVersion::PHP_83);
4747

4848
// define sets of rules
4949
$rectorConfig->sets(
5050
[
51-
LevelSetList::UP_TO_PHP_82,
51+
LevelSetList::UP_TO_PHP_83,
5252
SetList::CODE_QUALITY,
5353
SetList::CODING_STYLE,
5454
SetList::DEAD_CODE,
5555
SetList::EARLY_RETURN,
56-
SetList::PHP_82,
56+
SetList::PHP_83,
5757
SetList::TYPE_DECLARATION,
5858
SetList::NAMING,
5959
SetList::PRIVATIZATION,

src/AccentNormalization.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ trait AccentNormalization
2525
/**
2626
* An array of characters with accents and special characters. These characters are intended to be replaced
2727
* in a string to normalize it.
28-
*
29-
* @var string[]
3028
*/
31-
private const REMOVE_ACCENTS_FROM = [
29+
private const array REMOVE_ACCENTS_FROM = [
3230
'*',
3331
'?',
3432
'',
@@ -271,10 +269,8 @@ trait AccentNormalization
271269
/**
272270
* An array of characters without accents. These characters correspond to the characters in the
273271
* REMOVE_ACCENTS_FROM array and are used to replace them in a string.
274-
*
275-
* @var string[]
276272
*/
277-
private const REMOVE_ACCENTS_TO = [
273+
private const array REMOVE_ACCENTS_TO = [
278274
' ',
279275
' ',
280276
"'",

src/StringManipulation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public static function nameFix(#[SensitiveParameter] ?string $lastName): ?string
194194
* processing text for storage in a database or file system that does not support UTF-8 encoding.
195195
*
196196
* @param null|string $valor The input string to be converted from UTF-8 to ANSI. If null, the function will return
197-
* an empty string.
197+
* an empty string.
198198
*
199199
* @return string The converted string in ANSI encoding.
200200
*
@@ -282,7 +282,7 @@ public static function strReplace(array|string $search, array|string $replace, s
282282
*
283283
* @param string $date The date string to validate. This should be a string representing a date.
284284
* @param string $format The expected date format. Default is 'Y-m-d H:i:s'. This should be a string representing
285-
* the expected format of the date.
285+
* the expected format of the date.
286286
*
287287
* @return bool Returns true if the date string matches the format and is logically valid, false otherwise.
288288
*

src/UnicodeMappings.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ trait UnicodeMappings
2424
/**
2525
* An associative array mapping Unicode characters to their ANSI counterparts.
2626
* The keys of the array are Unicode characters, and the values are the corresponding ANSI characters.
27-
*
28-
* @var array<string, string>
2927
*/
30-
private const UTF8_ANSI2 = [
28+
private const array UTF8_ANSI2 = [
3129
'\u00c0' => 'À',
3230
'\u00c1' => 'Á',
3331
'\u00c2' => 'Â',

0 commit comments

Comments
 (0)