# \[SonarCloud\]\[PHP\] Invalid analyzer (php:S3699) report bug who does not exist

**URL:** <https://community.sonarsource.com/t/sonarcloud-php-invalid-analyzer-php-s3699-report-bug-who-does-not-exist/57496>\
**Category:** SonarQube Cloud\
**Tags:** php8, php, findbugs, sonarqube-cloud\
**Created:** [February 2, 2022, 1:59pm UTC](https://community.sonarsource.com/t/sonarcloud-php-invalid-analyzer-php-s3699-report-bug-who-does-not-exist/57496 "2022-02-02T13:59:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christophe\_MAILFERT](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/christophe_mailfert/32/29878_2.png) [@Christophe\_MAILFERT](https://community.sonarsource.com/u/Christophe_MAILFERT)\
**Post date:** [February 2, 2022, 1:59pm UTC](https://community.sonarsource.com/t/sonarcloud-php-invalid-analyzer-php-s3699-report-bug-who-does-not-exist/57496/1 "2022-02-02T13:59:31Z")

</div>

Versions used : **SonarCloud** with default configuration

We have an bug detected by sonar on a php8.0 project who is clearly not a bug:  
Exemple of code:

```auto
match ($action) {
  WebhookServiceInterface::CREATE => $this->handleWebhookPostPersist($args->getEntity(), $args, $webhookService),
  WebhookServiceInterface::UPDATE => $this->handleWebhookPostUpdate($args->getEntity(), $args, $webhookService),
  WebhookServiceInterface::DELETE => $this->handleWebhookPostRemove($entityId, $args, $webhookService),
  default => throw new \LogicException("Unexpected webhook action $action")
};

```

Here there is clearly no assignation but SonarCloud give this error:  
**Remove this use of the output from “WebhookManagerTrait::handleWebhookPostPersist”; “WebhookManagerTrait::handleWebhookPostPersist” doesn’t return anything.**

With this detail:

## The output of functions that don’t return anything should not be used

If a function does not return anything, it makes no sense to use its output. Specifically, passing it to another function, or assigning its “result” to a variable is probably a bug because such functions return nothing, which is probably not what was intended.

## Noncompliant Code Example

$result = closedir($dir\_handle); // Noncompliant, “closedir” does not return anything.

## Compliant Solution

closedir($dir\_handle);

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [February 2, 2022, 2:31pm UTC](https://community.sonarsource.com/t/sonarcloud-php-invalid-analyzer-php-s3699-report-bug-who-does-not-exist/57496/2 "2022-02-02T14:31:18Z")

</div>

Hey there.

Thanks for the report. This seems to match a known false-positive that seems to match: [SONARPHP-1268: S3699 should not raise on arrow functions](https://jira.sonarsource.com/browse/SONARPHP-1268)

---

<div class="post-metadata">

**Author:** ![Christophe\_MAILFERT](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/christophe_mailfert/32/29878_2.png) [@Christophe\_MAILFERT](https://community.sonarsource.com/u/Christophe_MAILFERT)\
**Post date:** [February 2, 2022, 4:15pm UTC](https://community.sonarsource.com/t/sonarcloud-php-invalid-analyzer-php-s3699-report-bug-who-does-not-exist/57496/3 "2022-02-02T16:15:05Z")

</div>

It seems to be the same error, but i can’t add a comment to add match in her case

---

<div class="post-metadata">

**Author:** ![Nils\_Werner](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nils_werner/32/14437_2.png) [@Nils\_Werner](https://community.sonarsource.com/u/Nils_Werner)\
**Post date:** [February 7, 2022, 7:42am UTC](https://community.sonarsource.com/t/sonarcloud-php-invalid-analyzer-php-s3699-report-bug-who-does-not-exist/57496/4 "2022-02-07T07:42:22Z")

</div>

Hello @Christophe_MAILFERT,

thanks for sharing this false positive with us. I have included the fix in the next increment and it will be available on SonarCloud later this week.

Best,  
Nils
