soliantconsulting/SimpleFM

View on GitHub
src/Client/ResultSet/Transformer/ContainerTransformer.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php
declare(strict_types = 1);

namespace Soliant\SimpleFM\Client\ResultSet\Transformer;

use Soliant\SimpleFM\Connection\ConnectionInterface;

final class ContainerTransformer
{
    /**
     * @var ConnectionInterface
     */
    private $connection;

    public function __construct(ConnectionInterface $connection)
    {
        $this->connection = $connection;
    }

    public function __invoke(string $value)
    {
        if ('' === $value) {
            return null;
        }

        return new StreamProxy($this->connection, $value);
    }
}