Commit cb0d7412 by Alexander Makarov

Added missing phpdoc

parent 01f74b3c
...@@ -115,6 +115,13 @@ class MessageController extends Controller ...@@ -115,6 +115,13 @@ class MessageController extends Controller
} }
} }
/**
* Extracts messages from a file
*
* @param string $fileName name of the file to extract messages from
* @param string $translator name of the function used to translate messages
* @return array
*/
protected function extractMessages($fileName, $translator) protected function extractMessages($fileName, $translator)
{ {
echo "Extracting messages from $fileName...\n"; echo "Extracting messages from $fileName...\n";
...@@ -135,6 +142,15 @@ class MessageController extends Controller ...@@ -135,6 +142,15 @@ class MessageController extends Controller
return $messages; return $messages;
} }
/**
* Writes messages into file
*
* @param array $messages
* @param string $fileName name of the file to write to
* @param boolean $overwrite if existing file should be overwritten without backup
* @param boolean $removeOld if obsolete translations should be removed
* @param boolean $sort if translations should be sorted
*/
protected function generateMessageFile($messages, $fileName, $overwrite, $removeOld, $sort) protected function generateMessageFile($messages, $fileName, $overwrite, $removeOld, $sort)
{ {
echo "Saving messages to $fileName..."; echo "Saving messages to $fileName...";
......
...@@ -16,6 +16,13 @@ namespace yii\helpers\base; ...@@ -16,6 +16,13 @@ namespace yii\helpers\base;
*/ */
class HtmlPurifier class HtmlPurifier
{ {
/**
* Passes markup through HTMLPurifier making it safe to output to end user
*
* @param string $content
* @param array|null $config
* @return string
*/
public static function process($content, $config = null) public static function process($content, $config = null)
{ {
$purifier=\HTMLPurifier::instance($config); $purifier=\HTMLPurifier::instance($config);
......
...@@ -37,6 +37,13 @@ class Markdown ...@@ -37,6 +37,13 @@ class Markdown
*/ */
protected static $markdown; protected static $markdown;
/**
* Converts markdown into HTML
*
* @param string $content
* @param array $config
* @return string
*/
public static function process($content, $config = array()) public static function process($content, $config = array())
{ {
if (static::$markdown === null) { if (static::$markdown === null) {
......
...@@ -31,6 +31,15 @@ class GettextMessageSource extends MessageSource ...@@ -31,6 +31,15 @@ class GettextMessageSource extends MessageSource
*/ */
public $useBigEndian = false; public $useBigEndian = false;
/**
* Loads the message translation for the specified language and category.
* Child classes should override this method to return the message translations of
* the specified language and category.
* @param string $category the message category
* @param string $language the target language
* @return array the loaded messages. The keys are original messages, and the values
* are translated messages.
*/
protected function loadMessages($category, $language) protected function loadMessages($category, $language)
{ {
$messageFile = Yii::getAlias($this->basePath) . '/' . $language . '/' . $this->catalog; $messageFile = Yii::getAlias($this->basePath) . '/' . $language . '/' . $this->catalog;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment