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

fix for rabbitmq #65

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private function toStringOfStringMap(array $map): array
\is_string($value) => $value,
\is_bool($value) => $value ? 'true' : 'false',
$value instanceof \JsonSerializable,
\is_array($value) => \json_encode($value, \JSON_THROW_ON_ERROR),
\is_array($value) => \json_encode($value, \JSON_THROW_ON_ERROR | (empty($value)? \JSON_FORCE_OBJECT : 0)),
default => throw new \InvalidArgumentException(
\sprintf('Can not cast to string unrecognized value of type %s', \get_debug_type($value)),
),
Expand Down
2 changes: 1 addition & 1 deletion src/Queue/AMQP/ExchangeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ enum ExchangeType: string
* routing by comparing the routing key. But, in this case, the key is set
* using a template, like "user.*.messages".
*/
case Topics = 'topics';
case Topics = 'topic';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

The change from 'topics' to 'topic' in the ExchangeType enum was found to be correctly updated in the source code. However, the test files tests/Unit/Queue/AMQPCreateInfoTest.php still reference the old enum value ExchangeType::Topics. This could lead to failing tests or incorrect behavior during testing. It is recommended to update these references in the test files to align with the new enum value.

Analysis chain

Change from 'topics' to 'topic' aligns with standard AMQP terminology.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for occurrences of 'ExchangeType.Topics' to ensure it is not used elsewhere.
rg --type php 'ExchangeType::Topics'

Length of output: 244


/**
* Routes tasks to related queues based on a comparison of the (key, value)
Expand Down