Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [Pager] knocks down variables for View #7758

Merged
merged 4 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -2786,10 +2786,5 @@
'count' => 1,
'path' => __DIR__ . '/system/View/View.php',
];
$ignoreErrors[] = [
'message' => '#^Property CodeIgniter\\\\View\\\\View\\:\\:\\$tempData has no type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/View/View.php',
];

return ['parameters' => ['ignoreErrors' => $ignoreErrors]];
2 changes: 1 addition & 1 deletion system/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public static function pager(?PagerConfig $config = null, ?RendererInterface $vi
}

$config ??= config(PagerConfig::class);
$view ??= AppServices::renderer();
$view ??= AppServices::renderer(null, null, false);

return new Pager($config, $view);
}
Expand Down
2 changes: 1 addition & 1 deletion system/Pager/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function displayLinks(string $group, string $template): string
$pager = new PagerRenderer($this->getDetails($group));

return $this->view->setVar('pager', $pager)
->render($this->config->templates[$template], null, false);
->render($this->config->templates[$template]);
}

/**
Expand Down
8 changes: 5 additions & 3 deletions system/View/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ class View implements RendererInterface
use ViewDecoratorTrait;

/**
* Data that is made available to the Views.
* Saved Data.
*
* @var array
*/
protected $data = [];

/**
* Merge savedData and userData
* Data for the variables that are available in the Views.
*
* @var array|null
*/
protected $tempData;

Expand All @@ -48,7 +50,7 @@ class View implements RendererInterface
protected $viewPath;

/**
* The render variables
* Data for rendering including Caching and Debug Toolbar data.
*
* @var array
*/
Expand Down