Skip to content

Commit

Permalink
SCA with Php Inspections (EA Ultimate): reverts as per code review
Browse files Browse the repository at this point in the history
  • Loading branch information
kalessil committed Apr 27, 2018
1 parent c160b87 commit 7220686
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/Console/ConsoleIo.php
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/Core/Plugin.php
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion src/Event/EventManager.php
Expand Up @@ -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 = [];
Expand Down
3 changes: 2 additions & 1 deletion src/Utility/Hash.php
Expand Up @@ -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
];
Expand Down
3 changes: 2 additions & 1 deletion src/View/Helper/HtmlHelper.php
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7220686

Please sign in to comment.