Skip to content

Commit 6c0e186

Browse files
authored
fix(jornaln): Array to string conversion at lib/BridgeAbstract.php li… (#3523)
* fix(jornaln): Array to string conversion at lib/BridgeAbstract.php line 320 * yup
1 parent c9a861e commit 6c0e186

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: bridges/JornalNBridge.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ public function getIcon()
5252

5353
public function getName()
5454
{
55-
return !is_null($this->getKey('feed')) ? self::NAME . ' | ' . $this->getKey('feed') : self::NAME;
55+
if ($this->getKey('feed')) {
56+
return self::NAME . ' | ' . $this->getKey('feed');
57+
}
58+
return self::NAME;
5659
}
5760

5861
public function getURI()

Diff for: lib/BridgeAbstract.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,10 @@ public function getKey($input)
314314
if (!isset($context)) {
315315
$context = $this->queriedContext;
316316
}
317+
317318
$needle = $this->inputs[$this->queriedContext][$input]['value'];
318319
foreach (static::PARAMETERS[$context][$input]['values'] as $first_level_key => $first_level_value) {
319-
// todo: this cast emits error if it's an array
320-
$valueString = (string) $first_level_value;
321-
if ($needle === $valueString) {
320+
if (!is_array($first_level_value) && $needle === (string)$first_level_value) {
322321
return $first_level_key;
323322
} elseif (is_array($first_level_value)) {
324323
foreach ($first_level_value as $second_level_key => $second_level_value) {

0 commit comments

Comments
 (0)