mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-25 09:11:17 +02:00
16 lines
375 B
PHP
16 lines
375 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Behavioral\Interpreter;
|
|
|
|
class AndExp extends AbstractExp
|
|
{
|
|
public function __construct(private AbstractExp $first, private AbstractExp $second)
|
|
{
|
|
}
|
|
|
|
public function interpret(Context $context): bool
|
|
{
|
|
return $this->first->interpret($context) && $this->second->interpret($context);
|
|
}
|
|
}
|