Merge pull request #6 from flashwave/analysis-XZ7k6q

Applied fixes from StyleCI
This commit is contained in:
Pachira 2015-12-02 15:40:45 +01:00
commit bf44b6b807
6 changed files with 25 additions and 15 deletions

View file

@ -19,7 +19,8 @@ class BBcode
private $bbcode;
// Constructor
public function __construct($text = null) {
public function __construct($text = null)
{
// Create new parser class
$this->bbcode = new Parser();
@ -33,7 +34,8 @@ class BBcode
}
// Add basic bbcodes
public function loadStandardCodes() {
public function loadStandardCodes()
{
// Add the standard definitions
$this->bbcode->addCodeDefinitionSet(new DefaultCodeDefinitionSet());
@ -86,22 +88,26 @@ class BBcode
}
// Set text
public function text($text) {
public function text($text)
{
$this->bbcode->parse($text);
}
// Get as HTML
public function toHTML() {
public function toHTML()
{
return nl2br($this->bbcode->getAsHtml());
}
// Get as BBmarkup
public function toEditor() {
public function toEditor()
{
return $this->bbcode->getAsBBCode();
}
// Get as plaintext
public function toPlain() {
public function toPlain()
{
return $this->bbcode->getAsText();
}
}

View file

@ -9,7 +9,8 @@ use JBBCode\Parser;
use JBBCode\CodeDefinition;
use JBBCode\ElementNode;
class Align extends CodeDefinition {
class Align extends CodeDefinition
{
public function __construct()
{
parent::__construct();

View file

@ -9,7 +9,8 @@ use JBBCode\Parser;
use JBBCode\CodeDefinition;
use JBBCode\ElementNode;
class Code extends CodeDefinition {
class Code extends CodeDefinition
{
public function __construct()
{
parent::__construct();

View file

@ -9,7 +9,8 @@ use JBBCode\Parser;
use JBBCode\CodeDefinition;
use JBBCode\ElementNode;
class Size extends CodeDefinition {
class Size extends CodeDefinition
{
public function __construct()
{
parent::__construct();

View file

@ -10,7 +10,8 @@ use JBBCode\Parser;
use JBBCode\CodeDefinition;
use JBBCode\ElementNode;
class YouTube extends CodeDefinition {
class YouTube extends CodeDefinition
{
public function __construct()
{
parent::__construct();