DayleRees\ContainerDebug\Command::getServiceDescription PHP Method

getServiceDescription() public method

Retrieve a string representation of a service.
public getServiceDescription ( mixed $service ) : string
$service mixed
return string
    public function getServiceDescription($service)
    {
        if ($this->serviceIsObject($service)) {
            return get_class($service);
        }
        return $this->formatServiceDescription($service, is_scalar($service));
    }

Usage Example

 public function testAnObjectServiceDescriptionCanBeRetrieved()
 {
     $command = new Command();
     $obj = new stdClass();
     $description = $command->getServiceDescription($obj);
     $this->assertEquals('stdClass', $description);
 }