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/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/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/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'); } 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 e16f02dcb..4b4c873ae 100644 --- a/tests/Stubs/ActiveRecord/Type.php +++ b/tests/Stubs/ActiveRecord/Type.php @@ -33,7 +33,7 @@ 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;