public function transform($value)
    {
        if (null !== $value && !is_scalar($value)) {
            throw new TransformationFailedException('Expected a scalar.');
        }

        if ('' === $value || null === $value) {
            return null;
        }

        return [$value];
    }
public function transform($value)
    {
        if (null !== $value && !is_scalar($value)) {
            throw new TransformationFailedException('Expected a scalar.');
        }

        if ('' === $value || null === $value) {
            return null;
        }

        return [$value];
    }
public function transform ( $ value ) { if ( null !== $ value && ! is_scalar ( $ value ) ) { throw new TransformationFailedException ( 'Expected a scalar.' ) ; } if ( '' === $ value || null === $ value ) { return null ; } return [ $ value ] ; }
Convert a string to an single element array.

@param string $value

@return array|null
Convert a string to an single element array .