本文整理汇总了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);
}