Page MenuHomeWickedGov Phorge

StringDescription.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

StringDescription.php

<?php
namespace Hamcrest;
/*
Copyright (c) 2009 hamcrest.org
*/
/**
* A {@link Hamcrest\Description} that is stored as a string.
*/
class StringDescription extends BaseDescription
{
private $_out;
public function __construct($out = '')
{
$this->_out = (string) $out;
}
public function __toString()
{
return $this->_out;
}
/**
* Return the description of a {@link Hamcrest\SelfDescribing} object as a
* String.
*
* @param \Hamcrest\SelfDescribing $selfDescribing
* The object to be described.
*
* @return string
* The description of the object.
*/
public static function toString(SelfDescribing $selfDescribing)
{
$self = new self();
return (string) $self->appendDescriptionOf($selfDescribing);
}
/**
* Alias for {@link toString()}.
*/
public static function asString(SelfDescribing $selfDescribing)
{
return self::toString($selfDescribing);
}
// -- Protected Methods
protected function append($str)
{
$this->_out .= $str;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 10:07 (1 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1f/a3/8e093c8dc31425e343ab2fa628d6
Default Alt Text
StringDescription.php (1 KB)

Event Timeline