diff --git a/_sakura/components/BBcode.php b/_sakura/components/BBcode.php index 601a382..49b30bc 100644 --- a/_sakura/components/BBcode.php +++ b/_sakura/components/BBcode.php @@ -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(); } } diff --git a/_sakura/components/BBcodeDefinitions/Align.php b/_sakura/components/BBcodeDefinitions/Align.php index 68d371b..2a74d9e 100644 --- a/_sakura/components/BBcodeDefinitions/Align.php +++ b/_sakura/components/BBcodeDefinitions/Align.php @@ -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(); @@ -27,7 +28,7 @@ class Align extends CodeDefinition { $content = ""; - foreach($el->getChildren() as $child) { + foreach ($el->getChildren() as $child) { $content .= $child->getAsHTML(); } diff --git a/_sakura/components/BBcodeDefinitions/Code.php b/_sakura/components/BBcodeDefinitions/Code.php index d093fba..82d15ce 100644 --- a/_sakura/components/BBcodeDefinitions/Code.php +++ b/_sakura/components/BBcodeDefinitions/Code.php @@ -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(); diff --git a/_sakura/components/BBcodeDefinitions/Lists.php b/_sakura/components/BBcodeDefinitions/Lists.php index 3be7ee6..6e9c3f4 100644 --- a/_sakura/components/BBcodeDefinitions/Lists.php +++ b/_sakura/components/BBcodeDefinitions/Lists.php @@ -39,7 +39,7 @@ class Lists extends CodeDefinition $listPieces = explode('[*]', $bodyHtml); unset($listPieces[0]); - $listPieces = array_map(function($li) { + $listPieces = array_map(function ($li) { return '
  • '.$li.'
  • '; }, $listPieces); return ''; diff --git a/_sakura/components/BBcodeDefinitions/Size.php b/_sakura/components/BBcodeDefinitions/Size.php index 10ccbee..5362a8e 100644 --- a/_sakura/components/BBcodeDefinitions/Size.php +++ b/_sakura/components/BBcodeDefinitions/Size.php @@ -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(); @@ -24,7 +25,7 @@ class Size extends CodeDefinition { $content = ""; - foreach($el->getChildren() as $child) { + foreach ($el->getChildren() as $child) { $content .= $child->getAsHTML(); } diff --git a/_sakura/components/BBcodeDefinitions/YouTube.php b/_sakura/components/BBcodeDefinitions/YouTube.php index 8ab8246..a21be0a 100644 --- a/_sakura/components/BBcodeDefinitions/YouTube.php +++ b/_sakura/components/BBcodeDefinitions/YouTube.php @@ -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(); @@ -21,13 +22,13 @@ class YouTube extends CodeDefinition { { $content = ""; - foreach($el->getChildren() as $child) { + foreach ($el->getChildren() as $child) { $content .= $child->getAsBBCode(); } $foundMatch = preg_match('/^([A-z0-9=\-]+?)$/i', $content, $matches); - if(!$foundMatch) { + if (!$foundMatch) { return $el->getAsBBCode(); } else { return "";