Source of file ExpressionLanguage.php
Size: 1,460 Bytes - Last Modified: 2021-12-24T06:50:57+00:00
/var/www/docs.ssmods.com/process/src/src/ExpressionLanguage.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 | <?php namespace Heyday\CacheInclude; use SilverStripe\ORM\DataList; use Symfony\Component\ExpressionLanguage\ExpressionLanguage as SymfonyExpressionLanguage; class ExpressionLanguage extends SymfonyExpressionLanguage implements \Serializable { protected function registerFunctions() { parent::registerFunctions(); $this->register( 'list', function ($arg) { return sprintf('%s::get()', $arg); }, function (array $variables, $value) { return DataList::create($value); } ); $this->register( 'instanceof', function ($arg0, $arg1) { return sprintf('%s instanceof %s', $arg0, $arg1); }, function (array $variables, $arg0, $arg1) { return $arg0 instanceof $arg1; } ); $this->register( 'key_exists', function ($arg0, $arg1) { return sprintf('array_key_exists(%s, %s)', $arg0, $arg1); }, function (array $variables, $arg0, $arg1) { return array_key_exists($arg0, $arg1); } ); } /** * @return null */ public function serialize() { return null; } /** * @param string $serialized */ public function unserialize($serialized) { $this->__construct(); } } |