diff --git a/src/Collection.php b/src/Collection.php index 3980e8d..ac1c09f 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -6,6 +6,9 @@ use MongoDB\BSON\ObjectID; use MongoDB\Collection as MongoCollection; +/** + * @mixin MongoCollection + */ class Collection { /** diff --git a/src/Connection.php b/src/Connection.php index 3a3d235..2786420 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -12,6 +12,9 @@ use MongoDB\Database; use Throwable; +/** + * @mixin Database + */ class Connection extends BaseConnection { use ManagesTransactions; diff --git a/src/Eloquent/Casts/BinaryUuid.php b/src/Eloquent/Casts/BinaryUuid.php index 1ca9d40..8c8628f 100644 --- a/src/Eloquent/Casts/BinaryUuid.php +++ b/src/Eloquent/Casts/BinaryUuid.php @@ -46,7 +46,7 @@ public function get($model, string $key, $value, array $attributes) * @param string $key * @param mixed $value * @param array $attributes - * @return mixed + * @return Binary */ public function set($model, string $key, $value, array $attributes) { diff --git a/src/Eloquent/EmbedsRelations.php b/src/Eloquent/EmbedsRelations.php index 95231a5..cd921d6 100644 --- a/src/Eloquent/EmbedsRelations.php +++ b/src/Eloquent/EmbedsRelations.php @@ -6,6 +6,9 @@ use Jenssegers\Mongodb\Relations\EmbedsMany; use Jenssegers\Mongodb\Relations\EmbedsOne; +/** + * Embeds relations for MongoDB models. + */ trait EmbedsRelations { /** diff --git a/src/Eloquent/HybridRelations.php b/src/Eloquent/HybridRelations.php index 398d26f..bb544f9 100644 --- a/src/Eloquent/HybridRelations.php +++ b/src/Eloquent/HybridRelations.php @@ -12,6 +12,10 @@ use Jenssegers\Mongodb\Relations\MorphMany; use Jenssegers\Mongodb\Relations\MorphTo; +/** + * Cross-database relationships between SQL and MongoDB. + * Use this trait in SQL models to define relationships with MongoDB models. + */ trait HybridRelations { /** diff --git a/src/Query/Builder.php b/src/Query/Builder.php index 0e6a826..b5141a0 100644 --- a/src/Query/Builder.php +++ b/src/Query/Builder.php @@ -788,9 +788,9 @@ public function raw($expression = null) /** * Append one or more values to an array. * - * @param mixed $column - * @param mixed $value - * @param bool $unique + * @param string|array $column + * @param mixed $value + * @param bool $unique * @return int */ public function push($column, $value = null, $unique = false) @@ -818,14 +818,14 @@ public function push($column, $value = null, $unique = false) /** * Remove one or more values from an array. * - * @param mixed $column - * @param mixed $value + * @param string|array $column + * @param mixed $value * @return int */ public function pull($column, $value = null) { // Check if we passed an associative array. - $batch = (is_array($value) && array_keys($value) === range(0, count($value) - 1)); + $batch = is_array($value) && array_is_list($value); // If we are pulling multiple values, we need to use $pullAll. $operator = $batch ? '$pullAll' : '$pull'; @@ -842,7 +842,7 @@ public function pull($column, $value = null) /** * Remove one or more fields. * - * @param mixed $columns + * @param string|string[] $columns * @return int */ public function drop($columns)