Skip to content

Commit

Permalink
use namespaced functions
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSimal committed Oct 16, 2023
1 parent b92e78b commit a515bfe
Show file tree
Hide file tree
Showing 26 changed files with 39 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Cache/Engine/DebugEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Cake\Cache\CacheEngine;
use Cake\Cache\CacheRegistry;
use Psr\Log\LoggerInterface;
use function Cake\Core\namespaceSplit;

/**
* A spying proxy for cache engines.
Expand Down
1 change: 1 addition & 0 deletions src/Controller/MailPreviewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use DebugKit\Mailer\PreviewResult;
use DebugKit\Mailer\SentMailResult;
use Psr\Http\Message\ResponseInterface;
use function Cake\Collection\collection;

/**
* Provides access to the MailPreview classes for visually debugging email sending
Expand Down
1 change: 1 addition & 0 deletions src/DebugPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Cake\Event\EventInterface;
use Cake\Event\EventListenerInterface;
use Cake\Utility\Inflector;
use function Cake\Core\namespaceSplit;

/**
* Base class for debug panels.
Expand Down
1 change: 1 addition & 0 deletions src/DebugTimer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
namespace DebugKit;

use Cake\Error\Debugger;
use function Cake\Core\env;

/**
* Contains methods for Profiling and creating timers.
Expand Down
1 change: 1 addition & 0 deletions src/ToolbarService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use DebugKit\Panel\PanelRegistry;
use Exception;
use Psr\Http\Message\ResponseInterface;
use function Cake\Core\env;

/**
* Used to create the panels and inject a toolbar into
Expand Down
1 change: 1 addition & 0 deletions src/View/Helper/CredentialsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

use Cake\Utility\Hash;
use Cake\View\Helper;
use function Cake\Core\h;

/**
* CredentialsHelper
Expand Down
2 changes: 2 additions & 0 deletions templates/Dashboard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* @var \App\View\AppView $this
*/

use function Cake\Core\h;
?>
<h1>Debug Kit Dashboard</h1>

Expand Down
3 changes: 3 additions & 0 deletions templates/MailPreview/email.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<?php
use function Cake\Core\h;
?>
<style>
html, body {
height: 100%;
Expand Down
3 changes: 3 additions & 0 deletions templates/MailPreview/index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<?php
use function Cake\Core\h;
?>
<?php foreach ($mailPreviews as $plugin => $previews) : ?>
<h3><?= $plugin ?></h3>
<?php foreach ($previews as $preview) : ?>
Expand Down
1 change: 1 addition & 0 deletions templates/Panels/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @var \DebugKit\View\AjaxView $this
* @var \DebugKit\Model\Entity\Panel $panel
*/
use function Cake\Core\h;
?>
<h2 class="c-panel__title"><?= h($panel->title) ?></h2>
<div class="c-panel__content">
Expand Down
1 change: 1 addition & 0 deletions templates/Requests/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Cake\Routing\Router;
use Cake\Core\Configure;
use Cake\Utility\Inflector;
use function Cake\Core\h;

?>
<div class="c-panel-content-container js-panel-content-container">
Expand Down
1 change: 1 addition & 0 deletions templates/element/cache_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* @var array $metrics
* @var array $logs
*/
use function Cake\Core\h;
?>
<div class="c-cache-panel">
<?php if (empty($metrics)) : ?>
Expand Down
2 changes: 2 additions & 0 deletions templates/element/deprecations_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* @var array $other
*/

use function Cake\Core\h;

$printer = function ($section, $data) {
?>
<h3><?= h(ucfirst($section)) ?> </h3>
Expand Down
2 changes: 2 additions & 0 deletions templates/element/environment_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* @var array $cake
* @var array $php
*/

use function Cake\Core\h;
?>

<div class="c-environment-panel">
Expand Down
2 changes: 2 additions & 0 deletions templates/element/history_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* @var \DebugKit\Model\Entity\Panel $panel
* @var array $requests
*/

use function Cake\Core\h;
?>
<div id="request-history" class="c-history-panel" data-panel-id="<?= $panel->id ?>">
<?php if (empty($requests)) : ?>
Expand Down
2 changes: 2 additions & 0 deletions templates/element/log_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* @var \DebugKit\View\AjaxView $this
* @var \DebugKit\Log\Engine\DebugKitLog $logger
*/

use function Cake\Core\h;
?>
<div class="c-log-panel">
<?php if ($logger->noLogs()) : ?>
Expand Down
2 changes: 2 additions & 0 deletions templates/element/mail_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* @var $panel \DebugKit\Model\Entity\Panel
*/

use function Cake\Core\h;
?>
<div class="c-mail-panel">
<p class="c-flash c-flash--info">
Expand Down
1 change: 1 addition & 0 deletions templates/element/packages_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @var \DebugKit\View\AjaxView $this
* @var array $packages
*/
use function Cake\Core\h;
?>
<div class="c-packages-panel"
data-base-url="<?= $this->Url->build([
Expand Down
1 change: 1 addition & 0 deletions templates/element/preview_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/**
* @var \DebugKit\Mailer\AbstractResult $email
*/
use function Cake\Core\h;
?>
<header>
<table>
Expand Down
1 change: 1 addition & 0 deletions templates/element/routes_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Cake\Core\Plugin as CorePlugin;
use Cake\Utility\Hash;
use Cake\Utility\Text;
use function Cake\Core\h;

$routes = Cake\Routing\Router::routes();

Expand Down
1 change: 1 addition & 0 deletions templates/element/sql_log_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

use Doctrine\SqlFormatter\HtmlHighlighter;
use Doctrine\SqlFormatter\SqlFormatter;
use function Cake\Core\h;

$noOutput = true;
?>
Expand Down
1 change: 1 addition & 0 deletions templates/element/timer_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @var int $peakMemory
* @var array $memory
*/
use function Cake\Core\h;
?>
<div class="c-timer-panel">
<section>
Expand Down
5 changes: 4 additions & 1 deletion templates/layout/mailer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php $this->extend('toolbar') ?>
<?php
use function Cake\Core\h;
$this->extend('toolbar');
?>

<div style="height:calc(100vh);overflow-y:scroll">
<?php if (empty($noHeader)) : ?>
Expand Down
1 change: 1 addition & 0 deletions templates/layout/toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/**
* @var \DebugKit\View\AjaxView $this
*/
use function Cake\Core\h;
?>
<!DOCTYPE html>
<html>
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Panel/DeprecationsPanelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Cake\Event\Event;
use Cake\TestSuite\TestCase;
use DebugKit\Panel\DeprecationsPanel;
use function Cake\Core\deprecationWarning;

/**
* Class DeprecationsPanelTest
Expand Down
3 changes: 1 addition & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Cake\Log\Log;
use Cake\TestSuite\Fixture\SchemaLoader;
use DebugKit\DebugKitPlugin;
use function Cake\Core\env;

require_once 'vendor/autoload.php';

Expand All @@ -42,8 +43,6 @@
define('LOGS', TMP);

require_once CORE_PATH . 'config/bootstrap.php';
require_once CAKE . 'Core/functions_global.php';
require_once CAKE . 'Collection/functions_global.php';

date_default_timezone_set('UTC');
mb_internal_encoding('UTF-8');
Expand Down

0 comments on commit a515bfe

Please sign in to comment.