Skip to content

Commit b444848

Browse files
authored
Merge pull request #13 from dicoding-dev/feature/php82
Upgrade to support PHP 8.2
2 parents 2dc9dc0 + ae8382f commit b444848

File tree

20 files changed

+121
-29
lines changed

20 files changed

+121
-29
lines changed

.github/workflows/pull-request-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
- name: Installing dependencies
1919
uses: php-actions/composer@v6
2020
with:
21-
php_version: 8.1
21+
php_version: 8.2
2222

2323
- name: Running unit test
2424
uses: php-actions/phpunit@v3
2525
with:
2626
version: 9.6
27-
php_version: 8.1
27+
php_version: 8.2
2828
configuration: phpunit.xml

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=8.1.0",
13+
"php": ">=8.2.0",
1414
"d11wtq/boris": "~1.0",
1515
"filp/whoops": "~2.11",
1616
"ircmaxell/password-compat": "~1.0",
1717
"laravel/serializable-closure": "^1.2",
18-
"monolog/monolog": "~1.6",
18+
"monolog/monolog": "^2.10",
1919
"nesbot/carbon": "^2.71",
2020
"opis/closure": "~3.6",
2121
"pda/pheanstalk": "~4.0",
@@ -70,8 +70,9 @@
7070
},
7171
"require-dev": {
7272
"mockery/mockery": "~1.3",
73-
"phpunit/phpunit": "~9.6",
7473
"phpspec/prophecy-phpunit": "~2.0",
74+
"phpunit/phpunit": "~9.6",
75+
"rector/rector": "^2.1",
7576
"symfony/var-dumper": "~6.4"
7677
},
7778
"autoload": {

rector.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
7+
return RectorConfig::configure()
8+
->withPaths([
9+
__DIR__ . '/src',
10+
__DIR__ . '/tests',
11+
])
12+
->withRules([
13+
\Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class,
14+
\Rector\Php82\Rector\FuncCall\Utf8DecodeEncodeToMbConvertEncodingRector::class,
15+
\Rector\Php82\Rector\New_\FilesystemIteratorSkipDotsRector::class,
16+
\Rector\Php82\Rector\Class_\ReadOnlyClassRector::class,
17+
\Rector\Php82\Rector\Encapsed\VariableInStringInterpolationFixerRector::class,
18+
]);

src/Illuminate/Database/Query/Builder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,14 +1786,12 @@ public function getPaginationCount()
17861786
* @param array $columns
17871787
* @return \Illuminate\Pagination\Paginator
17881788
*/
1789-
public function simplePaginate($perPage = null, $columns = array('*'))
1789+
public function simplePaginate($perPage = 15, $columns = array('*'))
17901790
{
17911791
$paginator = $this->connection->getPaginator();
17921792

17931793
$page = $paginator->getCurrentPage();
17941794

1795-
$perPage = $perPage ?: $this->model->getPerPage();
1796-
17971795
$this->skip(($page - 1) * $perPage)->take($perPage + 1);
17981796

17991797
return $paginator->make($this->get($columns), $perPage);

src/Illuminate/Database/QueryException.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
class QueryException extends PDOException {
66

77
/**
8+
* @var \Exception
9+
*/
10+
protected $previous;
11+
12+
/**
813
* The SQL for the query.
914
*
1015
* @var string

src/Illuminate/Database/Schema/Grammars/Grammar.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212
abstract class Grammar extends BaseGrammar {
1313

14-
/**
14+
/**
15+
* @var array
16+
*/
17+
protected $modifiers;
18+
19+
/**
1520
* Compile a rename column command.
1621
*
1722
* @param \Illuminate\Database\Schema\Blueprint $blueprint

src/Illuminate/Foundation/Console/CommandMakeCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
class CommandMakeCommand extends Command {
99

10-
/**
10+
protected Filesystem $files;
11+
12+
/**
1113
* The console command name.
1214
*
1315
* @var string

src/Illuminate/Foundation/Console/KeyGenerateCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
class KeyGenerateCommand extends Command {
88

9-
/**
9+
protected Filesystem $files;
10+
11+
/**
1012
* The console command name.
1113
*
1214
* @var string

src/Illuminate/Foundation/MigrationPublisher.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
class MigrationPublisher {
77

8-
/**
8+
protected Filesystem $files;
9+
10+
/**
911
* A cache of migrations at a given destination.
1012
*
1113
* @var array

src/Illuminate/Log/Writer.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,6 @@ public function __call($method, $parameters)
275275

276276
call_user_func_array($this->fireLogEvent(...), array_merge(array($method), $parameters));
277277

278-
$method = 'add'.ucfirst($method);
279-
280278
return $this->callMonolog($method, $parameters);
281279
}
282280

0 commit comments

Comments
 (0)