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

[Rector] Apply Rector to app/Views #7169

Merged
merged 2 commits into from Jan 25, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 14 additions & 9 deletions app/Views/errors/html/error_exception.php
@@ -1,4 +1,9 @@
<?php $error_id = uniqid('error', true); ?>
<?php
use Config\Services;
use CodeIgniter\CodeIgniter;

$errorId = uniqid('error', true);
?>
<!doctype html>
<html>
<head>
Expand Down Expand Up @@ -77,16 +82,16 @@
<?php if (isset($row['class'])) : ?>
&nbsp;&nbsp;&mdash;&nbsp;&nbsp;<?= esc($row['class'] . $row['type'] . $row['function']) ?>
<?php if (! empty($row['args'])) : ?>
<?php $args_id = $error_id . 'args' . $index ?>
( <a href="#" onclick="return toggle('<?= esc($args_id, 'attr') ?>');">arguments</a> )
<div class="args" id="<?= esc($args_id, 'attr') ?>">
<?php $argsId = $errorId . 'args' . $index ?>
( <a href="#" onclick="return toggle('<?= esc($argsId, 'attr') ?>');">arguments</a> )
<div class="args" id="<?= esc($argsId, 'attr') ?>">
<table cellspacing="0">

<?php
$params = null;
// Reflection by name is not available for closure function
if (substr($row['function'], -1) !== '}') {
$mirror = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']);
$mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
$params = $mirror->getParameters();
}

Expand Down Expand Up @@ -189,7 +194,7 @@

<!-- Request -->
<div class="content" id="request">
<?php $request = \Config\Services::request(); ?>
<?php $request = Services::request(); ?>

<table>
<tbody>
Expand Down Expand Up @@ -297,7 +302,7 @@

<!-- Response -->
<?php
$response = \Config\Services::response();
$response = Services::response();
$response->setStatusCode(http_response_code());
?>
<div class="content" id="response">
Expand All @@ -322,7 +327,7 @@
</tr>
</thead>
<tbody>
<?php foreach ($headers as $name => $header) : ?>
<?php foreach (array_keys($headers) as $name) : ?>
<tr>
<td><?= esc($name, 'html') ?></td>
<td><?= esc($response->getHeaderLine($name), 'html') ?></td>
Expand Down Expand Up @@ -377,7 +382,7 @@
<p>
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(\CodeIgniter\CodeIgniter::CI_VERSION) ?>
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?>
</p>

</div>
Expand Down
1 change: 0 additions & 1 deletion rector.php
Expand Up @@ -74,7 +74,6 @@

// is there a file you need to skip?
$rectorConfig->skip([
__DIR__ . '/app/Views',
__DIR__ . '/system/Debug/Toolbar/Views/toolbar.tpl.php',
__DIR__ . '/system/ThirdParty',
__DIR__ . '/tests/system/Config/fixtures',
Expand Down