-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow using arrays in sequence operations without wrapping with Param…
…eter; Update changelog
- Loading branch information
Showing
5 changed files
with
84 additions
and
26 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
33 changes: 33 additions & 0 deletions
33
src/Exception/CompilerException/UnexpectedOperatorException.php
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 | ||
|
||
/** | ||
* This file is part of Cycle ORM package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Cycle\Database\Exception\CompilerException; | ||
|
||
use Cycle\Database\Exception\CompilerException; | ||
|
||
class UnexpectedOperatorException extends CompilerException | ||
{ | ||
/** | ||
* Exception for the value sequence (IN or NOT IN operator). | ||
* | ||
* @param string $operator User-provided operator. | ||
*/ | ||
public static function sequence(string $operator): self | ||
{ | ||
return new self( | ||
\sprintf( | ||
'Unable to compile query, unexpected operator `%s` provided for a value sequence. %s', | ||
$operator, | ||
'Allowed operators: `IN`, `NOT IN` (or `=`, `!=` as sugar).' | ||
) | ||
); | ||
} | ||
} |
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