Skip to content

Commit

Permalink
Merge branch 'master' into fix/79-fix-syntax-for-type-uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
topclaudy authored Nov 30, 2020
2 parents cca5a90 + 4fe12cb commit 1e01d7a
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 45 deletions.
24 changes: 12 additions & 12 deletions src/Database/Eloquent/Relations/BelongsTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BelongsTo extends BaseBelongsTo
*/
public function getResults()
{
if (! is_array($this->foreignKey)) {
if (!is_array($this->foreignKey)) {
if (is_null($this->child->{$this->foreignKey})) {
return $this->getDefaultFor($this->parent);
}
Expand All @@ -28,7 +28,7 @@ public function getResults()
/**
* Associate the model instance to the given parent.
*
* @param \Illuminate\Database\Eloquent\Model|int|string $model
* @param \Illuminate\Database\Eloquent\Model|int|string $model
*
* @return \Illuminate\Database\Eloquent\Model
*/
Expand All @@ -48,7 +48,7 @@ public function associate($model)
$relationName = property_exists($this, 'relationName') ? $this->relationName : $this->relation;
if ($model instanceof Model) {
$this->child->setRelation($relationName, $model);
// proper unset // https://github.com/illuminate/database/commit/44411c7288fc7b7d4e5680cfcdaa46d348b5c981
// proper unset // https://github.com/illuminate/database/commit/44411c7288fc7b7d4e5680cfcdaa46d348b5c981
} elseif ($this->child->isDirty($this->foreignKey)) {
$this->child->unsetRelation($relationName);
}
Expand Down Expand Up @@ -96,7 +96,7 @@ public function addConstraints()
/**
* Set the constraints for an eager load of the relation.
*
* @param array $models
* @param array $models
*
* @return void
*/
Expand All @@ -121,7 +121,7 @@ public function addEagerConstraints(array $models)
/**
* Gather the keys from an array of related models.
*
* @param array $models
* @param array $models
*
* @return array
*/
Expand All @@ -138,7 +138,7 @@ protected function getEagerModelKeys(array $models)
return $model->{$k};
}, $this->foreignKey);
} else {
if (! is_null($value = $model->{$this->foreignKey})) {
if (!is_null($value = $model->{$this->foreignKey})) {
$keys[] = $value;
}
}
Expand Down Expand Up @@ -175,9 +175,9 @@ public function getQualifiedForeignKey()
/**
* Add the constraints for a relationship query.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param \Illuminate\Database\Eloquent\Builder $parentQuery
* @param array|mixed $columns
* @param \Illuminate\Database\Eloquent\Builder $query
* @param \Illuminate\Database\Eloquent\Builder $parentQuery
* @param array|mixed $columns
*
* @return \Illuminate\Database\Eloquent\Builder
*/
Expand All @@ -204,9 +204,9 @@ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery,
/**
* Match the eagerly loaded results to their parents.
*
* @param array $models
* @param \Illuminate\Database\Eloquent\Collection $results
* @param string $relation
* @param array $models
* @param \Illuminate\Database\Eloquent\Collection $results
* @param string $relation
*
* @return array
*/
Expand Down
14 changes: 7 additions & 7 deletions src/Database/Eloquent/Relations/HasMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class HasMany extends BaseHasMany
*/
public function getResults()
{
if (! is_array($this->getParentKey())) {
return ! is_null($this->getParentKey()) ? $this->query->get() : $this->related->newCollection();
if (!is_array($this->getParentKey())) {
return !is_null($this->getParentKey()) ? $this->query->get() : $this->related->newCollection();
}

return $this->query->get();
Expand All @@ -26,8 +26,8 @@ public function getResults()
/**
* Initialize the relation on a set of models.
*
* @param array $models
* @param string $relation
* @param array $models
* @param string $relation
*
* @return array
*/
Expand All @@ -43,9 +43,9 @@ public function initRelation(array $models, $relation)
/**
* Match the eagerly loaded results to their parents.
*
* @param array $models
* @param \Illuminate\Database\Eloquent\Collection $results
* @param string $relation
* @param array $models
* @param \Illuminate\Database\Eloquent\Collection $results
* @param string $relation
*
* @return array
*/
Expand Down
18 changes: 9 additions & 9 deletions src/Database/Eloquent/Relations/HasOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class HasOne extends BaseHasOne
*/
public function getResults()
{
if (! is_array($this->getParentKey())) {
if (!is_array($this->getParentKey())) {
if (is_null($this->getParentKey())) {
return $this->getDefaultFor($this->parent);
}
Expand All @@ -29,13 +29,13 @@ public function getResults()
/**
* Get the default value for this relation.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param \Illuminate\Database\Eloquent\Model $model
*
* @return \Illuminate\Database\Eloquent\Model|null
*/
protected function getDefaultFor(Model $model)
{
if (! $this->withDefault) {
if (!$this->withDefault) {
return;
}

Expand Down Expand Up @@ -65,8 +65,8 @@ protected function getDefaultFor(Model $model)
/**
* Initialize the relation on a set of models.
*
* @param array $models
* @param string $relation
* @param array $models
* @param string $relation
*
* @return array
*/
Expand All @@ -82,9 +82,9 @@ public function initRelation(array $models, $relation)
/**
* Match the eagerly loaded results to their parents.
*
* @param array $models
* @param \Illuminate\Database\Eloquent\Collection $results
* @param string $relation
* @param array $models
* @param \Illuminate\Database\Eloquent\Collection $results
* @param string $relation
*
* @return array
*/
Expand All @@ -96,7 +96,7 @@ public function match(array $models, Collection $results, $relation)
/**
* Make a new related instance for the given model.
*
* @param \Illuminate\Database\Eloquent\Model $parent
* @param \Illuminate\Database\Eloquent\Model $parent
*
* @return \Illuminate\Database\Eloquent\Model
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Eloquent/Relations/HasOneOrMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function addConstraints()
/**
* Get the name of the "where in" method for eager loading.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string|array $key
* @param \Illuminate\Database\Eloquent\Model $model
* @param string|array $key
*
* @return string
*
Expand Down
8 changes: 4 additions & 4 deletions tests/Models/Allocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
use Illuminate\Support\Collection;

/**
* @property int $id
* @property int $user_id
* @property int $booking_id
* @property int $vehicle_id
* @property int $id
* @property int $user_id
* @property int $booking_id
* @property int $vehicle_id
* @property Carbon $created_at
* @property Carbon $updated_at
* @property-read TrackingTask[]|Collection $trackingTasks
Expand Down
4 changes: 2 additions & 2 deletions tests/Models/OriginalPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Illuminate\Database\Eloquent\Model;

/**
* @property int $id
* @property int $id
* @property string $name
* @property int $allocation_id
* @property int $allocation_id
* @property-read string $pcid
* @property-read Allocation $allocation
* @property-read ProductCode $productCode
Expand Down
2 changes: 1 addition & 1 deletion tests/Models/PickupPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* @property string $contract_number
* @property int $pickup_index
* @property int $pickup_index
* @property Carbon $created_at
* @property Carbon $updated_at
* @property-read PickupTime[] $pickupTimes
Expand Down
2 changes: 1 addition & 1 deletion tests/Models/PickupTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* @property string $contract_number
* @property int $pickup_index
* @property int $pickup_index
* @property string $days
* @property string $pickup_time
* @property-read PickupPoint $pickupPoint
Expand Down
4 changes: 2 additions & 2 deletions tests/Models/Space.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Illuminate\Support\Carbon;

/**
* @property int $id
* @property int $booking_id
* @property int $id
* @property int $booking_id
* @property Carbon $created_at
* @property Carbon $updated_at
*
Expand Down
6 changes: 3 additions & 3 deletions tests/Models/TrackingTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
use Illuminate\Support\Carbon;

/**
* @property int $id
* @property int $booking_id
* @property int $vehicle_id
* @property int $id
* @property int $booking_id
* @property int $vehicle_id
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Carbon $deleted_at
Expand Down
4 changes: 2 additions & 2 deletions tests/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Illuminate\Support\Carbon;

/**
* @property int $id
* @property int $booking_id
* @property int $id
* @property int $booking_id
* @property Carbon $created_at
* @property Carbon $updated_at
* @property-read Allocation[] $allocations
Expand Down

0 comments on commit 1e01d7a

Please sign in to comment.