Commits

Toro Hill  committed 6d6bbeb

Add documentation to escape interface and class.

  • Participants
  • Parent commits eb0f3c5

Comments (0)

Files changed (2)

File PhpTemplate/Escape/EscapeInterface.php

 <?php
-
+/**
+ * Escape Interface definition.
+ *
+ * The interface which all objects that are used for escaping content must implement.
+ *
+ * @author	Toro Hill
+ * @link	https://bitbucket.org/torohill/php-template/
+ * @license MIT
+ */
 namespace PhpTemplate\Escape;
 
 interface EscapeInterface{
+	/**
+	 * Escape a value and return the escaped value.
+	 *
+	 * @param	string	$value	The value to be escaped.
+	 * @return	string			Escaped value.
+	 */
 	public function escape($value);
 }

File PhpTemplate/Escape/HtmlEntities.php

 <?php
-
+/**
+ * PHP Template HTML Entitites class.
+ *
+ * Class for escaping html entities.
+ *
+ * @author	Toro Hill
+ * @link	https://bitbucket.org/torohill/php-template/
+ * @license MIT
+ */
 namespace PhpTemplate\Escape;
 
 class HtmlEntities implements EscapeInterface{
+	/**
+	 * Escape html entities in a string.
+	 *
+	 * Encodes single and double quotes, replaces any invalid code sequences with U+FFFD
+	 * and handles code as HTML5.
+	 *
+	 * @param	string	$value	The html string to be escaped.
+	 * @return	string			Escaped html input.
+	 */
 	public function escape($value){
 		return htmlentities($value, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5, 'UTF-8');
 	}