for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ballen\Linguist\Transformers;
/**
* Linguist
*
* Linguist is a PHP library for parsing strings, it can extract and manipulate
* prefixed words in content ideal for working with @mentions, #topics and
* even custom action tags!
* @author Bobby Allen <[email protected]>
* @license http://www.gnu.org/licenses/gpl-3.0.html
* @link https://github.com/bobsta63/linguist
* @link http://www.bobbyallen.me
*/
abstract class Transformer
{
* Strips HTML tags from the given string.
* @param string $message The string that does/may contain HTML tags.
* @return string
protected function stripHtml($message)
return strip_tags($message);
}
* Retrieves the formatted text.
public function get()
return $this->formatted;
formatted
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
* Default __toString() method to return the formatted text.
public function __toString()
return $this->get();
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: