for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace PTS\Transport;
class Socket extends BaseTransport
{
/**
* @param string $address
* @param array $options
*
* @return TransportInterface
*/
public function connect(string $address, array $options = []): TransportInterface
$timeout = (float)($options['timeout'] ??(float) ini_get('default_socket_timeout'));
$port = $options['port'] ?? 0;
$url = $this->schema . $address;
$this->target = @fsockopen($url, $port, $this->errorNumber, $this->errorMessage, $timeout);
return $this;
}