Skip to content

Commit

Permalink
refactor: ViewDecoratorTrait
Browse files Browse the repository at this point in the history
Use `View::$config` instead of  `config()` function
  • Loading branch information
mostafakhudair authored Oct 9, 2023
1 parent f277814 commit 67f8876
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions system/View/ViewDecoratorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace CodeIgniter\View;

use CodeIgniter\View\Exceptions\ViewException;
use Config\View as ViewConfig;

trait ViewDecoratorTrait
{
Expand All @@ -22,9 +21,7 @@ trait ViewDecoratorTrait
*/
protected function decorateOutput(string $html): string
{
$decorators = \config(ViewConfig::class)->decorators;

foreach ($decorators as $decorator) {
foreach ($this->config->decorators as $decorator) {
if (! is_subclass_of($decorator, ViewDecoratorInterface::class)) {
throw ViewException::forInvalidDecorator($decorator);
}
Expand Down

0 comments on commit 67f8876

Please sign in to comment.