for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the slince/spike package.
*
* (c) Slince <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Spike\Common\Tunnel;
class TunnelFactory
{
public static function fromArray($data)
if ('http' == $data['protocol']) {
$tunnel = new HttpTunnel($data['serverPort'], $data['proxyHosts']);
} else {
$tunnel = new TcpTunnel($data['serverPort'], $data['host']);
}
return $tunnel;