-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd93386
commit 7693529
Showing
6 changed files
with
32 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* | ||
* @link https://github.com/popphp/popphp-framework | ||
* @author Nick Sagona, III <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @license http://www.popphp.org/license New BSD License | ||
*/ | ||
|
||
|
@@ -19,9 +19,9 @@ | |
* @category Pop | ||
* @package Pop\Dom | ||
* @author Nick Sagona, III <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @license http://www.popphp.org/license New BSD License | ||
* @version 3.2.6 | ||
* @version 3.2.7 | ||
*/ | ||
abstract class AbstractNode | ||
{ | ||
|
@@ -124,7 +124,9 @@ public function addChildren($children) | |
} else if ($children instanceof Child) { | ||
$this->addChild($children); | ||
} else { | ||
throw new Exception('Error: The parameter passed must be an instance of Pop\Dom\Child or an array of Pop\Dom\Child instances.'); | ||
throw new Exception( | ||
'Error: The parameter passed must be an instance of Pop\Dom\Child or an array of Pop\Dom\Child instances.' | ||
); | ||
} | ||
|
||
return $this; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* | ||
* @link https://github.com/popphp/popphp-framework | ||
* @author Nick Sagona, III <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @license http://www.popphp.org/license New BSD License | ||
*/ | ||
|
||
|
@@ -19,9 +19,9 @@ | |
* @category Pop | ||
* @package Pop\Dom | ||
* @author Nick Sagona, III <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @license http://www.popphp.org/license New BSD License | ||
* @version 3.2.6 | ||
* @version 3.2.7 | ||
*/ | ||
class Child extends AbstractNode | ||
{ | ||
|
@@ -479,10 +479,12 @@ public function render($depth = 0, $indent = null, $inner = false) | |
|
||
// Initialize the node. | ||
if ($this->nodeName == '#text') { | ||
$this->output .= ((!$this->preserveWhiteSpace) ? '' : "{$indent}{$this->indent}") . $this->nodeValue . ((!$this->preserveWhiteSpace) ? '' : "\n"); | ||
$this->output .= ((!$this->preserveWhiteSpace) ? | ||
'' : "{$indent}{$this->indent}") . $this->nodeValue . ((!$this->preserveWhiteSpace) ? '' : "\n"); | ||
} else { | ||
if (!$inner) { | ||
$this->output .= ((!$this->preserveWhiteSpace) ? '' : "{$indent}{$this->indent}") . "<{$this->nodeName}{$attribs}"; | ||
$this->output .= ((!$this->preserveWhiteSpace) ? | ||
'' : "{$indent}{$this->indent}") . "<{$this->nodeName}{$attribs}"; | ||
} | ||
|
||
if ((null === $indent) && (null !== $this->indent)) { | ||
|
@@ -505,7 +507,8 @@ public function render($depth = 0, $indent = null, $inner = false) | |
// Render node value before the child nodes. | ||
if (!$this->childrenFirst) { | ||
if (null !== $this->nodeValue) { | ||
$this->output .= ((!$this->preserveWhiteSpace) ? '' : str_repeat(' ', $newDepth) . "{$indent}") . "{$this->nodeValue}\n"; | ||
$this->output .= ((!$this->preserveWhiteSpace) ? | ||
'' : str_repeat(' ', $newDepth) . "{$indent}") . "{$this->nodeValue}\n"; | ||
} | ||
foreach ($this->childNodes as $child) { | ||
$this->output .= $child->render($newDepth, $indent); | ||
|
@@ -524,9 +527,13 @@ public function render($depth = 0, $indent = null, $inner = false) | |
} | ||
if (!$inner) { | ||
if (null !== $this->nodeValue) { | ||
$this->output .= ((!$this->preserveWhiteSpace) ? '' : str_repeat(' ', $newDepth) . "{$indent}") . "{$this->nodeValue}" . ((!$this->preserveWhiteSpace) ? '' : "\n{$origIndent}") . "</{$this->nodeName}>" . (($this->preserveWhiteSpace) ? '' : "\n"); | ||
$this->output .= ((!$this->preserveWhiteSpace) ? | ||
'' : str_repeat(' ', $newDepth) . "{$indent}") . | ||
"{$this->nodeValue}" . ((!$this->preserveWhiteSpace) ? | ||
'' : "\n{$origIndent}") . "</{$this->nodeName}>" . (($this->preserveWhiteSpace) ? '' : "\n"); | ||
} else { | ||
$this->output .= ((!$this->preserveWhiteSpace) ? '' : "{$origIndent}") . "</{$this->nodeName}>" . ((!$this->preserveWhiteSpace) ? '' : "\n"); | ||
$this->output .= ((!$this->preserveWhiteSpace) ? | ||
'' : "{$origIndent}") . "</{$this->nodeName}>" . ((!$this->preserveWhiteSpace) ? '' : "\n"); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* | ||
* @link https://github.com/popphp/popphp-framework | ||
* @author Nick Sagona, III <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @license http://www.popphp.org/license New BSD License | ||
*/ | ||
|
||
|
@@ -19,9 +19,9 @@ | |
* @category Pop | ||
* @package Pop\Dom | ||
* @author Nick Sagona, III <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @license http://www.popphp.org/license New BSD License | ||
* @version 3.2.6 | ||
* @version 3.2.7 | ||
*/ | ||
class Document extends AbstractNode | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* | ||
* @link https://github.com/popphp/popphp-framework | ||
* @author Nick Sagona, III <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @license http://www.popphp.org/license New BSD License | ||
*/ | ||
|
||
|
@@ -19,9 +19,9 @@ | |
* @category Pop | ||
* @package Pop\Dom | ||
* @author Nick Sagona, III <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @license http://www.popphp.org/license New BSD License | ||
* @version 3.2.6 | ||
* @version 3.2.7 | ||
*/ | ||
class DomIterator implements \RecursiveIterator | ||
{ | ||
|
@@ -53,7 +53,7 @@ public function __construct(\DOMNode $domNode) | |
|
||
/** | ||
* Get current method | ||
* @return \DOMElement | ||
* @return \DOMNode | ||
*/ | ||
public function current() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* | ||
* @link https://github.com/popphp/popphp-framework | ||
* @author Nick Sagona, III <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @license http://www.popphp.org/license New BSD License | ||
*/ | ||
|
||
|
@@ -19,8 +19,8 @@ | |
* @category Pop | ||
* @package Pop\Dom | ||
* @author Nick Sagona, III <[email protected]> | ||
* @copyright Copyright (c) 2009-2019 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) | ||
* @license http://www.popphp.org/license New BSD License | ||
* @version 3.2.6 | ||
* @version 3.2.7 | ||
*/ | ||
class Exception extends \Exception {} |