PHP 8.2.30
Preview: ClosureLoader.php Size: 1.10 KB
//opt/cloudlinux/alt-php53/root/usr/share/pear/Symfony/Component/Routing/Loader/ClosureLoader.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\Routing\Loader;

use Symfony\Component\Config\Loader\Loader;
use Symfony\Component\Routing\RouteCollection;

/**
 * ClosureLoader loads routes from a PHP closure.
 *
 * The Closure must return a RouteCollection instance.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 *
 * @api
 */
class ClosureLoader extends Loader
{
    /**
     * Loads a Closure.
     *
     * @param \Closure    $closure A Closure
     * @param string|null $type    The resource type
     *
     * @return RouteCollection A RouteCollection instance
     *
     * @api
     */
    public function load($closure, $type = null)
    {
        return call_user_func($closure);
    }

    /**
     * {@inheritdoc}
     *
     * @api
     */
    public function supports($resource, $type = null)
    {
        return $resource instanceof \Closure && (!$type || 'closure' === $type);
    }
}

Directory Contents

Dirs: 1 × Files: 7

Name Size Perms Modified Actions
schema DIR
- drwxr-xr-x 2024-03-03 22:55:08
Edit Download
7.64 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
2.25 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
3.41 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
1.10 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
1.46 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
9.07 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download
8.08 KB lrw-r--r-- 2019-12-18 11:20:42
Edit Download

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