Skip to content

Commit

Permalink
Merge branch 'release/4.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lindyhopchris committed Nov 30, 2024
2 parents 0aef20a + fa0addc commit 5ef2e85
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.2, 8.3]
php: [8.2, 8.3, 8.4]
laravel: [11]

steps:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. This projec

## Unreleased

## [4.1.1] - 2024-11-30

### Fixed

- Remove deprecation notices in PHP 8.4.

## [4.1.0] - 2024-06-26

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ See our website, [laraveljsonapi.io](https://laraveljsonapi.io)
### Tutorial

New to JSON:API and/or Laravel JSON:API? Then
the [Laravel JSON:API tutorial](https://laraveljsonapi.io/docs/2.0/tutorial/)
the [Laravel JSON:API tutorial](https://laraveljsonapi.io/4.x/tutorial/)
is a great way to learn!

Follow the tutorial to build a blog application with a JSON:API compliant API.
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
"require": {
"php": "^8.2",
"ext-json": "*",
"laravel-json-api/core": "^4.1",
"laravel-json-api/eloquent": "^4.1",
"laravel-json-api/encoder-neomerx": "^4.0",
"laravel-json-api/exceptions": "^3.0",
"laravel-json-api/spec": "^3.0",
"laravel-json-api/validation": "^4.0",
"laravel-json-api/core": "^4.3.2",
"laravel-json-api/eloquent": "^4.4",
"laravel-json-api/encoder-neomerx": "^4.1",
"laravel-json-api/exceptions": "^3.1",
"laravel-json-api/spec": "^3.1",
"laravel-json-api/validation": "^4.2",
"laravel/framework": "^11.0"
},
"require-dev": {
"laravel-json-api/testing": "^3.0",
"laravel-json-api/testing": "^3.0.2",
"orchestra/testbench": "^9.0",
"phpunit/phpunit": "^10.5"
},
Expand Down
21 changes: 16 additions & 5 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false"
beStrictAboutTestsThatDoNotTestAnything="true" bootstrap="vendor/autoload.php" colors="true"
processIsolation="false" stopOnError="false" stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
beStrictAboutTestsThatDoNotTestAnything="true"
bootstrap="vendor/autoload.php"
colors="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
failOnWarning="true"
failOnDeprecation="true"
failOnNotice="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
>
<coverage/>
<testsuites>
<testsuite name="Unit">
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/HttpNotAcceptableException.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class HttpNotAcceptableException extends HttpException
* @param int $code
*/
public function __construct(
string $message = null,
Throwable $previous = null,
?string $message = null,
?Throwable $previous = null,
array $headers = [],
int $code = 0
) {
Expand Down
16 changes: 8 additions & 8 deletions src/Routing/ActionRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct(
string $resourceType,
array $options,
string $controller,
string $prefix = null
?string $prefix = null
) {
$this->router = $router;
$this->resource = $resource;
Expand Down Expand Up @@ -106,7 +106,7 @@ public function withId(): self
* @param string|null $method
* @return ActionProxy
*/
public function get(string $uri, string $method = null): ActionProxy
public function get(string $uri, ?string $method = null): ActionProxy
{
return $this->register('get', $uri, $method);
}
Expand All @@ -118,7 +118,7 @@ public function get(string $uri, string $method = null): ActionProxy
* @param string|null $method
* @return ActionProxy
*/
public function post(string $uri, string $method = null): ActionProxy
public function post(string $uri, ?string $method = null): ActionProxy
{
return $this->register('post', $uri, $method);
}
Expand All @@ -130,7 +130,7 @@ public function post(string $uri, string $method = null): ActionProxy
* @param string|null $method
* @return ActionProxy
*/
public function patch(string $uri, string $method = null): ActionProxy
public function patch(string $uri, ?string $method = null): ActionProxy
{
return $this->register('patch', $uri, $method);
}
Expand All @@ -142,7 +142,7 @@ public function patch(string $uri, string $method = null): ActionProxy
* @param string|null $method
* @return ActionProxy
*/
public function put(string $uri, string $method = null): ActionProxy
public function put(string $uri, ?string $method = null): ActionProxy
{
return $this->register('put', $uri, $method);
}
Expand All @@ -154,7 +154,7 @@ public function put(string $uri, string $method = null): ActionProxy
* @param string|null $method
* @return ActionProxy
*/
public function delete(string $uri, string $method = null): ActionProxy
public function delete(string $uri, ?string $method = null): ActionProxy
{
return $this->register('delete', $uri, $method);
}
Expand All @@ -166,7 +166,7 @@ public function delete(string $uri, string $method = null): ActionProxy
* @param string|null $method
* @return ActionProxy
*/
public function options(string $uri, string $method = null): ActionProxy
public function options(string $uri, ?string $method = null): ActionProxy
{
return $this->register('options', $uri, $method);
}
Expand All @@ -177,7 +177,7 @@ public function options(string $uri, string $method = null): ActionProxy
* @param string|null $action
* @return ActionProxy
*/
public function register(string $method, string $uri, string $action = null): ActionProxy
public function register(string $method, string $uri, ?string $action = null): ActionProxy
{
$action = $action ?: $this->guessControllerAction($uri);
$parameter = $this->getParameter();
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/PendingResourceRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function relationships(Closure $callback): self
* @param Closure|null $callback
* @return $this
*/
public function actions($prefixOrCallback, Closure $callback = null): self
public function actions($prefixOrCallback, ?Closure $callback = null): self
{
if ($prefixOrCallback instanceof Closure && null === $callback) {
$this->actionsPrefix = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/ResourceRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(RegistrarContract $router, Server $server)
* @param string|null $controller
* @return PendingResourceRegistration
*/
public function resource(string $resourceType, string $controller = null): PendingResourceRegistration
public function resource(string $resourceType, ?string $controller = null): PendingResourceRegistration
{
return new PendingResourceRegistration(
$this,
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/Integration/Routing/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ protected function createServer(string $name): Server
protected function createSchema(
Server $server,
string $name,
string $pattern = null,
string $uriType = null
?string $pattern = null,
?string $uriType = null
): Schema
{
$schema = $this->createMock(Schema::class);
Expand All @@ -89,7 +89,7 @@ protected function createSchema(
* @param string|null $uriName
* @return void
*/
protected function createRelation(MockObject $schema, string $fieldName, string $uriName = null): void
protected function createRelation(MockObject $schema, string $fieldName, ?string $uriName = null): void
{
$relation = $this->createMock(Relation::class);
$relation->method('name')->willReturn($fieldName);
Expand Down

0 comments on commit 5ef2e85

Please sign in to comment.