Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/pull-request-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,41 @@ jobs:

- name: Running unit test
run: vendor/bin/phpunit --configuration phpunit.xml

php84-syntax-check:
name: PHP 8.4 syntax compatibility
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: composer
coverage: none

- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('composer.lock') }}

- name: Install dependencies
env:
COMPOSER_CACHE_DIR: /tmp/composer-cache
run: composer install --no-interaction --no-progress --prefer-dist

- name: Run Rector dry-run on changed PHP files
run: |
CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- '*.php')
if [ -z "$CHANGED" ]; then
echo "No PHP files changed."
exit 0
fi
echo "Changed PHP files:"
echo "$CHANGED"
vendor/bin/rector process --dry-run --no-progress-bar $CHANGED
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"nesbot/carbon": "^2.71",
"opis/closure": "~3.6",
"pda/pheanstalk": "~4.0",
"predis/predis": "^1.1",
"predis/predis": "3.3",
"symfony/browser-kit": "~6.4",
"symfony/console": "~6.4",
"symfony/css-selector": "~6.4",
Expand All @@ -35,7 +35,7 @@
"symfony/routing": "~6.4",
"symfony/security-core": "~6.4",
"symfony/translation": "~6.4",
"voku/portable-ascii": "~1.5"
"voku/portable-ascii": "2.0.3"
},
"replace": {
"illuminate/auth": "self.version",
Expand Down
8 changes: 7 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\Config\RectorConfig;
use Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector;
use Rector\Php84\Rector\FuncCall\AddEscapeArgumentRector;
use Rector\ValueObject\PhpVersion;
use Rector\Php83\Rector\BooleanAnd\JsonValidateRector;
use Rector\Php83\Rector\Class_\ReadOnlyAnonymousClassRector;
use Rector\Php83\Rector\ClassConst\AddTypeToConstRector;
Expand All @@ -13,6 +16,7 @@
use Rector\Php83\Rector\FuncCall\RemoveGetClassGetParentClassNoArgsRector;

return RectorConfig::configure()
->withPhpVersion(PhpVersion::PHP_84)
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
Expand All @@ -25,5 +29,7 @@
AddTypeToConstRector::class,
JsonValidateRector::class,
ReadOnlyAnonymousClassRector::class,
AddOverrideAttributeToOverriddenMethodsRector::class
AddOverrideAttributeToOverriddenMethodsRector::class,
ExplicitNullableParamTypeRector::class,
AddEscapeArgumentRector::class
]);
6 changes: 3 additions & 3 deletions src/Illuminate/Auth/Guard.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Guard {
*/
public function __construct(UserProviderInterface $provider,
SessionStore $session,
Request $request = null)
?Request $request = null)
{
$this->session = $session;
$this->request = $request;
Expand Down Expand Up @@ -269,7 +269,7 @@ public function validate(array $credentials = array())
* @param \Symfony\Component\HttpFoundation\Request $request
* @return \Symfony\Component\HttpFoundation\Response|null
*/
public function basic($field = 'email', Request $request = null)
public function basic($field = 'email', ?Request $request = null)
{
if ($this->check()) return;

Expand All @@ -290,7 +290,7 @@ public function basic($field = 'email', Request $request = null)
* @param \Symfony\Component\HttpFoundation\Request $request
* @return \Symfony\Component\HttpFoundation\Response|null
*/
public function onceBasic($field = 'email', Request $request = null)
public function onceBasic($field = 'email', ?Request $request = null)
{
$request = $request ?: $this->getRequest();

Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Auth/Reminders/PasswordBroker.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function __construct(ReminderRepositoryInterface $reminders,
* @param \Closure $callback
* @return string
*/
public function remind(array $credentials, Closure $callback = null): string
public function remind(array $credentials, ?Closure $callback = null): string
{
// First we will check to see if we found a user at the given credentials and
// if we did not we will redirect back to this current URI with a piece of
Expand Down Expand Up @@ -123,7 +123,7 @@ public function remind(array $credentials, Closure $callback = null): string
* @param Closure $callback
* @return void
*/
public function sendReminder(RemindableInterface $user, string $token, Closure $callback = null): void
public function sendReminder(RemindableInterface $user, string $token, ?Closure $callback = null): void
{
// We will use the reminder view that was given to the broker to display the
// password reminder e-mail. We'll pass a "token" variable into the views
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function boot()
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return void
*/
public function call($command, array $parameters = array(), OutputInterface $output = null)
public function call($command, array $parameters = array(), ?OutputInterface $output = null)
{
$parameters['command'] = $command;

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Console/ConfirmableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trait ConfirmableTrait {
* @param \Closure $callback
* @return bool
*/
public function confirmToProceed($warning = 'Application In Production!', Closure $callback = null)
public function confirmToProceed($warning = 'Application In Production!', ?Closure $callback = null)
{
$shouldConfirm = $callback ?: $this->getDefaultConfirmCallback();

Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static function getInstance(): Container
*
* @param Container|null $container
*/
public static function setInstance(Container $container = null): ?Container
public static function setInstance(?Container $container = null): ?Container
{
return static::$instance = $container;
}
Expand Down Expand Up @@ -1169,7 +1169,7 @@ protected function keyParametersByArgument(array $dependencies, array $parameter
* @param \Closure|null $callback
* @return void
*/
public function beforeResolving($abstract, Closure $callback = null)
public function beforeResolving($abstract, ?Closure $callback = null)
{
if (is_string($abstract)) {
$abstract = $this->getAlias($abstract);
Expand All @@ -1189,7 +1189,7 @@ public function beforeResolving($abstract, Closure $callback = null)
* @param \Closure $callback
* @return void
*/
public function resolving($abstract, Closure $callback = null): void
public function resolving($abstract, ?Closure $callback = null): void
{
if (is_string($abstract)) {
$abstract = $this->getAlias($abstract);
Expand All @@ -1212,7 +1212,7 @@ public function resolving($abstract, Closure $callback = null): void
* @param \Closure|null $callback
* @return void
*/
public function afterResolving($abstract, Closure $callback = null)
public function afterResolving($abstract, ?Closure $callback = null)
{
if (is_string($abstract)) {
$abstract = $this->getAlias($abstract);
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Capsule/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Manager {
* @param \Illuminate\Container\Container|null $container
* @return void
*/
public function __construct(Container $container = null)
public function __construct(?Container $container = null)
{
$this->setupContainer($container);

Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ public function orWhere($column, $operator = null, $value = null)
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null)
public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', ?Closure $callback = null)
{
if (strpos($relation, '.') !== false)
{
Expand Down Expand Up @@ -652,7 +652,7 @@ protected function hasNested($relations, $operator = '>=', $count = 1, $boolean
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function doesntHave($relation, $boolean = 'and', Closure $callback = null)
public function doesntHave($relation, $boolean = 'and', ?Closure $callback = null)
{
return $this->has($relation, '<', 1, $boolean, $callback);
}
Expand All @@ -678,7 +678,7 @@ public function whereHas($relation, Closure $callback, $operator = '>=', $count
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function whereDoesntHave($relation, Closure $callback = null)
public function whereDoesntHave($relation, ?Closure $callback = null)
{
return $this->doesntHave($relation, 'and', $callback);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2670,7 +2670,7 @@ protected function getDateFormat():string
* @param array $except
* @return Model
*/
public function replicate(array $except = null):Model
public function replicate(?array $except = null):Model
{
$except = $except ?: [
$this->getKeyName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getRelationCountQuery(Builder $query, Builder $parent)
* @param \Illuminate\Database\Eloquent\Builder|null $query
* @return void
*/
protected function setJoin(Builder $query = null)
protected function setJoin(?Builder $query = null)
{
$query = $query ?: $this->query;

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Blueprint {
* @param \Closure $callback
* @return void
*/
public function __construct($table, Closure $callback = null)
public function __construct($table, ?Closure $callback = null)
{
$this->table = $table;

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function build(Blueprint $blueprint)
* @param \Closure $callback
* @return \Illuminate\Database\Schema\Blueprint
*/
protected function createBlueprint($table, Closure $callback = null)
protected function createBlueprint($table, ?Closure $callback = null)
{
if (isset($this->resolver))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Events/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Dispatcher {
* @param \Illuminate\Container\Container $container
* @return void
*/
public function __construct(Container $container = null)
public function __construct(?Container $container = null)
{
$this->container = $container ?: new Container;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Application extends Container implements HttpKernelInterface, TerminableIn
* @param \Illuminate\Http\Request $request
* @return void
*/
public function __construct(Request $request = null)
public function __construct(?Request $request = null)
{
$this->registerBaseBindings($request ?: $this->createNewRequest());

Expand Down Expand Up @@ -550,7 +550,7 @@ public function finish($callback)
* @param callable $callback
* @return void
*/
public function shutdown(callable $callback = null)
public function shutdown(?callable $callback = null)
{
if (is_null($callback))
{
Expand Down Expand Up @@ -647,7 +647,7 @@ public function booted($callback)
* @param \Symfony\Component\HttpFoundation\Request $request
* @return void
*/
public function run(SymfonyRequest $request = null)
public function run(?SymfonyRequest $request = null)
{
$request = $request ?: $this['request'];

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Html/HtmlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class HtmlBuilder {
* @param \Illuminate\Routing\UrlGenerator $url
* @return void
*/
public function __construct(UrlGenerator $url = null)
public function __construct(?UrlGenerator $url = null)
{
$this->url = $url;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Http/RedirectResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function withCookies(array $cookies)
* @param array $input
* @return $this
*/
public function withInput(array $input = null)
public function withInput(?array $input = null)
{
$input = $input ?: $this->request->input();

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Log/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Writer {
* @param \Illuminate\Events\Dispatcher $dispatcher
* @return void
*/
public function __construct(MonologLogger $monolog, Dispatcher $dispatcher = null)
public function __construct(MonologLogger $monolog, ?Dispatcher $dispatcher = null)
{
$this->monolog = $monolog;

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Mail/Transport/ArrayTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct()
/**
* {@inheritdoc}
*/
public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage
public function send(RawMessage $message, ?Envelope $envelope = null): ?SentMessage
{
return $this->messages[] = new SentMessage($message, $envelope ?? Envelope::create($message));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/Capsule/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Manager {
* @param \Illuminate\Container\Container $container
* @return void
*/
public function __construct(Container $container = null)
public function __construct(?Container $container = null)
{
$this->setupContainer($container);

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/IronQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function pushRaw($payload, $queue = null, array $options = array())
* @param int $delay
* @return mixed
*/
public function recreate($payload, $queue = null, $delay)
public function recreate($payload, $queue = null, $delay = 0)
{
$options = array('delay' => $this->getSeconds($delay));

Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Queue/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class Worker {
* @return void
*/
public function __construct(QueueManager $manager,
FailedJobProviderInterface $failer = null,
Dispatcher $events = null)
?FailedJobProviderInterface $failer = null,
?Dispatcher $events = null)
{
$this->failer = $failer;
$this->events = $events;
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Routing/ControllerDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ControllerDispatcher {
* @return void
*/
public function __construct(RouteFiltererInterface $filterer,
Container $container = null)
?Container $container = null)
{
$this->filterer = $filterer;
$this->container = $container;
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Router implements HttpKernelInterface, RouteFiltererInterface {
*
* @return void
*/
public function __construct(Dispatcher $events, Container $container = null)
public function __construct(Dispatcher $events, ?Container $container = null)
{
$this->events = $events;
$this->routes = new RouteCollection;
Expand Down Expand Up @@ -1241,7 +1241,7 @@ public function whenRegex($pattern, $name, $methods = null)
*
* @throws NotFoundHttpException
*/
public function model($key, $class, Closure $callback = null)
public function model($key, $class, ?Closure $callback = null)
{
$this->bind($key, function($value) use ($class, $callback)
{
Expand Down
Loading
Loading