Skip to content

Commit 40846ab

Browse files
committedFeb 9, 2022
fix: imrprove php-doc comments
1 parent 42c1ff2 commit 40846ab

30 files changed

+168
-2
lines changed
 

‎src/Auth/PasswordResetServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class PasswordResetServiceProvider extends BasePasswordResetServiceProvider
88
{
99
/**
1010
* Register the token repository implementation.
11+
*
1112
* @return void
1213
*/
1314
protected function registerTokenRepository()

‎src/Collection.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ class Collection
1010
{
1111
/**
1212
* The connection instance.
13+
*
1314
* @var Connection
1415
*/
1516
protected $connection;
1617

1718
/**
18-
* The MongoCollection instance..
19+
* The MongoCollection instance.
20+
*
1921
* @var MongoCollection
2022
*/
2123
protected $collection;
@@ -32,6 +34,7 @@ public function __construct(Connection $connection, MongoCollection $collection)
3234

3335
/**
3436
* Handle dynamic method calls.
37+
*
3538
* @param string $method
3639
* @param array $parameters
3740
* @return mixed

‎src/Connection.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@ class Connection extends BaseConnection
1111
{
1212
/**
1313
* The MongoDB database handler.
14+
*
1415
* @var \MongoDB\Database
1516
*/
1617
protected $db;
1718

1819
/**
1920
* The MongoDB connection handler.
21+
*
2022
* @var \MongoDB\Client
2123
*/
2224
protected $connection;
2325

2426
/**
2527
* Create a new database connection instance.
28+
*
2629
* @param array $config
2730
*/
2831
public function __construct(array $config)
@@ -53,6 +56,7 @@ public function __construct(array $config)
5356

5457
/**
5558
* Begin a fluent query against a database collection.
59+
*
5660
* @param string $collection
5761
* @return Query\Builder
5862
*/
@@ -65,6 +69,7 @@ public function collection($collection)
6569

6670
/**
6771
* Begin a fluent query against a database collection.
72+
*
6873
* @param string $table
6974
* @param string|null $as
7075
* @return Query\Builder
@@ -76,6 +81,7 @@ public function table($table, $as = null)
7681

7782
/**
7883
* Get a MongoDB collection.
84+
*
7985
* @param string $name
8086
* @return Collection
8187
*/
@@ -94,6 +100,7 @@ public function getSchemaBuilder()
94100

95101
/**
96102
* Get the MongoDB database object.
103+
*
97104
* @return \MongoDB\Database
98105
*/
99106
public function getMongoDB()
@@ -103,6 +110,7 @@ public function getMongoDB()
103110

104111
/**
105112
* return MongoDB object.
113+
*
106114
* @return \MongoDB\Client
107115
*/
108116
public function getMongoClient()
@@ -120,6 +128,7 @@ public function getDatabaseName()
120128

121129
/**
122130
* Get the name of the default database based on db config or try to detect it from dsn.
131+
*
123132
* @param string $dsn
124133
* @param array $config
125134
* @return string
@@ -140,6 +149,7 @@ protected function getDefaultDatabaseName($dsn, $config)
140149

141150
/**
142151
* Create a new MongoDB connection.
152+
*
143153
* @param string $dsn
144154
* @param array $config
145155
* @param array $options
@@ -175,6 +185,7 @@ public function disconnect()
175185

176186
/**
177187
* Determine if the given configuration array has a dsn string.
188+
*
178189
* @param array $config
179190
* @return bool
180191
*/
@@ -185,6 +196,7 @@ protected function hasDsnString(array $config)
185196

186197
/**
187198
* Get the DSN string form configuration.
199+
*
188200
* @param array $config
189201
* @return string
190202
*/
@@ -195,6 +207,7 @@ protected function getDsnString(array $config)
195207

196208
/**
197209
* Get the DSN string for a host / port configuration.
210+
*
198211
* @param array $config
199212
* @return string
200213
*/
@@ -218,6 +231,7 @@ protected function getHostDsn(array $config)
218231

219232
/**
220233
* Create a DSN string from a configuration.
234+
*
221235
* @param array $config
222236
* @return string
223237
*/
@@ -270,6 +284,7 @@ protected function getDefaultSchemaGrammar()
270284

271285
/**
272286
* Set database.
287+
*
273288
* @param \MongoDB\Database $db
274289
*/
275290
public function setDatabase(\MongoDB\Database $db)
@@ -279,6 +294,7 @@ public function setDatabase(\MongoDB\Database $db)
279294

280295
/**
281296
* Dynamically pass methods to the connection.
297+
*
282298
* @param string $method
283299
* @param array $parameters
284300
* @return mixed

‎src/Eloquent/Builder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Builder extends EloquentBuilder
1313

1414
/**
1515
* The methods that should be returned from query builder.
16+
*
1617
* @var array
1718
*/
1819
protected $passthru = [

‎src/Eloquent/EmbedsRelations.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ trait EmbedsRelations
1010
{
1111
/**
1212
* Define an embedded one-to-many relationship.
13+
*
1314
* @param string $related
1415
* @param string $localKey
1516
* @param string $foreignKey
@@ -44,6 +45,7 @@ protected function embedsMany($related, $localKey = null, $foreignKey = null, $r
4445

4546
/**
4647
* Define an embedded one-to-many relationship.
48+
*
4749
* @param string $related
4850
* @param string $localKey
4951
* @param string $foreignKey

‎src/Eloquent/HybridRelations.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ trait HybridRelations
1616
{
1717
/**
1818
* Define a one-to-one relationship.
19+
*
1920
* @param string $related
2021
* @param string $foreignKey
2122
* @param string $localKey
@@ -39,6 +40,7 @@ public function hasOne($related, $foreignKey = null, $localKey = null)
3940

4041
/**
4142
* Define a polymorphic one-to-one relationship.
43+
*
4244
* @param string $related
4345
* @param string $name
4446
* @param string $type
@@ -64,6 +66,7 @@ public function morphOne($related, $name, $type = null, $id = null, $localKey =
6466

6567
/**
6668
* Define a one-to-many relationship.
69+
*
6770
* @param string $related
6871
* @param string $foreignKey
6972
* @param string $localKey
@@ -87,6 +90,7 @@ public function hasMany($related, $foreignKey = null, $localKey = null)
8790

8891
/**
8992
* Define a polymorphic one-to-many relationship.
93+
*
9094
* @param string $related
9195
* @param string $name
9296
* @param string $type
@@ -117,6 +121,7 @@ public function morphMany($related, $name, $type = null, $id = null, $localKey =
117121

118122
/**
119123
* Define an inverse one-to-one or many relationship.
124+
*
120125
* @param string $related
121126
* @param string $foreignKey
122127
* @param string $otherKey
@@ -160,6 +165,7 @@ public function belongsTo($related, $foreignKey = null, $otherKey = null, $relat
160165

161166
/**
162167
* Define a polymorphic, inverse one-to-one or many relationship.
168+
*
163169
* @param string $name
164170
* @param string $type
165171
* @param string $id
@@ -204,6 +210,7 @@ public function morphTo($name = null, $type = null, $id = null, $ownerKey = null
204210

205211
/**
206212
* Define a many-to-many relationship.
213+
*
207214
* @param string $related
208215
* @param string $collection
209216
* @param string $foreignKey
@@ -277,6 +284,7 @@ public function belongsToMany(
277284

278285
/**
279286
* Get the relationship name of the belongs to many.
287+
*
280288
* @return string
281289
*/
282290
protected function guessBelongsToManyRelation()

‎src/Eloquent/Model.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,35 @@ abstract class Model extends BaseModel
2121

2222
/**
2323
* The collection associated with the model.
24+
*
2425
* @var string
2526
*/
2627
protected $collection;
2728

2829
/**
2930
* The primary key for the model.
31+
*
3032
* @var string
3133
*/
3234
protected $primaryKey = '_id';
3335

3436
/**
3537
* The primary key type.
38+
*
3639
* @var string
3740
*/
3841
protected $keyType = 'string';
3942

4043
/**
4144
* The parent relation instance.
45+
*
4246
* @var Relation
4347
*/
4448
protected $parentRelation;
4549

4650
/**
4751
* Custom accessor for the model's id.
52+
*
4853
* @param mixed $value
4954
* @return mixed
5055
*/
@@ -269,6 +274,7 @@ public function originalIsEquivalent($key)
269274

270275
/**
271276
* Remove one or more fields.
277+
*
272278
* @param mixed $columns
273279
* @return int
274280
*/
@@ -314,6 +320,7 @@ public function push()
314320

315321
/**
316322
* Remove one or more values from an array.
323+
*
317324
* @param string $column
318325
* @param mixed $values
319326
* @return mixed
@@ -332,6 +339,7 @@ public function pull($column, $values)
332339

333340
/**
334341
* Append one or more values to the underlying attribute value and sync with original.
342+
*
335343
* @param string $column
336344
* @param array $values
337345
* @param bool $unique
@@ -356,6 +364,7 @@ protected function pushAttributeValues($column, array $values, $unique = false)
356364

357365
/**
358366
* Remove one or more values to the underlying attribute value and sync with original.
367+
*
359368
* @param string $column
360369
* @param array $values
361370
*/
@@ -388,6 +397,7 @@ public function getForeignKey()
388397

389398
/**
390399
* Set the parent relation.
400+
*
391401
* @param \Illuminate\Database\Eloquent\Relations\Relation $relation
392402
*/
393403
public function setParentRelation(Relation $relation)
@@ -397,6 +407,7 @@ public function setParentRelation(Relation $relation)
397407

398408
/**
399409
* Get the parent relation.
410+
*
400411
* @return \Illuminate\Database\Eloquent\Relations\Relation
401412
*/
402413
public function getParentRelation()
@@ -432,6 +443,7 @@ protected function removeTableFromKey($key)
432443

433444
/**
434445
* Get the queueable relationships for the entity.
446+
*
435447
* @return array
436448
*/
437449
public function getQueueableRelations()
@@ -461,6 +473,7 @@ public function getQueueableRelations()
461473

462474
/**
463475
* Get loaded relations for the instance without parent.
476+
*
464477
* @return array
465478
*/
466479
protected function getRelationsWithoutParent()
@@ -477,6 +490,7 @@ protected function getRelationsWithoutParent()
477490
/**
478491
* Checks if column exists on a table. As this is a document model, just return true. This also
479492
* prevents calls to non-existent function Grammar::compileColumnListing().
493+
*
480494
* @param string $key
481495
* @return bool
482496
*/

‎src/Helpers/QueriesRelationships.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ trait QueriesRelationships
1515
{
1616
/**
1717
* Add a relationship count / exists condition to the query.
18+
*
1819
* @param Relation|string $relation
1920
* @param string $operator
2021
* @param int $count
2122
* @param string $boolean
2223
* @param Closure|null $callback
2324
* @return Builder|static
25+
* @throws Exception
2426
*/
2527
public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null)
2628
{
@@ -72,6 +74,7 @@ protected function isAcrossConnections(Relation $relation)
7274

7375
/**
7476
* Compare across databases.
77+
*
7578
* @param Relation $relation
7679
* @param string $operator
7780
* @param int $count
@@ -150,6 +153,7 @@ protected function getConstrainedRelatedIds($relations, $operator, $count)
150153

151154
/**
152155
* Returns key we are constraining this parent model's query with.
156+
*
153157
* @param Relation $relation
154158
* @return string
155159
* @throws Exception

‎src/Query/Builder.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,42 +24,49 @@ class Builder extends BaseBuilder
2424
{
2525
/**
2626
* The database collection.
27+
*
2728
* @var \MongoDB\Collection
2829
*/
2930
protected $collection;
3031

3132
/**
3233
* The column projections.
34+
*
3335
* @var array
3436
*/
3537
public $projections;
3638

3739
/**
3840
* The cursor timeout value.
41+
*
3942
* @var int
4043
*/
4144
public $timeout;
4245

4346
/**
4447
* The cursor hint value.
48+
*
4549
* @var int
4650
*/
4751
public $hint;
4852

4953
/**
5054
* Custom options to add to the query.
55+
*
5156
* @var array
5257
*/
5358
public $options = [];
5459

5560
/**
5661
* Indicate if we are executing a pagination query.
62+
*
5763
* @var bool
5864
*/
5965
public $paginating = false;
6066

6167
/**
6268
* All of the available clause operators.
69+
*
6370
* @var array
6471
*/
6572
public $operators = [
@@ -107,6 +114,7 @@ class Builder extends BaseBuilder
107114

108115
/**
109116
* Operator conversion.
117+
*
110118
* @var array
111119
*/
112120
protected $conversion = [
@@ -131,6 +139,7 @@ public function __construct(Connection $connection, Processor $processor)
131139

132140
/**
133141
* Set the projections.
142+
*
134143
* @param array $columns
135144
* @return $this
136145
*/
@@ -155,6 +164,7 @@ public function timeout($seconds)
155164

156165
/**
157166
* Set the cursor hint.
167+
*
158168
* @param mixed $index
159169
* @return $this
160170
*/
@@ -205,6 +215,7 @@ public function cursor($columns = [])
205215

206216
/**
207217
* Execute the query as a fresh "select" statement.
218+
*
208219
* @param array $columns
209220
* @param bool $returnLazy
210221
* @return array|static[]|Collection|LazyCollection
@@ -415,6 +426,7 @@ public function getFresh($columns = [], $returnLazy = false)
415426

416427
/**
417428
* Generate the unique cache key for the current query.
429+
*
418430
* @return string
419431
*/
420432
public function generateCacheKey()
@@ -508,6 +520,7 @@ public function orderBy($column, $direction = 'asc')
508520

509521
/**
510522
* Add a "where all" clause to the query.
523+
*
511524
* @param string $column
512525
* @param array $values
513526
* @param string $boolean
@@ -714,6 +727,7 @@ public function truncate(): bool
714727

715728
/**
716729
* Get an array with the values of a given column.
730+
*
717731
* @param string $column
718732
* @param string $key
719733
* @return array
@@ -745,6 +759,7 @@ public function raw($expression = null)
745759

746760
/**
747761
* Append one or more values to an array.
762+
*
748763
* @param mixed $column
749764
* @param mixed $value
750765
* @param bool $unique
@@ -771,6 +786,7 @@ public function push($column, $value = null, $unique = false)
771786

772787
/**
773788
* Remove one or more values from an array.
789+
*
774790
* @param mixed $column
775791
* @param mixed $value
776792
* @return int
@@ -794,6 +810,7 @@ public function pull($column, $value = null)
794810

795811
/**
796812
* Remove one or more fields.
813+
*
797814
* @param mixed $columns
798815
* @return int
799816
*/
@@ -824,6 +841,7 @@ public function newQuery()
824841

825842
/**
826843
* Perform an update query.
844+
*
827845
* @param array $query
828846
* @param array $options
829847
* @return int
@@ -846,6 +864,7 @@ protected function performUpdate($query, array $options = [])
846864

847865
/**
848866
* Convert a key to ObjectID if needed.
867+
*
849868
* @param mixed $id
850869
* @return mixed
851870
*/
@@ -883,6 +902,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
883902

884903
/**
885904
* Compile the where array.
905+
*
886906
* @return array
887907
*/
888908
protected function compileWheres()
@@ -1216,6 +1236,7 @@ protected function compileWhereRaw(array $where)
12161236

12171237
/**
12181238
* Set custom options for the query.
1239+
*
12191240
* @param array $options
12201241
* @return $this
12211242
*/

‎src/Queue/Failed/MongoFailedJobProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class MongoFailedJobProvider extends DatabaseFailedJobProvider
99
{
1010
/**
1111
* Log a failed job into storage.
12+
*
1213
* @param string $connection
1314
* @param string $queue
1415
* @param string $payload
@@ -26,6 +27,7 @@ public function log($connection, $queue, $payload, $exception)
2627

2728
/**
2829
* Get a list of all of the failed jobs.
30+
*
2931
* @return object[]
3032
*/
3133
public function all()
@@ -43,6 +45,7 @@ public function all()
4345

4446
/**
4547
* Get a single failed job.
48+
*
4649
* @param mixed $id
4750
* @return object
4851
*/
@@ -61,6 +64,7 @@ public function find($id)
6164

6265
/**
6366
* Delete a single failed job from storage.
67+
*
6468
* @param mixed $id
6569
* @return bool
6670
*/

‎src/Queue/MongoConnector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ class MongoConnector implements ConnectorInterface
1010
{
1111
/**
1212
* Database connections.
13+
*
1314
* @var \Illuminate\Database\ConnectionResolverInterface
1415
*/
1516
protected $connections;
1617

1718
/**
1819
* Create a new connector instance.
20+
*
1921
* @param \Illuminate\Database\ConnectionResolverInterface $connections
2022
*/
2123
public function __construct(ConnectionResolverInterface $connections)
@@ -25,6 +27,7 @@ public function __construct(ConnectionResolverInterface $connections)
2527

2628
/**
2729
* Establish a queue connection.
30+
*
2831
* @param array $config
2932
* @return \Illuminate\Contracts\Queue\Queue
3033
*/

‎src/Queue/MongoJob.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class MongoJob extends DatabaseJob
88
{
99
/**
1010
* Indicates if the job has been reserved.
11+
*
1112
* @return bool
1213
*/
1314
public function isReserved()

‎src/Queue/MongoQueue.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ class MongoQueue extends DatabaseQueue
1111
{
1212
/**
1313
* The expiration time of a job.
14+
*
1415
* @var int|null
1516
*/
1617
protected $retryAfter = 60;
1718

1819
/**
1920
* The connection name for the queue.
21+
*
2022
* @var string
2123
*/
2224
protected $connectionName;
@@ -56,6 +58,7 @@ public function pop($queue = null)
5658
* This race condition can result in random jobs being run more then
5759
* once. To solve this we use findOneAndUpdate to lock the next jobs
5860
* record while flagging it as reserved at the same time.
61+
*
5962
* @param string|null $queue
6063
* @return \StdClass|null
6164
*/
@@ -91,6 +94,7 @@ protected function getNextAvailableJobAndReserve($queue)
9194

9295
/**
9396
* Release the jobs that have been reserved for too long.
97+
*
9498
* @param string $queue
9599
* @return void
96100
*/
@@ -111,6 +115,7 @@ protected function releaseJobsThatHaveBeenReservedTooLong($queue)
111115

112116
/**
113117
* Release the given job ID from reservation.
118+
*
114119
* @param string $id
115120
* @param int $attempts
116121
* @return void

‎src/Relations/BelongsTo.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class BelongsTo extends \Illuminate\Database\Eloquent\Relations\BelongsTo
99
{
1010
/**
1111
* Get the key for comparing against the parent key in "has" query.
12+
*
1213
* @return string
1314
*/
1415
public function getHasCompareKey()
@@ -52,6 +53,7 @@ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery,
5253

5354
/**
5455
* Get the owner key with backwards compatible support.
56+
*
5557
* @return string
5658
*/
5759
public function getOwnerKey()
@@ -61,6 +63,7 @@ public function getOwnerKey()
6163

6264
/**
6365
* Get the name of the "where in" method for eager loading.
66+
*
6467
* @param \Illuminate\Database\Eloquent\Model $model
6568
* @param string $key
6669
* @return string

‎src/Relations/BelongsToMany.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class BelongsToMany extends EloquentBelongsToMany
1313
{
1414
/**
1515
* Get the key for comparing against the parent key in "has" query.
16+
*
1617
* @return string
1718
*/
1819
public function getHasCompareKey()
@@ -38,6 +39,7 @@ protected function hydratePivotRelation(array $models)
3839

3940
/**
4041
* Set the select clause for the relation query.
42+
*
4143
* @param array $columns
4244
* @return array
4345
*/
@@ -66,6 +68,7 @@ public function addConstraints()
6668

6769
/**
6870
* Set the where clause for the relation query.
71+
*
6972
* @return $this
7073
*/
7174
protected function setWhere()
@@ -272,6 +275,7 @@ public function newPivotQuery()
272275

273276
/**
274277
* Create a new query builder for the related model.
278+
*
275279
* @return \Illuminate\Database\Query\Builder
276280
*/
277281
public function newRelatedQuery()
@@ -281,6 +285,7 @@ public function newRelatedQuery()
281285

282286
/**
283287
* Get the fully qualified foreign key for the relation.
288+
*
284289
* @return string
285290
*/
286291
public function getForeignKey()
@@ -307,6 +312,7 @@ public function getQualifiedRelatedPivotKeyName()
307312
/**
308313
* Format the sync list so that it is keyed by ID. (Legacy Support)
309314
* The original function has been renamed to formatRecordsList since Laravel 5.3.
315+
*
310316
* @param array $records
311317
* @return array
312318
* @deprecated
@@ -326,6 +332,7 @@ protected function formatSyncList(array $records)
326332

327333
/**
328334
* Get the related key with backwards compatible support.
335+
*
329336
* @return string
330337
*/
331338
public function getRelatedKey()
@@ -335,6 +342,7 @@ public function getRelatedKey()
335342

336343
/**
337344
* Get the name of the "where in" method for eager loading.
345+
*
338346
* @param \Illuminate\Database\Eloquent\Model $model
339347
* @param string $key
340348
* @return string

‎src/Relations/EmbedsMany.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function getResults()
3333

3434
/**
3535
* Save a new model and attach it to the parent model.
36+
*
3637
* @param Model $model
3738
* @return Model|bool
3839
*/
@@ -63,6 +64,7 @@ public function performInsert(Model $model)
6364

6465
/**
6566
* Save an existing model and attach it to the parent model.
67+
*
6668
* @param Model $model
6769
* @return Model|bool
6870
*/
@@ -94,6 +96,7 @@ public function performUpdate(Model $model)
9496

9597
/**
9698
* Delete an existing model and detach it from the parent model.
99+
*
97100
* @param Model $model
98101
* @return int
99102
*/
@@ -120,6 +123,7 @@ public function performDelete(Model $model)
120123

121124
/**
122125
* Associate the model instance to the given parent, without saving it to the database.
126+
*
123127
* @param Model $model
124128
* @return Model
125129
*/
@@ -134,6 +138,7 @@ public function associate(Model $model)
134138

135139
/**
136140
* Dissociate the model instance from the given parent, without saving it to the database.
141+
*
137142
* @param mixed $ids
138143
* @return int
139144
*/
@@ -162,6 +167,7 @@ public function dissociate($ids = [])
162167

163168
/**
164169
* Destroy the embedded models for the given IDs.
170+
*
165171
* @param mixed $ids
166172
* @return int
167173
*/
@@ -186,6 +192,7 @@ public function destroy($ids = [])
186192

187193
/**
188194
* Delete all embedded models.
195+
*
189196
* @return int
190197
*/
191198
public function delete()
@@ -202,6 +209,7 @@ public function delete()
202209

203210
/**
204211
* Destroy alias.
212+
*
205213
* @param mixed $ids
206214
* @return int
207215
*/
@@ -212,6 +220,7 @@ public function detach($ids = [])
212220

213221
/**
214222
* Save alias.
223+
*
215224
* @param Model $model
216225
* @return Model
217226
*/
@@ -222,6 +231,7 @@ public function attach(Model $model)
222231

223232
/**
224233
* Associate a new model instance to the given parent, without saving it to the database.
234+
*
225235
* @param Model $model
226236
* @return Model
227237
*/
@@ -242,6 +252,7 @@ protected function associateNew($model)
242252

243253
/**
244254
* Associate an existing model instance to the given parent, without saving it to the database.
255+
*
245256
* @param Model $model
246257
* @return Model
247258
*/
@@ -332,6 +343,7 @@ public function __call($method, $parameters)
332343

333344
/**
334345
* Get the name of the "where in" method for eager loading.
346+
*
335347
* @param \Illuminate\Database\Eloquent\Model $model
336348
* @param string $key
337349
* @return string

‎src/Relations/EmbedsOne.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function getEager()
3232

3333
/**
3434
* Save a new model and attach it to the parent model.
35+
*
3536
* @param Model $model
3637
* @return Model|bool
3738
*/
@@ -61,6 +62,7 @@ public function performInsert(Model $model)
6162

6263
/**
6364
* Save an existing model and attach it to the parent model.
65+
*
6466
* @param Model $model
6567
* @return Model|bool
6668
*/
@@ -86,6 +88,7 @@ public function performUpdate(Model $model)
8688

8789
/**
8890
* Delete an existing model and detach it from the parent model.
91+
*
8992
* @return int
9093
*/
9194
public function performDelete()
@@ -110,6 +113,7 @@ public function performDelete()
110113

111114
/**
112115
* Attach the model to its parent.
116+
*
113117
* @param Model $model
114118
* @return Model
115119
*/
@@ -120,6 +124,7 @@ public function associate(Model $model)
120124

121125
/**
122126
* Detach the model from its parent.
127+
*
123128
* @return Model
124129
*/
125130
public function dissociate()
@@ -129,6 +134,7 @@ public function dissociate()
129134

130135
/**
131136
* Delete all embedded models.
137+
*
132138
* @return int
133139
*/
134140
public function delete()
@@ -138,6 +144,7 @@ public function delete()
138144

139145
/**
140146
* Get the name of the "where in" method for eager loading.
147+
*
141148
* @param \Illuminate\Database\Eloquent\Model $model
142149
* @param string $key
143150
* @return string

‎src/Relations/EmbedsOneOrMany.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,28 @@ abstract class EmbedsOneOrMany extends Relation
1212
{
1313
/**
1414
* The local key of the parent model.
15+
*
1516
* @var string
1617
*/
1718
protected $localKey;
1819

1920
/**
2021
* The foreign key of the parent model.
22+
*
2123
* @var string
2224
*/
2325
protected $foreignKey;
2426

2527
/**
2628
* The "name" of the relationship.
29+
*
2730
* @var string
2831
*/
2932
protected $relation;
3033

3134
/**
3235
* Create a new embeds many relationship instance.
36+
*
3337
* @param Builder $query
3438
* @param Model $parent
3539
* @param Model $related
@@ -90,6 +94,7 @@ public function match(array $models, Collection $results, $relation)
9094

9195
/**
9296
* Shorthand to get the results of the relationship.
97+
*
9398
* @param array $columns
9499
* @return Collection
95100
*/
@@ -100,6 +105,7 @@ public function get($columns = ['*'])
100105

101106
/**
102107
* Get the number of embedded models.
108+
*
103109
* @return int
104110
*/
105111
public function count()
@@ -109,6 +115,7 @@ public function count()
109115

110116
/**
111117
* Attach a model instance to the parent model.
118+
*
112119
* @param Model $model
113120
* @return Model|bool
114121
*/
@@ -121,6 +128,7 @@ public function save(Model $model)
121128

122129
/**
123130
* Attach a collection of models to the parent instance.
131+
*
124132
* @param Collection|array $models
125133
* @return Collection|array
126134
*/
@@ -135,6 +143,7 @@ public function saveMany($models)
135143

136144
/**
137145
* Create a new instance of the related model.
146+
*
138147
* @param array $attributes
139148
* @return Model
140149
*/
@@ -154,6 +163,7 @@ public function create(array $attributes = [])
154163

155164
/**
156165
* Create an array of new instances of the related model.
166+
*
157167
* @param array $records
158168
* @return array
159169
*/
@@ -170,6 +180,7 @@ public function createMany(array $records)
170180

171181
/**
172182
* Transform single ID, single Model or array of Models into an array of IDs.
183+
*
173184
* @param mixed $ids
174185
* @return array
175186
*/
@@ -224,6 +235,7 @@ protected function setEmbedded($records)
224235

225236
/**
226237
* Get the foreign key value for the relation.
238+
*
227239
* @param mixed $id
228240
* @return mixed
229241
*/
@@ -239,6 +251,7 @@ protected function getForeignKeyValue($id)
239251

240252
/**
241253
* Convert an array of records to a Collection.
254+
*
242255
* @param array $records
243256
* @return Collection
244257
*/
@@ -259,6 +272,7 @@ protected function toCollection(array $records = [])
259272

260273
/**
261274
* Create a related model instanced.
275+
*
262276
* @param array $attributes
263277
* @return Model
264278
*/
@@ -287,6 +301,7 @@ protected function toModel($attributes = [])
287301

288302
/**
289303
* Get the relation instance of the parent.
304+
*
290305
* @return Relation
291306
*/
292307
protected function getParentRelation()
@@ -316,6 +331,7 @@ public function getBaseQuery()
316331

317332
/**
318333
* Check if this relation is nested in another relation.
334+
*
319335
* @return bool
320336
*/
321337
protected function isNested()
@@ -325,6 +341,7 @@ protected function isNested()
325341

326342
/**
327343
* Get the fully qualified local key name.
344+
*
328345
* @param string $glue
329346
* @return string
330347
*/
@@ -351,6 +368,7 @@ public function getQualifiedParentKeyName()
351368

352369
/**
353370
* Get the primary key value of the parent.
371+
*
354372
* @return string
355373
*/
356374
protected function getParentKey()
@@ -360,6 +378,7 @@ protected function getParentKey()
360378

361379
/**
362380
* Return update values.
381+
*
363382
* @param $array
364383
* @param string $prepend
365384
* @return array
@@ -377,6 +396,7 @@ public static function getUpdateValues($array, $prepend = '')
377396

378397
/**
379398
* Get the foreign key for the relationship.
399+
*
380400
* @return string
381401
*/
382402
public function getQualifiedForeignKeyName()
@@ -386,6 +406,7 @@ public function getQualifiedForeignKeyName()
386406

387407
/**
388408
* Get the name of the "where in" method for eager loading.
409+
*
389410
* @param \Illuminate\Database\Eloquent\Model $model
390411
* @param string $key
391412
* @return string

‎src/Relations/HasMany.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class HasMany extends EloquentHasMany
1010
{
1111
/**
1212
* Get the plain foreign key.
13+
*
1314
* @return string
1415
*/
1516
public function getForeignKeyName()
@@ -19,6 +20,7 @@ public function getForeignKeyName()
1920

2021
/**
2122
* Get the key for comparing against the parent key in "has" query.
23+
*
2224
* @return string
2325
*/
2426
public function getHasCompareKey()
@@ -38,6 +40,7 @@ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery,
3840

3941
/**
4042
* Get the name of the "where in" method for eager loading.
43+
*
4144
* @param \Illuminate\Database\Eloquent\Model $model
4245
* @param string $key
4346
* @return string

‎src/Relations/HasOne.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class HasOne extends EloquentHasOne
1010
{
1111
/**
1212
* Get the key for comparing against the parent key in "has" query.
13+
*
1314
* @return string
1415
*/
1516
public function getForeignKeyName()
@@ -19,6 +20,7 @@ public function getForeignKeyName()
1920

2021
/**
2122
* Get the key for comparing against the parent key in "has" query.
23+
*
2224
* @return string
2325
*/
2426
public function getHasCompareKey()
@@ -38,6 +40,7 @@ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery,
3840

3941
/**
4042
* Get the name of the "where in" method for eager loading.
43+
*
4144
* @param \Illuminate\Database\Eloquent\Model $model
4245
* @param string $key
4346
* @return string

‎src/Relations/MorphTo.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ protected function getResultsByType($type)
3636

3737
/**
3838
* Get the owner key with backwards compatible support.
39+
*
3940
* @return string
4041
*/
4142
public function getOwnerKey()
@@ -45,6 +46,7 @@ public function getOwnerKey()
4546

4647
/**
4748
* Get the name of the "where in" method for eager loading.
49+
*
4850
* @param \Illuminate\Database\Eloquent\Model $model
4951
* @param string $key
5052
* @return string

‎src/Schema/Blueprint.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ class Blueprint extends \Illuminate\Database\Schema\Blueprint
88
{
99
/**
1010
* The MongoConnection object for this blueprint.
11+
*
1112
* @var \Jenssegers\Mongodb\Connection
1213
*/
1314
protected $connection;
1415

1516
/**
1617
* The MongoCollection object for this blueprint.
1718
* @var \Jenssegers\Mongodb\Collection|\MongoDB\Collection
19+
*
1820
*/
1921
protected $collection;
2022

2123
/**
2224
* Fluent columns.
25+
*
2326
* @var array
2427
*/
2528
protected $columns = [];
@@ -167,6 +170,7 @@ public function unique($columns = null, $name = null, $algorithm = null, $option
167170

168171
/**
169172
* Specify a non blocking index for the collection.
173+
*
170174
* @param string|array $columns
171175
* @return Blueprint
172176
*/
@@ -181,6 +185,7 @@ public function background($columns = null)
181185

182186
/**
183187
* Specify a sparse index for the collection.
188+
*
184189
* @param string|array $columns
185190
* @param array $options
186191
* @return Blueprint
@@ -198,6 +203,7 @@ public function sparse($columns = null, $options = [])
198203

199204
/**
200205
* Specify a geospatial index for the collection.
206+
*
201207
* @param string|array $columns
202208
* @param string $index
203209
* @param array $options
@@ -221,8 +227,9 @@ public function geospatial($columns = null, $index = '2d', $options = [])
221227
}
222228

223229
/**
224-
* Specify the number of seconds after wich a document should be considered expired based,
230+
* Specify the number of seconds after which a document should be considered expired based,
225231
* on the given single-field index containing a date.
232+
*
226233
* @param string|array $columns
227234
* @param int $seconds
228235
* @return Blueprint
@@ -238,6 +245,7 @@ public function expire($columns, $seconds)
238245

239246
/**
240247
* Indicate that the collection needs to be created.
248+
*
241249
* @param array $options
242250
* @return void
243251
*/
@@ -271,6 +279,7 @@ public function addColumn($type, $name, array $parameters = [])
271279

272280
/**
273281
* Specify a sparse and unique index for the collection.
282+
*
274283
* @param string|array $columns
275284
* @param array $options
276285
* @return Blueprint
@@ -289,6 +298,7 @@ public function sparse_and_unique($columns = null, $options = [])
289298

290299
/**
291300
* Allow fluent columns.
301+
*
292302
* @param string|array $columns
293303
* @return string|array
294304
*/
@@ -305,6 +315,7 @@ protected function fluent($columns = null)
305315

306316
/**
307317
* Allows the use of unsupported schema methods.
318+
*
308319
* @param $method
309320
* @param $args
310321
* @return Blueprint

‎src/Schema/Builder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function hasColumns($table, array $columns)
2424

2525
/**
2626
* Determine if the given collection exists.
27+
*
2728
* @param string $name
2829
* @return bool
2930
*/
@@ -50,6 +51,7 @@ public function hasTable($collection)
5051

5152
/**
5253
* Modify a collection on the schema.
54+
*
5355
* @param string $collection
5456
* @param Closure $callback
5557
* @return bool
@@ -127,6 +129,7 @@ protected function createBlueprint($collection, Closure $callback = null)
127129

128130
/**
129131
* Get collection.
132+
*
130133
* @param string $name
131134
* @return bool|\MongoDB\Model\CollectionInfo
132135
*/
@@ -145,6 +148,7 @@ public function getCollection($name)
145148

146149
/**
147150
* Get all of the collections names for the database.
151+
*
148152
* @return array
149153
*/
150154
protected function getAllCollections()

‎src/Validation/DatabasePresenceVerifier.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class DatabasePresenceVerifier extends \Illuminate\Validation\DatabasePresenceVe
66
{
77
/**
88
* Count the number of objects in a collection having the given value.
9+
*
910
* @param string $collection
1011
* @param string $column
1112
* @param string $value

‎tests/TestCase.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class TestCase extends Orchestra\Testbench\TestCase
88
{
99
/**
1010
* Get application providers.
11+
*
1112
* @param \Illuminate\Foundation\Application $app
1213
* @return array
1314
*/
@@ -22,6 +23,7 @@ protected function getApplicationProviders($app)
2223

2324
/**
2425
* Get package providers.
26+
*
2527
* @param \Illuminate\Foundation\Application $app
2628
* @return array
2729
*/
@@ -37,6 +39,7 @@ protected function getPackageProviders($app)
3739

3840
/**
3941
* Define environment setup.
42+
*
4043
* @param Illuminate\Foundation\Application $app
4144
* @return void
4245
*/

‎tests/models/Birthday.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/**
88
* Class Birthday.
9+
*
910
* @property string $name
1011
* @property string $birthday
1112
* @property string $day

‎tests/models/Book.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/**
99
* Class Book.
10+
*
1011
* @property string $title
1112
* @property string $author
1213
* @property array $chapters

‎tests/models/Item.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/**
1010
* Class Item.
11+
*
1112
* @property \Carbon\Carbon $created_at
1213
*/
1314
class Item extends Eloquent

‎tests/models/Soft.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/**
99
* Class Soft.
10+
*
1011
* @property \Carbon\Carbon $deleted_at
1112
*/
1213
class Soft extends Eloquent

‎tests/models/User.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
/**
1414
* Class User.
15+
*
1516
* @property string $_id
1617
* @property string $name
1718
* @property string $email

0 commit comments

Comments
 (0)
Please sign in to comment.