From 97194cdb181d1f105d98afaff5c2e9c211f4926d Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 22 May 2024 09:11:38 +0000 Subject: [PATCH 1/2] Apply fixes from StyleCI --- src/MagicActiveRecord.php | 2 +- tests/Stubs/ActiveRecord/OrderItem.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MagicActiveRecord.php b/src/MagicActiveRecord.php index e0b5b62d1..fecf94e5b 100644 --- a/src/MagicActiveRecord.php +++ b/src/MagicActiveRecord.php @@ -38,7 +38,7 @@ class MagicActiveRecord extends BaseActiveRecord implements use ArrayableTrait; use ArrayAccessTrait; use ArrayIteratorTrait; - use TransactionalTrait; use MagicPropertiesTrait; use MagicRelationsTrait; + use TransactionalTrait; } diff --git a/tests/Stubs/ActiveRecord/OrderItem.php b/tests/Stubs/ActiveRecord/OrderItem.php index 6ca66b8a3..ce09f32ca 100644 --- a/tests/Stubs/ActiveRecord/OrderItem.php +++ b/tests/Stubs/ActiveRecord/OrderItem.php @@ -114,7 +114,7 @@ public function getItemQuery(): ActiveQuery return $this->hasOne(Item::class, ['id' => 'item_id']); } - public function getOrderItemCompositeWithJoin(): OrderItem|null + public function getOrderItemCompositeWithJoin(): self|null { return $this->relation('orderItemCompositeWithJoin'); } @@ -125,7 +125,7 @@ public function getOrderItemCompositeWithJoinQuery(): ActiveQuery return $this->hasOne(self::class, ['item_id' => 'item_id', 'order_id' => 'order_id' ])->joinWith('item'); } - public function getOrderItemCompositeNoJoin(): OrderItem|null + public function getOrderItemCompositeNoJoin(): self|null { return $this->relation('orderItemCompositeNoJoin'); } From 45802e7d51557263a588b6c757b0c2daff6ab52e Mon Sep 17 00:00:00 2001 From: samdark Date: Wed, 22 May 2024 09:12:22 +0000 Subject: [PATCH 2/2] Apply Rector changes (CI) --- tests/Stubs/ActiveRecord/Category.php | 2 +- tests/Stubs/ActiveRecord/CustomerClosureField.php | 2 +- tests/Stubs/ActiveRecord/CustomerForArrayable.php | 2 +- tests/Stubs/ActiveRecord/CustomerWithAlias.php | 2 +- tests/Stubs/ActiveRecord/Order.php | 2 +- tests/Stubs/ActiveRecord/OrderItemWithNullFK.php | 4 ++-- tests/Stubs/ActiveRecord/OrderWithNullFK.php | 2 +- tests/Stubs/ActiveRecord/Type.php | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/Stubs/ActiveRecord/Category.php b/tests/Stubs/ActiveRecord/Category.php index 49e4c1561..bc85de046 100644 --- a/tests/Stubs/ActiveRecord/Category.php +++ b/tests/Stubs/ActiveRecord/Category.php @@ -16,7 +16,7 @@ */ final class Category extends ActiveRecord { - protected int|null $id; + protected int|null $id = null; protected string $name; public function getTableName(): string diff --git a/tests/Stubs/ActiveRecord/CustomerClosureField.php b/tests/Stubs/ActiveRecord/CustomerClosureField.php index 984766321..5acc77db1 100644 --- a/tests/Stubs/ActiveRecord/CustomerClosureField.php +++ b/tests/Stubs/ActiveRecord/CustomerClosureField.php @@ -16,7 +16,7 @@ final class CustomerClosureField extends ActiveRecord protected string $email; protected string $address; protected int $status; - protected int|null $profile_id; + protected int|null $profile_id = null; public function getTableName(): string { diff --git a/tests/Stubs/ActiveRecord/CustomerForArrayable.php b/tests/Stubs/ActiveRecord/CustomerForArrayable.php index 3a8c32fe0..ea5e0e24c 100644 --- a/tests/Stubs/ActiveRecord/CustomerForArrayable.php +++ b/tests/Stubs/ActiveRecord/CustomerForArrayable.php @@ -20,7 +20,7 @@ class CustomerForArrayable extends ActiveRecord protected string $email; protected string $address; protected int $status; - protected int|null $profile_id; + protected int|null $profile_id = null; public function getTableName(): string { diff --git a/tests/Stubs/ActiveRecord/CustomerWithAlias.php b/tests/Stubs/ActiveRecord/CustomerWithAlias.php index 4ba1fa18e..436dd45de 100644 --- a/tests/Stubs/ActiveRecord/CustomerWithAlias.php +++ b/tests/Stubs/ActiveRecord/CustomerWithAlias.php @@ -24,7 +24,7 @@ final class CustomerWithAlias extends ActiveRecord public string $email; public string $address; public int $status; - public int|null $profile_id; + public int|null $profile_id = null; public function getTableName(): string { diff --git a/tests/Stubs/ActiveRecord/Order.php b/tests/Stubs/ActiveRecord/Order.php index 8d2eb6763..3078d6589 100644 --- a/tests/Stubs/ActiveRecord/Order.php +++ b/tests/Stubs/ActiveRecord/Order.php @@ -20,7 +20,7 @@ class Order extends ActiveRecord { public const TABLE_NAME = 'order'; - protected int|null $id; + protected int|null $id = null; protected int $customer_id; protected int $created_at; protected float $total; diff --git a/tests/Stubs/ActiveRecord/OrderItemWithNullFK.php b/tests/Stubs/ActiveRecord/OrderItemWithNullFK.php index 24c07fc84..a0b4c96a4 100644 --- a/tests/Stubs/ActiveRecord/OrderItemWithNullFK.php +++ b/tests/Stubs/ActiveRecord/OrderItemWithNullFK.php @@ -16,8 +16,8 @@ */ final class OrderItemWithNullFK extends ActiveRecord { - protected int|null $order_id; - protected int|null $item_id; + protected int|null $order_id = null; + protected int|null $item_id = null; protected int $quantity; protected float $subtotal; diff --git a/tests/Stubs/ActiveRecord/OrderWithNullFK.php b/tests/Stubs/ActiveRecord/OrderWithNullFK.php index acd10dd97..9d0cb7aa1 100644 --- a/tests/Stubs/ActiveRecord/OrderWithNullFK.php +++ b/tests/Stubs/ActiveRecord/OrderWithNullFK.php @@ -17,7 +17,7 @@ final class OrderWithNullFK extends ActiveRecord { protected int $id; - protected int|null $customer_id; + protected int|null $customer_id = null; protected int $created_at; protected float $total; diff --git a/tests/Stubs/ActiveRecord/Type.php b/tests/Stubs/ActiveRecord/Type.php index d2cb1ccf4..8b4a8794d 100644 --- a/tests/Stubs/ActiveRecord/Type.php +++ b/tests/Stubs/ActiveRecord/Type.php @@ -33,7 +33,7 @@ final class Type extends ActiveRecord public int|null $smallint_col = 1; public string $char_col; public string|null $char_col2 = 'something'; - public string|null $char_col3; + public string|null $char_col3 = null; public float $float_col; public float|null $float_col2 = 1.23; public mixed $blob_col;