Completed
Pull Request — master (#49)
by
unknown
08:56
created
classes/PHPTAL/Dom/XmlnsState.php 3 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,28 +1,28 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * PHPTAL templating engine
4
- *
5
- * PHP Version 5
6
- *
7
- * @category HTML
8
- * @package  PHPTAL
9
- * @author   Laurent Bedubourg <[email protected]>
10
- * @author   Kornel Lesiński <[email protected]>
11
- * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
- * @version  SVN: $Id$
13
- * @link     http://phptal.org/
14
- */
3
+     * PHPTAL templating engine
4
+     *
5
+     * PHP Version 5
6
+     *
7
+     * @category HTML
8
+     * @package  PHPTAL
9
+     * @author   Laurent Bedubourg <[email protected]>
10
+     * @author   Kornel Lesiński <[email protected]>
11
+     * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
+     * @version  SVN: $Id$
13
+     * @link     http://phptal.org/
14
+     */
15 15
 /**
16
- * Stores XMLNS aliases fluctuation in the xml flow.
17
- *
18
- * This class is used to bind a PHPTAL namespace to an alias, for example using
19
- * xmlns:t="http://xml.zope.org/namespaces/tal" and later use t:repeat instead
20
- * of tal:repeat.
21
- *
22
- * @package PHPTAL
23
- * @subpackage Dom
24
- * @author Laurent Bedubourg <[email protected]>
25
- */
16
+     * Stores XMLNS aliases fluctuation in the xml flow.
17
+     *
18
+     * This class is used to bind a PHPTAL namespace to an alias, for example using
19
+     * xmlns:t="http://xml.zope.org/namespaces/tal" and later use t:repeat instead
20
+     * of tal:repeat.
21
+     *
22
+     * @package PHPTAL
23
+     * @subpackage Dom
24
+     * @author Laurent Bedubourg <[email protected]>
25
+     */
26 26
 class PHPTAL_Dom_XmlnsState
27 27
 {
28 28
     /** Create a new XMLNS state inheriting provided aliases. */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
                 $prefix_to_uri[$prefix] = $value;
77 77
             }
78 78
 
79
-            if ($qname == 'xmlns') {$changed=true;$current_default = $value;}
79
+            if ($qname == 'xmlns') {$changed = true; $current_default = $value; }
80 80
         }
81 81
 
82 82
         if ($changed) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,12 @@
 block discarded – undo
34 34
 
35 35
     public function prefixToNamespaceURI($prefix)
