Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.7] Include null in the return types hints of InteractsWithInput #25954

Merged
merged 1 commit into from
Oct 5, 2018

Conversation

Korri
Copy link
Contributor

@Korri Korri commented Oct 5, 2018

The return value can be null in a few cases:

  • when it return $default
  • when a middleware converts empty strings to null

This PR is mostly so it stops confusing programs like PHPStan

The return value can be null in a few cases:

* when it return `$default`
* when a middleware converts empty strings to null

This PR is mostly so it stops confusing PHPStan
@taylorotwell taylorotwell merged commit b4fe271 into laravel:5.7 Oct 5, 2018
@GrahamCampbell GrahamCampbell changed the title Include null in the return types hints of InteractsWithInput [5.7] Include null in the return types hints of InteractsWithInput Oct 11, 2018
taylorotwell pushed a commit that referenced this pull request Oct 31, 2018
* [5.7] Updating AbstractPaginator::appends to handle null

This method is most commonly used with `$request->query()` which recently changed docblock [1] also to return `null`. Same as original commit, this is to make PHPStan happy.

```
$events = $query->paginate($perPage);
$events->appends($request->query());
```

[1] #25954

* Removing whitespace
taylorotwell pushed a commit to illuminate/pagination that referenced this pull request Oct 31, 2018
* [5.7] Updating AbstractPaginator::appends to handle null

This method is most commonly used with `$request->query()` which recently changed docblock [1] also to return `null`. Same as original commit, this is to make PHPStan happy.

```
$events = $query->paginate($perPage);
$events->appends($request->query());
```

[1] laravel/framework#25954

* Removing whitespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants