Skip to content

Commit

Permalink
Fix RiskyTruthyFalsyComparison issues
Browse files Browse the repository at this point in the history
Signed-off-by: George Steel <george@net-glue.co.uk>
  • Loading branch information
gsteel committed Feb 8, 2024
1 parent abb71f7 commit dc75d28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ProblemDetailsResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function __construct(
}
// Ensures type safety of the composed factory
$this->responseFactory = $responseFactory;
if (! $jsonFlags) {
if ($jsonFlags === null) {
$jsonFlags = JSON_UNESCAPED_SLASHES
| JSON_UNESCAPED_UNICODE
| JSON_PRESERVE_ZERO_FRACTION
Expand Down
2 changes: 1 addition & 1 deletion test/ProblemDetailsResponseFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function testCreateResponseRemovesInvalidCharactersFromXmlKeys(string $he
],
];

if (stripos($expectedType, 'xml')) {
if (stripos($expectedType, 'xml') !== false) {
$expectedKeyNames = [
'A_-',
'_A-',
Expand Down

0 comments on commit dc75d28

Please sign in to comment.