for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WebComplete\microDb;
class Factory
{
/**
* @param string $file
* @param string $type
*
* @return StorageInterface
*/
public function storage(string $file, string $type): StorageInterface
switch ($type) {
case 'runtime':
$result = new StorageRuntime($file);
break;
case 'file':
default:
$result = new StorageFile($file);
}
return $result;
* @param StorageInterface $storage
* @return Collection
public function collection(StorageInterface $storage): Collection
return new Collection($storage);