Skip to content

Commit c58889b

Browse files
authored
Merge pull request #7169 from samsonasik/apply-rector-view
[Rector] Apply Rector to app/Views
2 parents 994023d + ba96124 commit c58889b

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

app/Views/errors/html/error_exception.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
<?php $error_id = uniqid('error', true); ?>
1+
<?php
2+
use Config\Services;
3+
use CodeIgniter\CodeIgniter;
4+
5+
$errorId = uniqid('error', true);
6+
?>
27
<!doctype html>
38
<html>
49
<head>
@@ -77,16 +82,16 @@
7782
<?php if (isset($row['class'])) : ?>
7883
&nbsp;&nbsp;&mdash;&nbsp;&nbsp;<?= esc($row['class'] . $row['type'] . $row['function']) ?>
7984
<?php if (! empty($row['args'])) : ?>
80-
<?php $args_id = $error_id . 'args' . $index ?>
81-
( <a href="#" onclick="return toggle('<?= esc($args_id, 'attr') ?>');">arguments</a> )
82-
<div class="args" id="<?= esc($args_id, 'attr') ?>">
85+
<?php $argsId = $errorId . 'args' . $index ?>
86+
( <a href="#" onclick="return toggle('<?= esc($argsId, 'attr') ?>');">arguments</a> )
87+
<div class="args" id="<?= esc($argsId, 'attr') ?>">
8388
<table cellspacing="0">
8489

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

@@ -189,7 +194,7 @@
189194

190195
<!-- Request -->
191196
<div class="content" id="request">
192-
<?php $request = \Config\Services::request(); ?>
197+
<?php $request = Services::request(); ?>
193198

194199
<table>
195200
<tbody>
@@ -297,7 +302,7 @@
297302

298303
<!-- Response -->
299304
<?php
300-
$response = \Config\Services::response();
305+
$response = Services::response();
301306
$response->setStatusCode(http_response_code());
302307
?>
303308
<div class="content" id="response">
@@ -322,7 +327,7 @@
322327
</tr>
323328
</thead>
324329
<tbody>
325-
<?php foreach ($headers as $name => $header) : ?>
330+
<?php foreach (array_keys($headers) as $name) : ?>
326331
<tr>
327332
<td><?= esc($name, 'html') ?></td>
328333
<td><?= esc($response->getHeaderLine($name), 'html') ?></td>
@@ -377,7 +382,7 @@
377382
<p>
378383
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
379384
PHP: <?= esc(PHP_VERSION) ?> &mdash;
380-
CodeIgniter: <?= esc(\CodeIgniter\CodeIgniter::CI_VERSION) ?>
385+
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?>
381386
</p>
382387

383388
</div>

rector.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474

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

0 commit comments

Comments
 (0)