Skip to content
Permalink
Browse files

SCA with Php Inspections (EA Ultimate): reverts as per code review

  • Loading branch information...
kalessil committed Apr 27, 2018
1 parent c160b87 commit 7220686ef8d48d0a1e8f5d701cb0c871791600a9
Showing with 12 additions and 6 deletions.
  1. +4 −2 src/Console/ConsoleIo.php
  2. +2 −1 src/Core/Plugin.php
  3. +2 −1 src/Event/EventManager.php
  4. +2 −1 src/Utility/Hash.php
  5. +2 −1 src/View/Helper/HtmlHelper.php
@@ -455,8 +455,9 @@ protected function _getInput($prompt, $options, $default)
$defaultText = "[$default] ";
}
$this->_out->write('<question>' . $prompt . "</question>$optionsText\n$defaultText> ", 0);
$result = $this->_in->read();
$result = trim($this->_in->read());
$result = trim($result);
if ($default !== null && ($result === '' || $result === null)) {
return $default;
}
@@ -550,7 +551,8 @@ public function createFile($path, $contents, $forceOverwrite = false)
if (file_exists($path) && $forceOverwrite === false) {
$this->warning("File `{$path}` exists");
$key = strtolower($this->askChoice('Do you want to overwrite?', ['y', 'n', 'a', 'q'], 'n'));
$key = $this->askChoice('Do you want to overwrite?', ['y', 'n', 'a', 'q'], 'n');
$key = strtolower($key);
if ($key === 'q') {
$this->error('Quitting.', 2);
@@ -241,7 +241,8 @@ public static function loadAll(array $options = [])
}
}
if (Configure::check('plugins')) {
$plugins = array_unique(array_merge($plugins, array_keys(Configure::read('plugins'))));
$plugins = array_merge($plugins, array_keys(Configure::read('plugins')));
$plugins = array_unique($plugins);
}
$collection = static::getCollection();
@@ -366,7 +366,8 @@ public function listeners($eventKey)
$globalListeners = static::instance()->prioritisedListeners($eventKey);
$globalListeners = empty($globalListeners) ? [] : $globalListeners;
$priorities = array_unique(array_merge(array_keys($globalListeners), array_keys($localListeners)));
$priorities = array_merge(array_keys($globalListeners), array_keys($localListeners));
$priorities = array_unique($priorities);
asort($priorities);
$result = [];
@@ -712,7 +712,8 @@ public static function expand(array $data, $separator = '.')
{
$result = [];
foreach ($data as $flat => $value) {
$keys = array_reverse(explode($separator, $flat));
$keys = explode($separator, $flat);
$keys = array_reverse($keys);
$child = [
$keys[0] => $value
];
@@ -355,7 +355,8 @@ public function link($title, $url = null, array $options = [])
unset($options['fullBase']);
} else {
$url = $this->Url->build($title);
$title = h(urldecode(htmlspecialchars_decode($url, ENT_QUOTES)));
$title = htmlspecialchars_decode($url, ENT_QUOTES);
$title = h(urldecode($title));
$escapeTitle = false;
}

0 comments on commit 7220686

Please sign in to comment.
You can’t perform that action at this time.