1
0
mirror of https://github.com/DesignPatternsPHP/DesignPatternsPHP.git synced 2025-06-22 09:13:53 +02:00
Files
Mario Simão 56970cc221 style: Adopt PSR12
Dev dependency flyeralarm/php-code-validator has been removed.

Closes 
2021-10-01 10:26:04 -03:00

26 lines
418 B
PHP

<?php
declare(strict_types=1);
namespace DesignPatterns\Behavioral\Interpreter;
/**
* This TerminalExpression
*/
class VariableExp extends AbstractExp
{
public function __construct(private string $name)
{
}
public function interpret(Context $context): bool
{
return $context->lookUp($this->name);
}
public function getName(): string
{
return $this->name;
}
}