1
0
mirror of https://github.com/flarum/core.git synced 2025-10-13 07:54:25 +02:00
Files
php-flarum/src/Extend/Compat.php

40 lines
937 B
PHP

<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Extend;
use Flarum\Extension\Extension;
use Illuminate\Contracts\Container\Container;
/**
* This class is used to wrap old bootstrap.php closures (as used in versions up
* to 0.1.0-beta7) in the new Extender format.
*
* This gives extensions the chance to work with the new API without making any
* changes, and have some time to convert to the pure usage of extenders.
*
* @deprecated
*/
class Compat implements ExtenderInterface
{
protected $callback;
public function __construct($callback)
{
$this->callback = $callback;
}
public function extend(Container $container, Extension $extension = null)
{
$container->call($this->callback);
}
}