Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 22, 2019
1 parent 83fab70 commit 6930c41
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 15 deletions.
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@
},
"suggest": {
"ext-pdo_sqlite": "DebugKit needs to store panel data in a database. SQLite is simple and easy to use."
},
"scripts": {
"check": [
"@cs-check",
"@test"
],
"cs-check": "phpcs --colors -p src/ tests/",
"cs-fix": "phpcbf --colors -p src/ tests/"
}
}
2 changes: 1 addition & 1 deletion src/Cache/Engine/DebugEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function init(array $config = [])

return true;
}
$registry = new CacheRegistry;
$registry = new CacheRegistry();
$this->_engine = $registry->load('spies', $this->_config);
unset($registry);

Expand Down
4 changes: 2 additions & 2 deletions src/Controller/MailPreviewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected function getMailPreviewClasses()
$base = str_replace(".php", "", basename($file));
$class = App::className($plugin . $base, 'Mailer/Preview');
if ($class) {
yield ['plugin' => trim($plugin, '.'), 'class' => new $class];
yield ['plugin' => trim($plugin, '.'), 'class' => new $class()];
}
}
});
Expand Down Expand Up @@ -269,7 +269,7 @@ protected function findPreview($previewName, $emailName, $plugin = null)
if (!$realClass) {
throw new NotFoundException("Mailer preview ${previewName} not found");
}
$mailPreview = new $realClass;
$mailPreview = new $realClass();

$email = $mailPreview->find($emailName);
if (!$email) {
Expand Down
1 change: 0 additions & 1 deletion src/Model/Table/PanelsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*/
class PanelsTable extends Table
{

use LazyTableTrait;

/**
Expand Down
1 change: 0 additions & 1 deletion src/Model/Table/RequestsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/
class RequestsTable extends Table
{

use LazyTableTrait;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Panel/MailPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function initialize()
$property->setAccessible(true);
$configs = $property->getValue();

$log = $this->emailLog = new ArrayObject;
$log = $this->emailLog = new ArrayObject();

foreach ($configs as $name => &$transport) {
if (is_object($transport)) {
Expand Down
6 changes: 4 additions & 2 deletions src/Panel/VariablesPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public function shutdown(Event $event)
$errors = [];

$walker = function (&$item) use (&$walker) {
if ($item instanceof Collection ||
if (
$item instanceof Collection ||
$item instanceof Query ||
$item instanceof ResultSet
) {
Expand All @@ -108,7 +109,8 @@ public function shutdown(Event $event)
} catch (InvalidArgumentException $e) {
$item = $this->_walkDebugInfo($walker, $item);
}
} elseif ($item instanceof Closure ||
} elseif (
$item instanceof Closure ||
$item instanceof PDO ||
$item instanceof SimpleXMLElement
) {
Expand Down
3 changes: 2 additions & 1 deletion src/ToolbarService.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ public function saveData(ServerRequest $request, ResponseInterface $response)
{
// Skip debugkit requests and requestAction()
$path = $request->getUri()->getPath();
if (strpos($path, 'debug_kit') !== false ||
if (
strpos($path, 'debug_kit') !== false ||
strpos($path, 'debug-kit') !== false ||
$request->is('requested')
) {
Expand Down
6 changes: 3 additions & 3 deletions src/View/Helper/TidyHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TidyHelper extends Helper
* Fudge the markup slightly so that the tag which is invalid is highlighted
*
* @param string $html ''
* @param string &$out ''
* @param string $out ''
* @return array
*/
public function process($html = '', &$out = '')
Expand Down Expand Up @@ -125,7 +125,7 @@ public function report($html = null)
* normalized string so that the error messages can be linked to the line that caused them.
*
* @param string $in ''
* @param string &$out ''
* @param string $out ''
* @return string
*/
public function tidyErrors($in = '', &$out = '')
Expand Down Expand Up @@ -163,7 +163,7 @@ public function tidyErrors($in = '', &$out = '')
* exec method
*
* @param mixed $cmd ''
* @param mixed &$out null
* @param mixed $out null
* @return bool True if successful
*/
protected function _exec($cmd, &$out = null)
Expand Down
3 changes: 2 additions & 1 deletion src/View/Helper/ToolbarHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ public function makeNeatArray($values, $openDepth = 0, $currentDepth = 0, $doubl
$value = ' - recursion';
}

if ((
if (
(
$value instanceof ArrayAccess ||
$value instanceof Iterator ||
is_array($value) ||
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/DebugTimerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testTimers()
sleep(1);
$this->assertTrue(DebugTimer::stop('test2'));
$elapsed = DebugTimer::elapsedTime('test2');
$expected = stripos(PHP_OS, 'win') === false ? 0.999: 0.95; // Windows timer's precision is bad
$expected = stripos(PHP_OS, 'win') === false ? 0.999 : 0.95; // Windows timer's precision is bad
$this->assertTrue($elapsed >= $expected);

DebugTimer::start('test3');
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
define('CACHE', TMP);
define('LOGS', TMP);

$loader = new \Cake\Core\ClassLoader;
$loader = new \Cake\Core\ClassLoader();
$loader->register();

$loader->addNamespace('TestApp', APP);
Expand Down

0 comments on commit 6930c41

Please sign in to comment.