PHP 8.2.30
Preview: ExpressionLanguage.php Size: 1.19 KB
/proc/thread-self/root/opt/alt/php55/usr/share/pear/Symfony/Component/DependencyInjection/ExpressionLanguage.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\DependencyInjection;

use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;

/**
 * Adds some function to the default ExpressionLanguage.
 *
 * To get a service, use service('request').
 * To get a parameter, use parameter('kernel.debug').
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class ExpressionLanguage extends BaseExpressionLanguage
{
    protected function registerFunctions()
    {
        parent::registerFunctions();

        $this->register('service', function ($arg) {
            return sprintf('$this->get(%s)', $arg);
        }, function (array $variables, $value) {
            return $variables['container']->get($value);
        });

        $this->register('parameter', function ($arg) {
            return sprintf('$this->getParameter(%s)', $arg);
        }, function (array $variables, $value) {
            return $variables['container']->getParameter($value);
        });
    }
}

Directory Contents

Dirs: 7 × Files: 19

Name Size Perms Modified Actions
Compiler DIR
- drwxr-xr-x 2024-03-03 22:54:39
Edit Download
Dumper DIR
- drwxr-xr-x 2024-03-03 22:54:39
Edit Download
Exception DIR
- drwxr-xr-x 2024-03-03 22:54:39
Edit Download
Extension DIR
- drwxr-xr-x 2024-03-03 22:54:39
Edit Download
LazyProxy DIR
- drwxr-xr-x 2024-03-03 22:54:39
Edit Download
Loader DIR
- drwxr-xr-x 2024-03-03 22:54:39
Edit Download
- drwxr-xr-x 2024-03-03 22:54:39
Edit Download
1.25 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
349 B lrw-r--r-- 2019-12-18 11:24:05
Edit Download
16.57 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
873 B lrw-r--r-- 2019-12-18 11:24:05
Edit Download
714 B lrw-r--r-- 2019-12-18 11:24:05
Edit Download
755 B lrw-r--r-- 2019-12-18 11:24:05
Edit Download
32.63 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
3.77 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
14.30 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
4.58 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
1.19 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
834 B lrw-r--r-- 2019-12-18 11:24:05
Edit Download
767 B lrw-r--r-- 2019-12-18 11:24:05
Edit Download
1.54 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
877 B lrw-r--r-- 2019-12-18 11:24:05
Edit Download
538 B lrw-r--r-- 2019-12-18 11:24:05
Edit Download
3.32 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
749 B lrw-r--r-- 2019-12-18 11:24:05
Edit Download
823 B lrw-r--r-- 2019-12-18 11:24:05
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).