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

json_encode never returns an empty string #441

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

gsteel
Copy link
Contributor

@gsteel gsteel commented Jan 27, 2024

… at least I don't think it can:

https://3v4l.org/8G6ln

@coveralls
Copy link

coveralls commented Jan 27, 2024

Pull Request Test Coverage Report for Build 7696167145

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.014%

Totals Coverage Status
Change from base Build 7580370265: 0.0%
Covered Lines: 4216
Relevant Lines: 4258

💛 - Coveralls

@gsteel gsteel force-pushed the json-encode-is-non-empty branch from a4ba3e4 to db30587 Compare January 27, 2024 20:45
@gsteel
Copy link
Contributor Author

gsteel commented Jan 27, 2024

Sorry, not sure how the docs work. I've amended the referenced line number for encode but it's still red.

@veewee
Copy link
Collaborator

veewee commented Jan 29, 2024

Seems valid indeed:
https://psalm.dev/r/2106809556

Thanks for adding.

The documentation is auto-generated and can be altered by the command: make docs-generate

Copy link

I found these snippets:

https://psalm.dev/r/2106809556
<?php
$res = json_encode(null);

/** @psalm-trace $res */
Psalm output (using commit 275dfd8):

INFO: Trace - 4:25 - $res: false|non-empty-string

INFO: UnusedVariable - 2:1 - $res is never referenced or the value is not used

@veewee veewee added Priority: Low This issue can probably be picked up by anyone looking to contribute to the project, as an entry fix Status: Accepted It's clear what the subject of the issue is about, and what the resolution should be. Type: Enhancement Most issues will probably ask for additions or changes. labels Jan 29, 2024
@gsteel gsteel force-pushed the json-encode-is-non-empty branch from db30587 to 5d01f7e Compare January 29, 2024 12:38
@veewee veewee merged commit 898f808 into azjezz:next Jan 29, 2024
14 checks passed
@veewee
Copy link
Collaborator

veewee commented Jan 29, 2024

Thanks!

@gsteel gsteel deleted the json-encode-is-non-empty branch January 29, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low This issue can probably be picked up by anyone looking to contribute to the project, as an entry fix Status: Accepted It's clear what the subject of the issue is about, and what the resolution should be. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants