mirror of
https://github.com/flarum/framework.git
synced 2025-05-14 18:22:39 +08:00

This helps us in decoupling from Laravel, as we only need any implementation of the container contract now.
25 lines
527 B
PHP
25 lines
527 B
PHP
<?php namespace Flarum\Extend;
|
|
|
|
use Illuminate\Contracts\Container\Container;
|
|
|
|
class Formatter implements ExtenderInterface
|
|
{
|
|
protected $name;
|
|
|
|
protected $class;
|
|
|
|
protected $priority;
|
|
|
|
public function __construct($name, $class, $priority = 0)
|
|
{
|
|
$this->name = $name;
|
|
$this->class = $class;
|
|
$this->priority = $priority;
|
|
}
|
|
|
|
public function extend(Container $container)
|
|
{
|
|
$container->make('flarum.formatter')->add($this->name, $this->class, $this->priority);
|
|
}
|
|
}
|