Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if($var) should not modify the type of $var. #4846

Open
mdeweerd opened this issue Mar 20, 2024 · 0 comments
Open

if($var) should not modify the type of $var. #4846

mdeweerd opened this issue Mar 20, 2024 · 0 comments

Comments

@mdeweerd
Copy link

Phan 5.4.3 .

In a CI setup, the variable '$ok' in a code that essentially is as below, the '$ok' was considered '?''|?'0'|?0|?0.0|?1|?array{}|?false(real=?''|?'0'|?0|?0.0|?1|?array{}|?false)' after the test.

$ok = 1;
include_once .... ;
foreach (...) {
    if ($ok) {
       // nullable here
      $ok = 1;
     ...
      $ok = 0;
   }
}

return $ok;  // Considered nullable

After replacing if ($ok) with if ($ok ==1), $ok no longer was nullable at any point observed with phan-debug-var.

I tried to make a test case, but I could not reproduce it.

This os tje extract from cs-style-log with phan-debug-var information showing that $ok transitions to a nullable union type;

  <error line="1146" severity="info" message="@phan-debug-var requested for variable $ok - it has union type 1(real=1)" source="PhanDebugAnnotation"/>
    <error line="1146" severity="info" message="@phan-debug-var requested for variable $ok - it has union type ?''|?'0'|?0|?0.0|?1|?array{}|?false(real=?''|?'0'|?0|?0.0|?1|?array{}|?false)" source="PhanDebugAnnotation"/>
    <error line="1148" severity="info" message="@phan-debug-var requested for variable $ok - it has union type 1(real=1)" source="PhanDebugAnnotation"/>
anomiex added a commit to Automattic/jetpack that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.
anomiex added a commit to Automattic/jetpack that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.
matticbot pushed a commit to Automattic/jetpack-connection that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-abtest that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-waf that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-jitm that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-stats-admin that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-publicize that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-inspect that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-videopress that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-mu-wpcom-plugin that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/automattic-for-agencies-client that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-blaze that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-backup that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-storybook that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-my-jetpack that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-backup-plugin that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-videopress-plugin that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/wpcom-migration that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-starter-plugin that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-protect-plugin that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-boost-production that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-social-plugin that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-search that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-search-plugin that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
matticbot pushed a commit to Automattic/jetpack-production that referenced this issue Apr 24, 2024
* Declare the shape of returned response arrays for better static
  analysis.
* Fix a bunch of other phpdocs to be more correct too.
* Remove some unnecessary boolean checks, that were confusing Phan into
  marking all the keys in arrays as being possibly-missing (cf. phan/phan#4846)
  * At least they're unnecessary based on the declared return values of
    stuff and a quick look through the code. If we really need them, we
    should be more specific about what we're checking for and we should
    always return the documented WP_Error instead of passing the
    weird-falsey-value along.

The most important fix here is getting the type of the `$body`
parameter to `wpcom_json_api_request_as_blog` right, which fixes
PhanTypeMismatchArgumentProbablyReal issues in a lot of callers.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8821834019

Upstream-Ref: Automattic/jetpack@01d6d6d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant