-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
literal-string in QueryBuilder::where()
* Start implementing literal-string checks with bleedingEdge * Use array<mixed> for where() for now * Use original stub whe not using bleedingEdge * Preserve QueryBuilder methods from original stub * Move stubs to a bleedingEdge sub-folder * Add 'use function' for phpcs
- Loading branch information
1 parent
aefeca7
commit 5a5454c
Showing
3 changed files
with
74 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Stubs\Doctrine; | ||
|
||
use PHPStan\PhpDoc\StubFilesExtension; | ||
use function dirname; | ||
|
||
class StubFilesExtensionLoader implements StubFilesExtension | ||
{ | ||
|
||
/** @var bool */ | ||
private $bleedingEdge; | ||
|
||
public function __construct( | ||
bool $bleedingEdge | ||
) | ||
{ | ||
$this->bleedingEdge = $bleedingEdge; | ||
} | ||
|
||
public function getFiles(): array | ||
{ | ||
$path = dirname(dirname(dirname(__DIR__))) . '/stubs'; | ||
|
||
if ($this->bleedingEdge === true) { | ||
$path .= '/bleedingEdge'; | ||
} | ||
|
||
return [ | ||
$path . '/ORM/QueryBuilder.stub', | ||
]; | ||
} | ||
|
||
} |
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,33 @@ | ||
<?php | ||
|
||
namespace Doctrine\ORM; | ||
|
||
class QueryBuilder | ||
{ | ||
|
||
/** | ||
* @return Query<mixed> | ||
*/ | ||
public function getQuery() | ||
{ | ||
} | ||
|
||
/** | ||
* @param \Doctrine\Common\Collections\ArrayCollection<array-key, mixed>|array<mixed> $parameters | ||
* @return static | ||
*/ | ||
public function setParameters($parameters) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @param literal-string|object|array<mixed> $predicates | ||
* @return $this | ||
*/ | ||
public function where($predicates) | ||
{ | ||
|
||
} | ||
|
||
} |