for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by gerk on 20.11.17 17:34
*/
namespace PeekAndPoke\Component\Psi\Psi\Str;
use PeekAndPoke\Component\Psi\Interfaces\UnaryFunction;
*
* @author Karsten J. Gerber <[email protected]>
class ToString implements UnaryFunction
{
* @param mixed $input
* @return mixed
public function __invoke($input)
if (is_scalar($input)) {
return (string) $input;
}
if (is_object($input) && method_exists($input, '__toString')) {
return '';