-
Notifications
You must be signed in to change notification settings - Fork 635
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed6e390
commit 41686b5
Showing
3 changed files
with
154 additions
and
37 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
37 changes: 37 additions & 0 deletions
37
src/web/twig/nodes/expressions/binaries/HasEveryBinary.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,37 @@ | ||
<?php | ||
/** | ||
* @link https://craftcms.com/ | ||
* @copyright Copyright (c) Pixel & Tonic, Inc. | ||
* @license https://craftcms.github.io/license/ | ||
*/ | ||
|
||
namespace craft\web\twig\nodes\expressions\binaries; | ||
|
||
use craft\web\twig\Extension; | ||
use Twig\Compiler; | ||
use Twig\Node\Expression\Binary\AbstractBinary; | ||
|
||
/** | ||
* Class HasEveryBinary | ||
* | ||
* @author Pixel & Tonic, Inc. <[email protected]> | ||
* @since 4.12.2 | ||
*/ | ||
class HasEveryBinary extends AbstractBinary | ||
{ | ||
public function compile(Compiler $compiler): void | ||
{ | ||
$compiler | ||
->raw(sprintf('%s::arrayEvery($this->env, ', Extension::class)) | ||
->subcompile($this->getNode('left')) | ||
->raw(', ') | ||
->subcompile($this->getNode('right')) | ||
->raw(')') | ||
; | ||
} | ||
|
||
public function operator(Compiler $compiler): Compiler | ||
{ | ||
return $compiler->raw(''); | ||
} | ||
} |
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,37 @@ | ||
<?php | ||
/** | ||
* @link https://craftcms.com/ | ||
* @copyright Copyright (c) Pixel & Tonic, Inc. | ||
* @license https://craftcms.github.io/license/ | ||
*/ | ||
|
||
namespace craft\web\twig\nodes\expressions\binaries; | ||
|
||
use craft\web\twig\Extension; | ||
use Twig\Compiler; | ||
use Twig\Node\Expression\Binary\AbstractBinary; | ||
|
||
/** | ||
* Class HasSomeBinary | ||
* | ||
* @author Pixel & Tonic, Inc. <[email protected]> | ||
* @since 4.12.2 | ||
*/ | ||
class HasSomeBinary extends AbstractBinary | ||
{ | ||
public function compile(Compiler $compiler): void | ||
{ | ||
$compiler | ||
->raw(sprintf('%s::arraySome($this->env, ', Extension::class)) | ||
->subcompile($this->getNode('left')) | ||
->raw(', ') | ||
->subcompile($this->getNode('right')) | ||
->raw(')') | ||
; | ||
} | ||
|
||
public function operator(Compiler $compiler): Compiler | ||
{ | ||
return $compiler->raw(''); | ||
} | ||
} |