Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/add-MagicActiveRecord' into add-…
Browse files Browse the repository at this point in the history
…MagicActiveRecord

# Conflicts:
#	tests/Stubs/ActiveRecord/CustomerClosureField.php
#	tests/Stubs/ActiveRecord/CustomerForArrayable.php
#	tests/Stubs/ActiveRecord/CustomerWithAlias.php
  • Loading branch information
Tigrov committed May 22, 2024
2 parents 80a81da + 45802e7 commit 0ac29fd
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/MagicActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MagicActiveRecord extends BaseActiveRecord implements
use ArrayableTrait;
use ArrayAccessTrait;
use ArrayIteratorTrait;
use TransactionalTrait;
use MagicPropertiesTrait;
use MagicRelationsTrait;
use TransactionalTrait;
}
2 changes: 1 addition & 1 deletion tests/Stubs/ActiveRecord/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/ActiveRecord/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/Stubs/ActiveRecord/OrderItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand All @@ -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');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Stubs/ActiveRecord/OrderItemWithNullFK.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/ActiveRecord/OrderWithNullFK.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/ActiveRecord/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0ac29fd

Please sign in to comment.