1 Star 3 Fork 26

yg178/php-console

forked from inhere/php-console 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
StrBuffer.php 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
inhere 提交于 2018-01-24 22:24 +08:00 . format codes, add more param type define
<?php
/**
* Created by PhpStorm.
* User: inhere
* Date: 2017-10-24
* Time: 9:17
*/
namespace Inhere\Console\Components;
/**
* Class StrBuffer
* @package Inhere\Console\Components
*/
final class StrBuffer
{
/**
* @var string
*/
private $body;
public function __construct($content = '')
{
$this->body = $content;
}
/**
* @param string $content
*/
public function write(string $content)
{
$this->body .= $content;
}
/**
* @param string $content
*/
public function append(string $content)
{
$this->write($content);
}
/**
* @param string $content
*/
public function prepend(string $content)
{
$this->body = $content . $this->body;
}
/**
* clear
*/
public function clear()
{
$this->body = '';
}
/**
* @return string
*/
public function getBody(): string
{
return $this->body;
}
/**
* @param string $body
*/
public function setBody(string $body)
{
$this->body = $body;
}
/**
* @return string
*/
public function toString(): string
{
return $this->body;
}
/**
* @return string
*/
public function __toString()
{
return $this->toString();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/hwsyy/php-console.git
git@gitee.com:hwsyy/php-console.git
hwsyy
php-console
php-console
master

搜索帮助