Skip to content

Commit

Permalink
Replace return type Query\Builder with Eloquent\Builder (barryvdh#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjio committed Oct 29, 2024
1 parent be97950 commit 9436d2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Method.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ protected function normalizeReturn(DocBlock $phpdoc)

if ($tag->getType() === '$this') {
in_array(ltrim($this->root, '\\'), [EloquentBuilder::class, QueryBuilder::class])
? $tag->setType($this->root . '|static')
? $tag->setType(EloquentBuilder::class . '|static')
: $tag->setType($this->root);
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/MethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function testQueryBuilderNormalizedReturnType()
* @param string|array|\Illuminate\Contracts\Database\Query\Expression $columns
* @param string $boolean
* @param bool $not
* @return \Illuminate\Database\Query\Builder|static
* @return \Illuminate\Database\Eloquent\Builder|static
* @static
*/
DOC;
Expand All @@ -147,7 +147,7 @@ public function testQueryBuilderNormalizedReturnType()
$this->assertSame(['$columns', "\$boolean = 'and'", '$not = false'], $method->getParamsWithDefault(false));
$this->assertTrue($method->shouldReturn());
$this->assertSame('$this', $method->getReturn());
$this->assertSame('\Illuminate\Database\Query\Builder|static', rtrim($method->getReturnTag()->getType()));
$this->assertSame('\Illuminate\Database\Eloquent\Builder|static', rtrim($method->getReturnTag()->getType()));
}

/**
Expand Down

0 comments on commit 9436d2c

Please sign in to comment.