Completed
Pull Request — master (#73)
by Witold
07:32
created
classes/PHPTAL.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
      * Get output mode
361 361
      * @see setOutputMode()
362 362
      *
363
-     * @return output mode constant
363
+     * @return integer mode constant
364 364
      */
365 365
     public function getOutputMode()
366 366
     {
@@ -389,9 +389,8 @@  discard block
 block discarded – undo
389 389
     /**
390 390
      * Get input and ouput encoding.
391 391
      *
392
-     * @param string $enc example: 'UTF-8'
393 392
      *
394
-     * @return $this
393
+     * @return string
395 394
      */
396 395
     public function getEncoding()
397 396
     {
@@ -743,6 +742,7 @@  discard block
 block discarded – undo
743 742
      *
744 743
      * @param PHPTAL $local_tpl is PHPTAL instance of the file in which macro is defined
745 744
      *                          (it will be different from $this if it's external macro call)
745
+     * @param string $path
746 746
      * @access private
747 747
      */
748 748
     final public function _executeMacroOfTemplate($path, PHPTAL $local_tpl)
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -966,10 +966,10 @@  discard block
 block discarded – undo
966 966
      */
967 967
     public function getFunctionName()
968 968
     {
969
-       // function name is used as base for caching, so it must be unique for
970
-       // every combination of settings that changes code in compiled template
969
+        // function name is used as base for caching, so it must be unique for
970
+        // every combination of settings that changes code in compiled template
971 971
 
972
-       if (!$this->_functionName) {
972
+        if (!$this->_functionName) {
973 973
 
974 974
             // just to make tempalte name recognizable
975 975
             $basename = preg_replace('/\.[a-z]{3,5}$/', '', basename($this->_source->getRealPath()));
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
             $hash = strtr(rtrim(base64_encode($hash),"="),"+/=","_A_");
990 990
 
991 991
             $this->_functionName = $this->getFunctionNamePrefix($this->_source->getLastModifiedTime()) .
992
-                                   $basename . '__' . $hash;
992
+                                    $basename . '__' . $hash;
993 993
         }
994 994
         return $this->_functionName;
995 995
     }
Please login to merge, or discard this patch.
classes/PHPTAL/Context.php 1 patch
Doc Comments   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     /**
65 65
      * save current execution context
66 66
      *
67
-     * @return Context (new)
67
+     * @return PHPTAL_Context (new)
68 68
      */
69 69
     public function pushContext()
70 70
     {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     /**
77 77
      * get previously saved execution context
78 78
      *
79
-     * @return Context (old)
79
+     * @return PHPTAL_Context (old)
80 80
      */
81 81
     public function popContext()
82 82
     {
@@ -263,6 +263,7 @@  discard block
 block discarded – undo
263 263
     /**
264 264
      * Context setter.
265 265
      *
266
+     * @param string $varname
266 267
      * @return void
267 268
      */
268 269
     public function __set($varname, $value)
@@ -312,6 +313,7 @@  discard block
 block discarded – undo
312 313
      * helper method for PHPTAL_Context::path()
313 314
      *
314 315
      * @access private
316
+     * @param string $path
315 317
      */
316 318
     private static function pathError($base, $path, $current, $basename)
317 319
     {
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/Attr.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
     /**
83 83
      * Returns true if this attribute is ns declaration (xmlns="...")
84 84
      *
85
-     * @return bool
85
+     * @return integer
86 86
      */
87 87
     function isNamespaceDeclaration()
88 88
     {
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/Defs.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,6 @@
 block discarded – undo
52 52
      * true if it's empty in XHTML (e.g. <img/>)
53 53
      * it will assume elements with no namespace may be XHTML too.
54 54
      *
55
-     * @param string $tagName local name of the tag
56 55
      *
57 56
      * @return bool
58 57
      */
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/Element.php 2 patches
Doc Comments   +8 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      * @param string $qname           qualified name of the element, e.g. "tal:block"
41 41
      * @param string $namespace_uri   namespace of this element
42 42
      * @param array  $attribute_nodes array of PHPTAL_Dom_Attr elements
43
-     * @param object $xmlns           object that represents namespaces/prefixes known in element's context
43
+     * @param PHPTAL_Dom_XmlnsState $xmlns           object that represents namespaces/prefixes known in element's context
44 44
      */
45 45
     public function __construct($qname, $namespace_uri, array $attribute_nodes, PHPTAL_Dom_XmlnsState $xmlns)
46 46
     {
@@ -229,6 +229,10 @@  discard block
 block discarded – undo
229 229
         return null;
230 230
     }
231 231
 
232
+    /**
233
+     * @param string $ns_uri
234
+     * @param string $localname
235
+     */
232 236
     public function removeAttributeNS($ns_uri, $localname)
233 237
     {
234 238
         foreach ($this->attribute_nodes as $k => $attr) {
@@ -239,6 +243,9 @@  discard block
 block discarded – undo
239 243
         }
240 244
     }
241 245
 
246
+    /**
247
+     * @return PHPTAL_Php_CodeWriter
248
+     */
242 249
     public function getAttributeNode($qname)
243 250
     {
244 251
         foreach($this->attribute_nodes as $attr) if ($attr->getQualifiedName() === $qname) return $attr;
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -466,10 +466,10 @@
 block discarded – undo
466 466
             $nsattr = PHPTAL_Dom_Defs::getInstance()->getNamespaceAttribute($domattr->getNamespaceURI(), $domattr->getLocalName());
467 467
             if (array_key_exists($nsattr->getPriority(), $temp)) {
468 468
                 throw new PHPTAL_TemplateException(sprintf("Attribute conflict in < %s > '%s' cannot appear with '%s'",
469
-                               $this->qualifiedName,
470
-                               $key,
471
-                               $temp[$nsattr->getPriority()][0]->getNamespace()->getPrefix() . ':' . $temp[$nsattr->getPriority()][0]->getLocalName()
472
-                               ), $this->getSourceFile(), $this->getSourceLine());
469
+                                $this->qualifiedName,
470
+                                $key,
471
+                                $temp[$nsattr->getPriority()][0]->getNamespace()->getPrefix() . ':' . $temp[$nsattr->getPriority()][0]->getLocalName()
472
+                                ), $this->getSourceFile(), $this->getSourceLine());
473 473
             }
474 474
             $temp[$nsattr->getPriority()] = array($nsattr, $domattr);
475 475
         }
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/SaxXmlParser.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -80,6 +80,10 @@
 block discarded – undo
80 80
     );
81 81
 
82 82
     private $input_encoding;
83
+
84
+    /**
85
+     * @param string $input_encoding
86
+     */
83 87
     public function __construct($input_encoding)
84 88
     {
85 89
         $this->input_encoding = $input_encoding;
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -60,23 +60,23 @@  discard block
 block discarded – undo
60 60
 
61 61
 
62 62
     static $state_names = array(
63
-      self::ST_ROOT => 'root node',
64
-      self::ST_TEXT => 'text',
65
-      self::ST_LT   => 'start of tag',
66
-      self::ST_TAG_NAME => 'tag name',
67
-      self::ST_TAG_CLOSE => 'closing tag',
68
-      self::ST_TAG_SINGLE => 'self-closing tag',
69
-      self::ST_TAG_ATTRIBUTES => 'tag',
70
-      self::ST_TAG_BETWEEN_ATTRIBUTE => 'tag attributes',
71
-      self::ST_CDATA => 'CDATA',
72
-      self::ST_COMMENT => 'comment',
73
-      self::ST_DOCTYPE => 'doctype',
74
-      self::ST_XMLDEC => 'XML declaration',
75
-      self::ST_PREPROC => 'preprocessor directive',
76
-      self::ST_ATTR_KEY => 'attribute name',
77
-      self::ST_ATTR_EQ => 'attribute value',
78
-      self::ST_ATTR_QUOTE => 'quoted attribute value',
79
-      self::ST_ATTR_VALUE => 'unquoted attribute value',
63
+        self::ST_ROOT => 'root node',
64
+        self::ST_TEXT => 'text',
65
+        self::ST_LT   => 'start of tag',
66
+        self::ST_TAG_NAME => 'tag name',
67
+        self::ST_TAG_CLOSE => 'closing tag',
68
+        self::ST_TAG_SINGLE => 'self-closing tag',
69
+        self::ST_TAG_ATTRIBUTES => 'tag',
70
+        self::ST_TAG_BETWEEN_ATTRIBUTE => 'tag attributes',
71
+        self::ST_CDATA => 'CDATA',
72
+        self::ST_COMMENT => 'comment',
73
+        self::ST_DOCTYPE => 'doctype',
74
+        self::ST_XMLDEC => 'XML declaration',
75
+        self::ST_PREPROC => 'preprocessor directive',
76
+        self::ST_ATTR_KEY => 'attribute name',
77
+        self::ST_ATTR_EQ => 'attribute value',
78
+        self::ST_ATTR_QUOTE => 'quoted attribute value',
79
+        self::ST_ATTR_VALUE => 'unquoted attribute value',
80 80
     );
81 81
 
82 82
     private $input_encoding;
@@ -381,15 +381,15 @@  discard block
 block discarded – undo
381 381
 
382 382
             // http://www.w3.org/International/questions/qa-forms-utf-8
383 383
             $match = '[\x09\x0A\x0D\x20-\x7F]'        // ASCII
384
-               . '|[\xC2-\xDF][\x80-\xBF]'            // non-overlong 2-byte
385
-               . '|\xE0[\xA0-\xBF][\x80-\xBF]'        // excluding overlongs
386
-               . '|[\xE1-\xEC\xEE\xEE][\x80-\xBF]{2}' // straight 3-byte (exclude FFFE and FFFF)
387
-               . '|\xEF[\x80-\xBE][\x80-\xBF]'        // straight 3-byte
388
-               . '|\xEF\xBF[\x80-\xBD]'               // straight 3-byte
389
-               . '|\xED[\x80-\x9F][\x80-\xBF]'        // excluding surrogates
390
-               . '|\xF0[\x90-\xBF][\x80-\xBF]{2}'     // planes 1-3
391
-               . '|[\xF1-\xF3][\x80-\xBF]{3}'         // planes 4-15
392
-               . '|\xF4[\x80-\x8F][\x80-\xBF]{2}';    // plane 16
384
+                . '|[\xC2-\xDF][\x80-\xBF]'            // non-overlong 2-byte
385
+                . '|\xE0[\xA0-\xBF][\x80-\xBF]'        // excluding overlongs
386
+                . '|[\xE1-\xEC\xEE\xEE][\x80-\xBF]{2}' // straight 3-byte (exclude FFFE and FFFF)
387
+                . '|\xEF[\x80-\xBE][\x80-\xBF]'        // straight 3-byte
388
+                . '|\xEF\xBF[\x80-\xBD]'               // straight 3-byte
389
+                . '|\xED[\x80-\x9F][\x80-\xBF]'        // excluding surrogates
390
+                . '|\xF0[\x90-\xBF][\x80-\xBF]{2}'     // planes 1-3
391
+                . '|[\xF1-\xF3][\x80-\xBF]{3}'         // planes 4-15
392
+                . '|\xF4[\x80-\x8F][\x80-\xBF]{2}';    // plane 16
393 393
 
394 394
             if (!preg_match('/^(?:(?>'.$match.'))+$/s',$str)) {
395 395
                 $res = preg_split('/((?>'.$match.')+)/s',$str,null,PREG_SPLIT_DELIM_CAPTURE);
Please login to merge, or discard this patch.
classes/PHPTAL/ExceptionHandler.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -27,6 +27,7 @@
 block discarded – undo
27 27
      * Doesn't change exception handler if non-default one is set.
28 28
      *
29 29
      * @param Exception e exception to re-throw and display
30
+     * @param string $encoding
30 31
      *
31 32
      * @return void
32 33
      * @throws Exception
Please login to merge, or discard this patch.
classes/PHPTAL/Keywords.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -21,6 +21,9 @@
 block discarded – undo
21 21
  */
22 22
 interface PHPTAL_Keywords extends Countable
23 23
 {
24
+    /**
25
+     * @return string
26
+     */
24 27
     public function __toString();
25 28
 }
26 29
 ?>
Please login to merge, or discard this patch.
classes/PHPTAL/NamespaceAttribute.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,8 +71,8 @@
 block discarded – undo
71 71
     private $_namespace;
72 72
 
73 73
     /**
74
-     * @param string $name The attribute name
75 74
      * @param int $priority Attribute execution priority
75
+     * @param string $local_name
76 76
      */
77 77
     public function __construct($local_name, $priority)
78 78
     {
Please login to merge, or discard this patch.