36 36
     {
37
-        if ($prefix === 'xmlns') return 'http://www.w3.org/2000/xmlns/';
38
-        if ($prefix === 'xml') return 'http://www.w3.org/XML/1998/namespace';
37
+        if ($prefix === 'xmlns') {
38
+            return 'http://www.w3.org/2000/xmlns/';
39
+        }
40
+        if ($prefix === 'xml') {
41
+            return 'http://www.w3.org/XML/1998/namespace';
42
+        }
39 43
 
40 44
         // domdefs provides fallback for all known phptal ns
41 45
         if (isset($this->prefix_to_uri[$prefix])) {
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/CDATASection.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * PHPTAL templating engine
4
- *
5
- * PHP Version 5
6
- *
7
- * @category HTML
8
- * @package  PHPTAL
9
- * @author   Laurent Bedubourg <[email protected]>
10
- * @author   Kornel Lesiński <[email protected]>
11
- * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
- * @version  SVN: $Id$
13
- * @link     http://phptal.org/
14
- */
3
+     * PHPTAL templating engine
4
+     *
5
+     * PHP Version 5
6
+     *
7
+     * @category HTML
8
+     * @package  PHPTAL
9
+     * @author   Laurent Bedubourg <[email protected]>
10
+     * @author   Kornel Lesiński <[email protected]>
11
+     * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
+     * @version  SVN: $Id$
13
+     * @link     http://phptal.org/
14
+     */
15 15
 
16 16
 
17 17
 /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,10 +34,12 @@
 block discarded – undo
34 34
             $codewriter->pushHTML($codewriter->interpolateCDATA(str_replace('</', '<\/', $value)));
35 35
         } elseif (($mode === PHPTAL::XHTML && $inCDATAelement)  // safe for text/html
36 36
              || ($mode === PHPTAL::XML && preg_match('/[<>&]/', $value))  // non-useless in XML
37
-             || ($mode !== PHPTAL::HTML5 && preg_match('/<\?|\${structure/', $value)))  // hacks with structure (in X[HT]ML) may need it
37
+             || ($mode !== PHPTAL::HTML5 && preg_match('/<\?|\${structure/', $value))) {
38
+            // hacks with structure (in X[HT]ML) may need it
38 39
         {
39 40
             // in text/html "</" is dangerous and the only sensible way to escape is ECMAScript string escapes.
40 41
             if ($mode === PHPTAL::XHTML) $value = str_replace('</', '<\/', $value);
42
+        }
41 43
 
42 44
             $codewriter->pushHTML($codewriter->interpolateCDATA('<![CDATA['.$value.']]>'));
43 45
         } else {
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/DocumentBuilder.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * PHPTAL templating engine
4
- *
5
- * PHP Version 5
6
- *
7
- * @category HTML
8
- * @package  PHPTAL
9
- * @author   Laurent Bedubourg <[email protected]>
10
- * @author   Kornel Lesiński <[email protected]>
11
- * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
- * @version  SVN: $Id$
13
- * @link     http://phptal.org/
14
- */
3
+     * PHPTAL templating engine
4
+     *
5
+     * PHP Version 5
6
+     *
7
+     * @category HTML
8
+     * @package  PHPTAL
9
+     * @author   Laurent Bedubourg <[email protected]>
10
+     * @author   Kornel Lesiński <[email protected]>
11
+     * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
+     * @version  SVN: $Id$
13
+     * @link     http://phptal.org/
14
+     */
15 15
 
16 16
 /**
17 17
  * DOM Builder
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
  */
22 22
 abstract class PHPTAL_Dom_DocumentBuilder
23 23
 {
24
-    protected $_stack;   /* array<PHPTAL_Dom_Node> */
24
+    protected $_stack; /* array<PHPTAL_Dom_Node> */
25 25
     protected $_current; /* PHPTAL_Dom_Node */
26 26
 
27 27
     protected $file, $line;
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/DocumentType.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * PHPTAL templating engine
4
- *
5
- * PHP Version 5
6
- *
7
- * @category HTML
8
- * @package  PHPTAL
9
- * @author   Laurent Bedubourg <[email protected]>
10
- * @author   Kornel Lesiński <[email protected]>
11
- * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
- * @version  SVN: $Id$
13
- * @link     http://phptal.org/
14
- */
3
+     * PHPTAL templating engine
4
+     *
5
+     * PHP Version 5
6
+     *
7
+     * @category HTML
8
+     * @package  PHPTAL
9
+     * @author   Laurent Bedubourg <[email protected]>
10
+     * @author   Kornel Lesiński <[email protected]>
11
+     * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
+     * @version  SVN: $Id$
13
+     * @link     http://phptal.org/
14
+     */
15 15
 
16 16
 /**
17 17
  * Document doctype representation.
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/ProcessingInstruction.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * PHPTAL templating engine
4
- *
5
- * PHP Version 5
6
- *
7
- * @category HTML
8
- * @package  PHPTAL
9
- * @author   Laurent Bedubourg <[email protected]>
10
- * @author   Kornel Lesiński <[email protected]>
11
- * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
- * @version  SVN: $Id$
13
- * @link     http://phptal.org/
14
- */
3
+     * PHPTAL templating engine
4
+     *
5
+     * PHP Version 5
6
+     *
7
+     * @category HTML
8
+     * @package  PHPTAL
9
+     * @author   Laurent Bedubourg <[email protected]>
10
+     * @author   Kornel Lesiński <[email protected]>
11
+     * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
+     * @version  SVN: $Id$
13
+     * @link     http://phptal.org/
14
+     */
15 15
 
16 16
 /**
17 17
  * processing instructions, including <?php blocks
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/XmlDeclaration.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * PHPTAL templating engine
4
- *
5
- * PHP Version 5
6
- *
7
- * @category HTML
8
- * @package  PHPTAL
9
- * @author   Laurent Bedubourg <[email protected]>
10
- * @author   Kornel Lesiński <[email protected]>
11
- * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
- * @version  SVN: $Id$
13
- * @link     http://phptal.org/
14
- */
3
+     * PHPTAL templating engine
4
+     *
5
+     * PHP Version 5
6
+     *
7
+     * @category HTML
8
+     * @package  PHPTAL
9
+     * @author   Laurent Bedubourg <[email protected]>
10
+     * @author   Kornel Lesiński <[email protected]>
11
+     * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
+     * @version  SVN: $Id$
13
+     * @link     http://phptal.org/
14
+     */
15 15
 
16 16
 /**
17 17
  * XML declaration node.
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/Node.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * PHPTAL templating engine
4
- *
5
- * PHP Version 5
6
- *
7
- * @category HTML
8
- * @package  PHPTAL
9
- * @author   Laurent Bedubourg <[email protected]>
10
- * @author   Kornel Lesiński <[email protected]>
11
- * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
- * @version  SVN: $Id$
13
- * @link     http://phptal.org/
14
- */
3
+     * PHPTAL templating engine
4
+     *
5
+     * PHP Version 5
6
+     *
7
+     * @category HTML
8
+     * @package  PHPTAL
9
+     * @author   Laurent Bedubourg <[email protected]>
10
+     * @author   Kornel Lesiński <[email protected]>
11
+     * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
+     * @version  SVN: $Id$
13
+     * @link     http://phptal.org/
14
+     */
15 15
 
16 16
 /**
17 17
  * Document node abstract class.
Please login to merge, or discard this patch.
classes/PHPTAL/Dom/PHPTALDocumentBuilder.php 3 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * PHPTAL templating engine
4
- *
5
- * PHP Version 5
6
- *
7
- * @category HTML
8
- * @package  PHPTAL
9
- * @author   Laurent Bedubourg <[email protected]>
10
- * @author   Kornel Lesiński <[email protected]>
11
- * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
- * @version  SVN: $Id$
13
- * @link     http://phptal.org/
14
- */
3
+     * PHPTAL templating engine
4
+     *
5
+     * PHP Version 5
6
+     *
7
+     * @category HTML
8
+     * @package  PHPTAL
9
+     * @author   Laurent Bedubourg <[email protected]>
10
+     * @author   Kornel Lesiński <[email protected]>
11
+     * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
12
+     * @version  SVN: $Id$
13
+     * @link     http://phptal.org/
14
+     */
15 15
 
16 16
 
17 17
 /**
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 class PHPTAL_Dom_PHPTALDocumentBuilder extends PHPTAL_Dom_DocumentBuilder
24 24
 {
25
-    private $_xmlns;   /* PHPTAL_Dom_XmlnsState */
25
+    private $_xmlns; /* PHPTAL_Dom_XmlnsState */
26 26
     private $encoding;
27 27
 
28 28
     public function __construct()
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     public function onDocumentEnd()
53 53
     {
54 54
         if (count($this->_stack) > 0) {
55
-            $left='</'.$this->_current->getQualifiedName().'>';
56
-            for ($i = count($this->_stack)-1; $i>0; $i--) $left .= '</'.$this->_stack[$i]->getQualifiedName().'>';
55
+            $left = '</'.$this->_current->getQualifiedName().'>';
56
+            for ($i = count($this->_stack)-1; $i > 0; $i--) $left .= '</'.$this->_stack[$i]->getQualifiedName().'>';
57 57
             throw new PHPTAL_ParserException("Not all elements were closed before end of the document. Missing: ".$left,
58 58
                         $this->file, $this->line);
59 59
         }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
         $node = new PHPTAL_Dom_Element($element_qname, $namespace_uri, $attrnodes, $this->getXmlnsState());
131 131
         $this->pushNode($node);
132
-        $this->_stack[] =  $this->_current;
132
+        $this->_stack[] = $this->_current;
133 133
         $this->_current = $node;
134 134
     }
135 135
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,9 @@
 block discarded – undo
53 53
     {
54 54
         if (count($this->_stack) > 0) {
55 55
             $left='</'.$this->_current->getQualifiedName().'>';
56
-            for ($i = count($this->_stack)-1; $i>0; $i--) $left .= '</'.$this->_stack[$i]->getQualifiedName().'>';
56
+            for ($i = count($this->_stack)-1; $i>0; $i--) {
57
+                $left .= '</'.$this->_stack[$i]->getQualifiedName().'>';
58
+            }
57 59
             throw new PHPTAL_ParserException("Not all elements were closed before end of the document. Missing: ".$left,
58 60
                         $this->file, $this->line);
59 61
         }
Please login to merge, or discard this patch.
classes/PHPTAL/DefaultKeyword.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * PHPTAL templating engine
4
- *
5
- * PHP Version 5
6
- *
7
- * @category HTML
8
- * @package  PHPTAL
9
- * @author Andrew Crites <[email protected]>
10
- * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
11
- * @version  SVN: $Id$
12
- * @link     http://phptal.org/
13
- */
3
+     * PHPTAL templating engine
4
+     *
5
+     * PHP Version 5
6
+     *
7
+     * @category HTML
8
+     * @package  PHPTAL
9
+     * @author Andrew Crites <[email protected]>
10
+     * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
11
+     * @version  SVN: $Id$
12
+     * @link     http://phptal.org/
13
+     */
14 14
 
15 15
 
16 16
 /**
Please login to merge, or discard this patch.