diff --git a/framework/core/src/Extend/ViewNamespace.php b/framework/core/src/Extend/View.php similarity index 87% rename from framework/core/src/Extend/ViewNamespace.php rename to framework/core/src/Extend/View.php index 1cbc03a3a..fd00ba2f6 100644 --- a/framework/core/src/Extend/ViewNamespace.php +++ b/framework/core/src/Extend/View.php @@ -13,9 +13,9 @@ use Flarum\Extension\Extension; use Illuminate\Contracts\Container\Container; use Illuminate\Contracts\View\Factory; -class ViewNamespace implements ExtenderInterface +class View implements ExtenderInterface { - private $adds = []; + private $namespaces = []; /** * Register a new namespace of Laravel views. @@ -33,9 +33,9 @@ class ViewNamespace implements ExtenderInterface * where view files are stored, relative to the extend.php file. * @return $this */ - public function add($namespace, $hints) + public function namespace($namespace, $hints) { - $this->adds[$namespace] = $hints; + $this->namespaces[$namespace] = $hints; return $this; } @@ -43,7 +43,7 @@ class ViewNamespace implements ExtenderInterface public function extend(Container $container, Extension $extension = null) { $container->resolving(Factory::class, function (Factory $view) { - foreach ($this->adds as $namespace => $hints) { + foreach ($this->namespaces as $namespace => $hints) { $view->addNamespace($namespace, $hints); } }); diff --git a/framework/core/tests/integration/extenders/ViewNamespaceTest.php b/framework/core/tests/integration/extenders/ViewTest.php similarity index 84% rename from framework/core/tests/integration/extenders/ViewNamespaceTest.php rename to framework/core/tests/integration/extenders/ViewTest.php index 24d54524b..06541ec6f 100644 --- a/framework/core/tests/integration/extenders/ViewNamespaceTest.php +++ b/framework/core/tests/integration/extenders/ViewTest.php @@ -13,7 +13,7 @@ use Flarum\Extend; use Flarum\Tests\integration\TestCase; use Illuminate\Contracts\View\Factory; -class ViewNamespaceTest extends TestCase +class ViewTest extends TestCase { /** * @test @@ -30,8 +30,8 @@ class ViewNamespaceTest extends TestCase public function custom_view_namespace_can_be_added_by_extender() { $this->extend( - (new Extend\ViewNamespace) - ->add('integration.test', dirname(__FILE__, 3).'/fixtures/views') + (new Extend\View) + ->namespace('integration.test', dirname(__FILE__, 3).'/fixtures/views') ); $this->assertEquals('Hello World!', trim($this->app()->getContainer()->make(Factory::class)->make('integration.test::test')->render()));