Your project uses non-strict array lookups 2

More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup

  1. exit;
  2. }
  3. // Validate feedback_type
  4. $validTypes = ['positive', 'negative', 'correction'];
  5. if (!in_array($input['feedback_type'], $validTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Permalink Copy Prompt
    Last edited by clicshopping
  6. echo json_encode([
  7. 'success' => false,
  8. 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
  9. ]);
  10. exit;
  • gyakutsuki

    not implemented
  • gyakutsuki

    not included
  • gyakutsuki

    no included
  • gyakutsuki

    no implemented
  • gyakutsuki

    in_array true not implemented
  • gyakutsuki

    false positive
  1. unset($this->storage[$scopedKey]);
  2. unset($this->metadata[$scopedKey]);
  3. // Remove from the scope's key list
  4. $scopeKeys = $this->scopes[$this->currentScope] ?? [];
  5. $index = array_search($scopedKey, $scopeKeys);
    array_search() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Permalink Copy Prompt
    Last edited by clicshopping
  6. if ($index !== false) {
  7. array_splice($this->scopes[$this->currentScope], $index, 1);
  8. }
  • gyakutsuki

    no included
  • gyakutsuki

    no implemented
  • gyakutsuki

    in_array true not implemented
  • gyakutsuki

    false positive

Your project uses legacy callable syntax instead of first-class callable syntax

More information: https://insight.symfony.com/what-we-analyse/php.use_first_class_callable_syntax

  1. if (self::isTable($lines)) {
  2. $html[] = self::renderTable($lines);
  3. } elseif (self::isList($lines)) {
  4. $html[] = self::renderList($lines);
  5. } else {
  6. $html[] = '<p>' . implode('<br>', array_map([self::class, 'inline'], $lines)) . '</p>';
    Use the first-class callable syntax ($this->method(...))
    Time to fix: about 15 minutes
    Read doc Permalink Copy Prompt
    Last edited by clicshopping
  7. }
  8. }
  9. return implode("\n", $html);
  10. }