Skip to content

Commit 77f8f02

Browse files
authored
Merge pull request #113 from neoighodaro/patch-1
Fixed deprecation notices in PHP 8.4
2 parents 8f85ba2 + 4684c61 commit 77f8f02

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Batch.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(DatabaseManager $db)
5353
* @createdBy Mohammad Ghanbari <mavin.developer@gmail.com>
5454
* @updatedBy Ibrahim Sakr <ebrahimes@gmail.com>
5555
*/
56-
public function update(Model $table, array $values, string $index = null, bool $raw = false)
56+
public function update(Model $table, array $values, string|null $index = null, bool $raw = false)
5757
{
5858
$final = [];
5959
$ids = [];
@@ -170,7 +170,7 @@ public function update(Model $table, array $values, string $index = null, bool $
170170
* $index2 = 'user_id';
171171
*
172172
*/
173-
public function updateWithTwoIndex(Model $table, array $values, string $index = null, string $index2 = null, bool $raw = false)
173+
public function updateWithTwoIndex(Model $table, array $values, string|null $index = null, string|null $index2 = null, bool $raw = false)
174174
{
175175
$final = [];
176176
$ids = [];
@@ -261,7 +261,7 @@ public function updateWithTwoIndex(Model $table, array $values, string $index =
261261
* ];
262262
* $keyName = 'id';
263263
*/
264-
public function updateMultipleCondition(Model $table, array $arrays, string $keyName = null, bool $raw = false)
264+
public function updateMultipleCondition(Model $table, array $arrays, string|null $keyName = null, bool $raw = false)
265265
{
266266
$driver = $table->getConnection()->getDriverName();
267267
$connectionName = $this->getConnectionName($table);

src/BatchInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface BatchInterface
1515
* @param bool $raw
1616
* @return mixed
1717
*/
18-
public function update(Model $table, array $values, string $index = null, bool $raw = false);
18+
public function update(Model $table, array $values, string|null $index = null, bool $raw = false);
1919

2020
/**
2121
* Update multiple rows with two index.
@@ -27,7 +27,7 @@ public function update(Model $table, array $values, string $index = null, bool $
2727
* @param bool $raw
2828
* @return mixed
2929
*/
30-
public function updateWithTwoIndex(Model $table, array $values, string $index = null, string $index2 = null, bool $raw = false);
30+
public function updateWithTwoIndex(Model $table, array $values, string|null $index = null, string|null $index2 = null, bool $raw = false);
3131

3232
/**
3333
* Update multiple condition rows.
@@ -38,7 +38,7 @@ public function updateWithTwoIndex(Model $table, array $values, string $index =
3838
* @param bool $raw
3939
* @return mixed
4040
*/
41-
public function updateMultipleCondition(Model $table, array $values, string $index = null, bool $raw = false);
41+
public function updateMultipleCondition(Model $table, array $values, string|null $index = null, bool $raw = false);
4242

4343
/**
4444
* Insert multiple rows.

src/Traits/HasBatch.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ trait HasBatch
4141
*
4242
* @return bool|int
4343
*/
44-
public static function batchUpdate(array $values, string $index = null, bool $raw = false)
44+
public static function batchUpdate(array $values, string|null $index = null, bool $raw = false)
4545
{
4646
return app(Batch::class)->update(new static, $values, $index, $raw);
4747
}
@@ -83,7 +83,7 @@ public static function batchUpdate(array $values, string $index = null, bool $ra
8383
* ];
8484
* $keyName = 'id';
8585
*/
86-
public function updateMultipleCondition(array $arrays, string $keyName = null, bool $raw = false)
86+
public function updateMultipleCondition(array $arrays, string|null $keyName = null, bool $raw = false)
8787
{
8888
return app(Batch::class)->updateMultipleCondition(new static, $arrays, $keyName, $raw);
8989
}

0 commit comments

Comments
 (0)