Files
DesignPatternsPHP/Behavioral/Interpreter/AndExp.php
Roman Martinuk dea71e83b4 PHP 8
2021-04-13 00:29:24 +03:00

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);
}
}