Skip to content

Commit 1ab9bde

Browse files
Straighten up type annotations in ForeignRelationship
1 parent 634aee0 commit 1ab9bde

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/Models/ForeignRelationship.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
use CrestApps\CodeGenerator\Support\Helpers;
88
use CrestApps\CodeGenerator\Support\ResourceMapper;
99
use CrestApps\CodeGenerator\Support\Str;
10-
use DB;
10+
use Illuminate\Support\Facades\DB;
1111
use Exception;
12-
use File;
12+
use Illuminate\Support\Facades\File;
1313
use Illuminate\Database\Eloquent\Model;
1414

1515
class ForeignRelationship implements JsonWriter
@@ -62,7 +62,7 @@ class ForeignRelationship implements JsonWriter
6262
/**
6363
* Instance of the foreign model.
6464
*
65-
* @var Illuminate\Database\Eloquent\Model
65+
* @var Model
6666
*/
6767
private $foreignModel;
6868

@@ -215,8 +215,6 @@ protected function guessForeignField()
215215
/**
216216
* Gets the relation's type.
217217
*
218-
* @param string $name
219-
*
220218
* @return string
221219
*/
222220
public function getType()
@@ -289,7 +287,7 @@ protected function isModel($model)
289287
/**
290288
* Gets the name of the foreign model's primary key.
291289
*
292-
* @return sting
290+
* @return string
293291
*/
294292
public function getPrimaryKeyForForeignModel()
295293
{
@@ -364,7 +362,7 @@ protected function getFieldNamesFromResource()
364362
/**
365363
* Gets the foreign model fields from resource file
366364
*
367-
* @return mix (null | CrestApps\CodeGenerator\Models\Resource)
365+
* @return CrestApps\CodeGenerator\Models\Resource|null
368366
*/
369367
protected function getForeignResource()
370368
{
@@ -392,7 +390,7 @@ protected function getForeignModelName()
392390
/**
393391
* Gets a single instance of the foreign mode.
394392
*
395-
* @return Illuminate\Database\Eloquent\Model
393+
* @return Model
396394
*/
397395
private function getForeignModelInstance()
398396
{
@@ -433,7 +431,7 @@ public function toArray()
433431
*
434432
* @param array $options
435433
*
436-
* @return null | CrestApps\CodeGenerator\Model\ForeignRelationship
434+
* @return null | ForeignRelationship
437435
*/
438436
public static function get(array $options)
439437
{
@@ -469,7 +467,7 @@ public static function get(array $options)
469467
*
470468
* @param string $rawRelation
471469
*
472-
* @return null | CrestApps\CodeGenerator\Model\ForeignRelationship
470+
* @return null | ForeignRelationship
473471
*/
474472
public static function fromString($rawRelation)
475473
{
@@ -503,7 +501,7 @@ public static function fromString($rawRelation)
503501
* @param string $fieldName
504502
* @param string $modelPath
505503
*
506-
* @return null | CrestApps\CodeGenerator\Model\ForeignRelationship
504+
* @return null | ForeignRelationship
507505
*/
508506
public static function predict($fieldName, $modelPath)
509507
{

0 commit comments

Comments
 (0)