本文整理匯總了PHP中Arrays::toString方法的典型用法代碼示例。如果您正苦於以下問題:PHP Arrays::toString方法的具體用法?PHP Arrays::toString怎麽用?PHP Arrays::toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Arrays
的用法示例。
在下文中一共展示了Arrays::toString方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: mixedToString
public static function mixedToString($mixed_)
{
if (is_array($mixed_)) {
return Arrays::toString($mixed_);
}
if (is_object($mixed_) && false === method_exists($mixed_, '__toString')) {
return get_class($mixed_);
}
return trim((string) $mixed_);
}
示例2: __toString
/**
* @see Components\Object::__toString() __toString
*/
public function __toString()
{
return sprintf('%s@%s{type: %s, method: %s, params: %s}', __CLASS__, $this->hashCode(), $this->type, $this->method, Arrays::toString($this->params));
}
示例3: format
/**
* Format log message and substitute placeholders.
*
* @param int $level_
* @param mixed[] $args_
*
* @return string
*/
protected function format($level_, array $args_ = [])
{
// FIXME Define scope of / pass scope to preg_replace_callback callback!?
$this->__level = $level_;
$this->__namespace = array_shift($args_);
$message = array_shift($args_);
foreach ($args_ as $key => $value) {
if (is_array($value)) {
$args_[$key] = Arrays::toString($value);
}
}
$this->__message = vsprintf($message, $args_);
return preg_replace_callback($this->m_patternPlaceholder, function ($placeholder_) {
return $this->m_patternCallbacks[reset($placeholder_)]();
}, $this->m_patternCompiled);
}
示例4: __toString
/**
* @see \Components\Object::__toString() \Components\Object::__toString()
*/
public function __toString()
{
return sprintf('%s@%s{read: %s, write: %s}', __CLASS__, $this->hashCode(), Arrays::toString($this->m_read), Arrays::toString($this->m_write));
}
示例5: __toString
/**
* @see \Components\Enumeration::__toString() __toString
*/
public function __toString()
{
return sprintf('%s@%s{name: %s, value: %s, options: %s}', __CLASS__, $this->hashCode(), $this->m_name, $this->m_value, Arrays::toString($this->m_options));
}
示例6: toString
/**
* @param mixed $object_
*
* @return string
*/
public static function toString($object_)
{
return sprintf('%s@%s{%s}', get_class($object_), \math\hasho($object_), Arrays::toString(get_object_vars($object_)));
}
示例7: __toString
/**
* @see \Components\Object::__toString() __toString
*/
public function __toString()
{
return Arrays::toString($this->m_value);
}