Repository: symfony/symfony
File: src/Symfony/Component/Messenger/Bridge/Amqp/Transport/Connection.php (PHP)

Code before:
     * Creates a connection based on the DSN and options.
     *
     * Available options:
     *
     *   * host: Hostname of the AMQP service
     *   * port: Port of the AMQP service
     *   * vhost: Virtual Host to use with the AMQP service
     *   * user|login: Username to use to connect the AMQP service
     *   * password: Password to use to connect to the AMQP service
     *   * read_timeout: Timeout in for income activity. Note: 0 or greater seconds. May be fractional.
     *   * write_timeout: Timeout in for outcome activity. Note: 0 or greater seconds. May be fractional.
     *   * connect_timeout: Connection timeout. Note: 0 or greater seconds. May be fractional.
     *   * confirm_timeout: Timeout in seconds for confirmation, if none specified transport will not wait for message confirmation. Note: 0 or greater seconds. May be fractional.
     *   * queues[name]: An array of queues, keyed by the name
     *     * binding_keys: The binding keys (if any) to bind to this queue
     *     * binding_arguments: Arguments to be used while binding the queue.
     *     * flags: Queue flags (Default: AMQP_DURABLE)
     *     * arguments: Extra arguments
     *   * exchange:
     *     * name: Name of the exchange. An empty string (name: '') can be used to use the default exchange
     *     * type: Type of exchange (Default: fanout)
     *     * default_publish_routing_key: Routing key to use when publishing, if none is specified on the message
     *     * flags: Exchange flags (Default: AMQP_DURABLE)
     *     * arguments: Extra arguments
     *     * bindings[name]: An array of the source exchanges to bind this exchange to, keyed by the name. Binding direction: source exchange -> this exchange
     *       * binding_keys: The binding/routing keys (if any) to be used for the binding
     *       * binding_arguments: Additional binding arguments
     *   * delay:
     *     * queue_name_pattern: Pattern to use to create the queues (Default: "delay_%exchange_name%_%routing_key%_%delay%")
     *     * exchange_name: Name of the exchange to be used for the delayed/retried messages (Default: "delays")
     *     * arguments: array of extra delay queue arguments (for example:  ['x-queue-type' => 'classic', 'x-message-deduplication' => true,])
     *   * auto_setup: Enable or not the auto-setup of queues and exchanges (Default: true)
     *
     *   * Connection tuning options (see http://www.rabbitmq.com/amqp-0-9-1-reference.html#connection.tune for details):
     *     * channel_max: Specifies highest channel number that the server permits. 0 means standard extension limit
     *       (see PHP_AMQP_MAX_CHANNELS constant)
     *     * frame_max: The largest frame size that the server proposes for the connection, including frame header
     *       and end-byte. 0 means standard extension limit (depends on librabbimq default frame size limit)
     *     * heartbeat: The delay, in seconds, of the connection heartbeat that the server wants.
     *       0 means the server does not want a heartbeat. Note, librabbitmq has limited heartbeat support,
     *       which means heartbeats checked only during blocking calls.
     *
     *   TLS support (see https://www.rabbitmq.com/ssl.html for details):
     *     * cacert: Path to the CA cert file in PEM format.
     *     * cert: Path to the client certificate in PEM format.
     *     * key: Path to the client key in PEM format.
     *     * verify: Enable or disable peer verification. If peer verification is enabled then the common name in the
     *       server certificate must match the server name. Peer verification is enabled by default.
     */
    public static function fromDsn(#[\SensitiveParameter] string $dsn, array $options = [], ?AmqpFactory $amqpFactory = null): self
    {

Review comment (suggestion):
The keys have to be set (unlike queues) - we could even throw when no keys are defined
```suggestion
     *       * binding_keys: The binding/routing keys to be used for the binding
```

Code after:
     * Creates a connection based on the DSN and options.
     *
     * Available options:
     *
     *   * host: Hostname of the AMQP service
     *   * port: Port of the AMQP service
     *   * vhost: Virtual Host to use with the AMQP service
     *   * user|login: Username to use to connect the AMQP service
     *   * password: Password to use to connect to the AMQP service
     *   * read_timeout: Timeout in for income activity. Note: 0 or greater seconds. May be fractional.
     *   * write_timeout: Timeout in for outcome activity. Note: 0 or greater seconds. May be fractional.
     *   * connect_timeout: Connection timeout. Note: 0 or greater seconds. May be fractional.
     *   * confirm_timeout: Timeout in seconds for confirmation, if none specified transport will not wait for message confirmation. Note: 0 or greater seconds. May be fractional.
     *   * queues[name]: An array of queues, keyed by the name
     *     * binding_keys: The binding keys (if any) to bind to this queue
     *     * binding_arguments: Arguments to be used while binding the queue.
     *     * flags: Queue flags (Default: AMQP_DURABLE)
     *     * arguments: Extra arguments
     *   * exchange:
     *     * name: Name of the exchange. An empty string (name: '') can be used to use the default exchange
     *     * type: Type of exchange (Default: fanout)
     *     * default_publish_routing_key: Routing key to use when publishing, if none is specified on the message
     *     * flags: Exchange flags (Default: AMQP_DURABLE)
     *     * arguments: Extra arguments
     *     * bindings[name]: An array of the source exchanges to bind this exchange to, keyed by the name. Binding direction: source exchange -> this exchange
     *       * binding_keys: The binding/routing keys to be used for the binding
     *       * binding_arguments: Additional binding arguments
     *   * delay:
     *     * queue_name_pattern: Pattern to use to create the queues (Default: "delay_%exchange_name%_%routing_key%_%delay%")
     *     * exchange_name: Name of the exchange to be used for the delayed/retried messages (Default: "delays")
     *     * arguments: array of extra delay queue arguments (for example:  ['x-queue-type' => 'classic', 'x-message-deduplication' => true,])
     *   * auto_setup: Enable or not the auto-setup of queues and exchanges (Default: true)
     *
     *   * Connection tuning options (see http://www.rabbitmq.com/amqp-0-9-1-reference.html#connection.tune for details):
     *     * channel_max: Specifies highest channel number that the server permits. 0 means standard extension limit
     *       (see PHP_AMQP_MAX_CHANNELS constant)
     *     * frame_max: The largest frame size that the server proposes for the connection, including frame header
     *       and end-byte. 0 means standard extension limit (depends on librabbimq default frame size limit)
     *     * heartbeat: The delay, in seconds, of the connection heartbeat that the server wants.
     *       0 means the server does not want a heartbeat. Note, librabbitmq has limited heartbeat support,
     *       which means heartbeats checked only during blocking calls.
     *
     *   TLS support (see https://www.rabbitmq.com/ssl.html for details):
     *     * cacert: Path to the CA cert file in PEM format.
     *     * cert: Path to the client certificate in PEM format.
     *     * key: Path to the client key in PEM format.
     *     * verify: Enable or disable peer verification. If peer verification is enabled then the common name in the
     *       server certificate must match the server name. Peer verification is enabled by default.
     */
    public static function fromDsn(#[\SensitiveParameter] string $dsn, array $options = [], ?AmqpFactory $amqpFactory = null): self
    {