-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 292-skip-throw-exceptions
- Loading branch information
Showing
7 changed files
with
119 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Illuminate\Contracts\Database\Query; | ||
|
||
use Illuminate\Database\Grammar; | ||
|
||
if (interface_exists('Illuminate\Contracts\Database\Query\Expression')) { | ||
return; | ||
} | ||
|
||
interface Expression | ||
{ | ||
/** | ||
* Get the value of the expression. | ||
* | ||
* @return string|int|float | ||
*/ | ||
public function getValue(Grammar $grammar); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Illuminate\Database; | ||
|
||
if (class_exists('Illuminate\Database\Grammar')) { | ||
return; | ||
} | ||
|
||
abstract class Grammar {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Illuminate\Support\Facades; | ||
|
||
use Illuminate\Contracts\Database\Query\Expression; | ||
|
||
if (class_exists('\Illuminate\Support\Facades\DB')) { | ||
return; | ||
} | ||
|
||
/** | ||
* @method static Expression raw(mixed $value) | ||
*/ | ||
class DB {} |
15 changes: 15 additions & 0 deletions
15
tests/Rector/MethodCall/WhereToWhereLikeRector/Fixture/Default/skip_with_expressions.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace RectorLaravel\Tests\Rector\MethodCall\WhereToWhereLikeRector\Fixture\Default; | ||
|
||
use Illuminate\Contracts\Database\Query\Builder; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class SkipWithExpressions | ||
{ | ||
public function run(Builder $query) | ||
{ | ||
$query->where('name', 'like', DB::raw('Rector')); | ||
} | ||
} | ||
?> |
15 changes: 15 additions & 0 deletions
15
tests/Rector/MethodCall/WhereToWhereLikeRector/Fixture/Postgres/SkipWithExpressions.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace RectorLaravel\Tests\Rector\MethodCall\WhereToWhereLikeRector\Fixture\Postgres; | ||
|
||
use Illuminate\Contracts\Database\Query\Builder; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class SkipWithExpressions | ||
{ | ||
public function run(Builder $query) | ||
{ | ||
$query->where('name', 'like', DB::raw('Rector')); | ||
} | ||
} | ||
?> |