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

Raise required yiisoft/view version to ^10.0 #122

Merged
merged 1 commit into from
Jul 1, 2024
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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Yii View Renderer Change Log

## 7.0.1 under development
## 7.1.0 under development

- no changes in this release.
- Chg #122: Raise required `yiisoft/view` version to `^10.0` (@vjik)

## 7.0.0 June 22, 2024

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"yiisoft/friendly-exception": "^1.0",
"yiisoft/html": "^2.5|^3.0",
"yiisoft/strings": "^2.0",
"yiisoft/view": "^9.0"
"yiisoft/view": "^10.0"
},
"require-dev": {
"httpsoft/http-message": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/ViewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
public function withAddedInjections(object|string ...$injections): self
{
$new = clone $this;
$new->setInjections(array_merge($this->injections, $injections));

Check warning on line 262 in src/ViewRenderer.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.2-ubuntu-latest

Escaped Mutant for Mutator "UnwrapArrayMerge": --- Original +++ New @@ @@ public function withAddedInjections(object|string ...$injections) : self { $new = clone $this; - $new->setInjections(array_merge($this->injections, $injections)); + $new->setInjections($this->injections); return $new; } /**

Check warning on line 262 in src/ViewRenderer.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.2-ubuntu-latest

Escaped Mutant for Mutator "UnwrapArrayMerge": --- Original +++ New @@ @@ public function withAddedInjections(object|string ...$injections) : self { $new = clone $this; - $new->setInjections(array_merge($this->injections, $injections)); + $new->setInjections($injections); return $new; } /**

Check warning on line 262 in src/ViewRenderer.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.2-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ public function withAddedInjections(object|string ...$injections) : self { $new = clone $this; - $new->setInjections(array_merge($this->injections, $injections)); + return $new; } /**
return $new;
}

Expand All @@ -282,7 +282,7 @@
*/
public function withLocale(string $locale): self
{
$new = clone $this;

Check warning on line 285 in src/ViewRenderer.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.2-ubuntu-latest

Escaped Mutant for Mutator "CloneRemoval": --- Original +++ New @@ @@ */ public function withLocale(string $locale) : self { - $new = clone $this; + $new = $this; $new->locale = $locale; return $new; }
$new->locale = $locale;
return $new;
}
Expand Down Expand Up @@ -342,7 +342,7 @@

return $currentView
->setParameters($layoutParameters)
->renderFile($layout, ['content' => $content]);
->render($layout, ['content' => $content]);
}

/**
Expand Down Expand Up @@ -419,7 +419,7 @@
foreach ($this->getPreparedInjections() as $injection) {
if ($injection instanceof $injectionInterface) {
$result[] = $injection;
continue;

Check warning on line 422 in src/ViewRenderer.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.2-ubuntu-latest

Escaped Mutant for Mutator "Continue_": --- Original +++ New @@ @@ foreach ($this->getPreparedInjections() as $injection) { if ($injection instanceof $injectionInterface) { $result[] = $injection; - continue; + break; } if ($injection instanceof LayoutSpecificInjections && $injection->getLayout() === $layout) { foreach ($injection->getInjections() as $layoutInjection) {
}
if ($injection instanceof LayoutSpecificInjections && $injection->getLayout() === $layout) {
foreach ($injection->getInjections() as $layoutInjection) {
Expand Down Expand Up @@ -541,7 +541,7 @@
return $cache[$class];
}

if (preg_match('/(?:.*controller\\\|.*controllers\\\)([\w\\\]+)controller$/iU', $class, $m) && !empty($m[1])) {

Check warning on line 544 in src/ViewRenderer.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.2-ubuntu-latest

Escaped Mutant for Mutator "PregMatchRemoveFlags": --- Original +++ New @@ @@ if (array_key_exists($class, $cache)) { return $cache[$class]; } - if (preg_match('/(?:.*controller\\\\|.*controllers\\\\)([\\w\\\\]+)controller$/iU', $class, $m) && !empty($m[1])) { + if (preg_match('/(?:.*controller\\\\|.*controllers\\\\)([\\w\\\\]+)controller$/i', $class, $m) && !empty($m[1])) { $name = $m[1]; } elseif (preg_match('/(\\w+)controller$/iU', $class, $m) && !empty($m[1])) { $name = $m[1];
$name = $m[1];
} elseif (preg_match('/(\w+)controller$/iU', $class, $m) && !empty($m[1])) {
$name = $m[1];
Expand Down
2 changes: 1 addition & 1 deletion tests/views/nested-layout/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

$this->beginPage();
echo '<html>';
echo $this->render('head');
echo $this->render('./head');
echo '<body>';
echo '<h1>' . $title . '</h1>';
echo $content;
Expand Down
2 changes: 1 addition & 1 deletion tests/views/nested/nested-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @var string $name
*/

echo($label ?? 'nested-1') . ': ' . $name . '. ' . $this->render('nested-2');
echo($label ?? 'nested-1') . ': ' . $name . '. ' . $this->render('./nested-2');
2 changes: 1 addition & 1 deletion tests/views/nested/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
* @var string $label
*/

echo $label . ': ' . $name . '. ' . $this->render('nested-1');
echo $label . ': ' . $name . '. ' . $this->render('./nested-1');
Loading