for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SyncFS\Client;
/**
* Class Factory
*
* @package SyncFS\Client
* @author Matej Velikonja <[email protected]>
*/
class Factory
{
* @param string $name
* @param array $options
* @throws \InvalidArgumentException
* @return ClientInterface
public function create($name, array $options = array())
$client = null;
switch ($name) {
case 'rsync':
$client = new RsyncClient($options);
break;
case 'mock':
case 'test':
$client = new MockClient();
case 'copy':
$client = new CopyClient();
}
if (! $client) {
throw new \InvalidArgumentException(sprintf('Client `%s` does not exists.', $name));
return $client;