Skip to content

Commit aef3db0

Browse files
committed
Leverage str_starts_with(), str_ends_with() and str_contains()
1 parent ae4b6fe commit aef3db0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Transport/AmqpTransportFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function createTransport(string $dsn, array $options, SerializerInterface
2929

3030
public function supports(string $dsn, array $options): bool
3131
{
32-
return 0 === strpos($dsn, 'amqp://') || 0 === strpos($dsn, 'amqps://');
32+
return str_starts_with($dsn, 'amqp://') || str_starts_with($dsn, 'amqps://');
3333
}
3434
}
3535

Transport/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public static function fromDsn(string $dsn, array $options = [], AmqpFactory $am
165165
$parsedUrl = [];
166166
}
167167

168-
$useAmqps = 0 === strpos($dsn, 'amqps://');
168+
$useAmqps = str_starts_with($dsn, 'amqps://');
169169
$pathParts = isset($parsedUrl['path']) ? explode('/', trim($parsedUrl['path'], '/')) : [];
170170
$exchangeName = $pathParts[1] ?? 'messages';
171171
parse_str($parsedUrl['query'] ?? '', $parsedQuery);

0 commit comments

Comments
 (0)