Skip to content

Commit faa11e8

Browse files
committed
[skip ci] Update router attribute constructors and PHP requirement
Changed default constructor parameters in router attribute classes to use nullable types and non-nullable defaults for booleans and arrays. Updated minimum PHP version requirement in composer.json to 8.1 for improved type safety and compatibility.
1 parent 7475943 commit faa11e8

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"php-framework"
1212
],
1313
"require": {
14-
"php": ">=8.0",
14+
"php": ">=8.1",
1515
"phpmv/ubiquity": "^2.4 || dev-316-connect-to-microsoft-access"
1616
},
1717
"license": "Apache-2.0",

src/Ubiquity/attributes/items/router/Delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Delete extends Route {
1919
/**
2020
* Delete constructor.
2121
*/
22-
public function __construct(string $path = '', string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
22+
public function __construct(string $path = '', ?string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
2323
parent::__construct($path, ['delete'], $name, $cache, $duration, $inherited, $automated, $requirements, $priority);
2424
}
2525
}

src/Ubiquity/attributes/items/router/Get.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* This class is part of Ubiquity
1515
*
1616
* @author jcheron <myaddressmail@gmail.com>
17-
* @version 1.0.0
17+
* @version 1.0.1
1818
*
1919
*/
2020
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
@@ -23,7 +23,7 @@ class Get extends Route {
2323
/**
2424
* Get constructor.
2525
*/
26-
public function __construct(string $path = '', string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
26+
public function __construct(string $path = '', ?string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
2727
parent::__construct($path, ['get'], $name, $cache, $duration, $inherited, $automated, $requirements, $priority);
2828
}
2929
}

src/Ubiquity/attributes/items/router/Options.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* This class is part of Ubiquity
1111
*
1212
* @author jcheron <myaddressmail@gmail.com>
13-
* @version 1.0.0
13+
* @version 1.0.1
1414
*
1515
*/
1616
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
@@ -19,7 +19,7 @@ class Options extends Route {
1919
/**
2020
* Options constructor.
2121
*/
22-
public function __construct(string $path = '', string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
22+
public function __construct(string $path = '', ?string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
2323
parent::__construct($path, ['options'], $name, $cache, $duration, $inherited, $automated, $requirements, $priority);
2424
}
2525
}

src/Ubiquity/attributes/items/router/Patch.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* This class is part of Ubiquity
1111
*
1212
* @author jcheron <myaddressmail@gmail.com>
13-
* @version 1.0.0
13+
* @version 1.0.1
1414
*
1515
*/
1616
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
@@ -19,7 +19,7 @@ class Patch extends Route {
1919
/**
2020
* Patch constructor.
2121
*/
22-
public function __construct(string $path = '', string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
22+
public function __construct(string $path = '', ?string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
2323
parent::__construct($path, ['patch'], $name, $cache, $duration, $inherited, $automated, $requirements, $priority);
2424
}
2525
}

src/Ubiquity/attributes/items/router/Post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* This class is part of Ubiquity
1111
*
1212
* @author jcheron <myaddressmail@gmail.com>
13-
* @version 1.0.0
13+
* @version 1.0.1
1414
*
1515
*/
1616
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
@@ -19,7 +19,7 @@ class Post extends Route {
1919
/**
2020
* Post constructor.
2121
*/
22-
public function __construct(string $path = '', string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
22+
public function __construct(string $path = '', ?string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
2323
parent::__construct($path, ['post'], $name, $cache, $duration, $inherited, $automated, $requirements, $priority);
2424
}
2525
}

src/Ubiquity/attributes/items/router/Put.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Put extends Route {
1919
/**
2020
* Put constructor.
2121
*/
22-
public function __construct(string $path = '', string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
22+
public function __construct(string $path = '', ?string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
2323
parent::__construct($path, ['put'], $name, $cache, $duration, $inherited, $automated, $requirements, $priority);
2424
}
2525
}

src/Ubiquity/attributes/items/router/Route.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Route extends BaseAttribute {
3434
public array $requirements;
3535
public int $priority;
3636

37-
public function __construct(string $path = '', ?array $methods = null, ?string $name = null, ?bool $cache = false, ?int $duration = 0, ?bool $inherited = false, ?bool $automated = false, ?array $requirements = [], int $priority = 0) {
37+
public function __construct(string $path = '', ?array $methods = null, ?string $name = null, bool $cache = false, int $duration = 0, bool $inherited = false, bool $automated = false, array $requirements = [], int $priority = 0) {
3838
$this->path = $path ?? '';
3939
$this->methods = $methods;
4040
$this->name = $name;

0 commit comments

Comments
 (0)