Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rustamwin committed Jul 11, 2023
1 parent 430d2f1 commit 50ad081
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
7 changes: 0 additions & 7 deletions src/ViewInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,6 @@ public function withLocale(string $locale): static;
*/
public function getBasePath(): string;

/**
* Gets the context instance, or `null` if no context has been set.
*
* @return ViewContextInterface|null The context instance, or `null` if no context has been set.
*/
public function getContext(): ?ViewContextInterface;

/**
* Gets the default view file extension.
*
Expand Down
10 changes: 1 addition & 9 deletions src/ViewTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function withBasePath(string $basePath): static
* corresponding supported file extensions.
*
* ```php
* $view = $view->withRenderers(['twig' => new \Yiisoft\View\Twig\TemplateRenderer($environment)]);
* $view = $view->withRenderers(['twig' => new \Yiisoft\View\Twig\ViewRenderer($environment)]);
* ```
*
* If no renderer is available for the given view file, the view file will be treated as a normal PHP
Expand Down Expand Up @@ -184,14 +184,6 @@ public function getBasePath(): string
return $this->basePath;
}

/**
* Gets the context instance, or `null` if no context has been set.
*/
public function getContext(): ?ViewContextInterface
{
return $this->context;
}

/**
* Gets the default view file extension.
*
Expand Down
9 changes: 0 additions & 9 deletions tests/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,6 @@ public function testRenderWithoutFileExtension(): void
->render('file'));
}

public function testContext(): void
{
$view = $this->createViewWithBasePath($this->tempDirectory);
$context = $this->createContext($this->tempDirectory);
$view = $view->withContext($context);

$this->assertSame($context, $view->getContext());
}

public function testLocalize(): void
{
$view = $this->createViewWithBasePath($this->tempDirectory);
Expand Down

0 comments on commit 50ad081

Please sign in to comment.