* @return void
*/
protected final function addContent ($newContent) {
- $this->content .= (string) trim($newContent) . chr(10);
+ $this->content .= (string) trim($newContent) . PHP_EOL;
}
/**
// Add the group to the stack
$this->groups[$this->totalCounter] = $groupId;
- $this->groups[$groupId]['opened'] = true;
+ $this->groups[$groupId]['opened'] = TRUE;
$this->groups[$groupId]['content'] = sprintf(
"<!-- group %s opened (length: %s, tag: %s) //-->%s\n",
$groupId,
} // END - if
// Check if any group was opened before
- if ($this->ifGroupOpenedPreviously() === false) {
+ if ($this->ifGroupOpenedPreviously() === FALSE) {
// Then throw an exception
throw new HelperNoPreviousOpenedGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
} // END - if
$this->groups[$groupId]['tag'],
$content
);
- $this->groups[$groupId]['opened'] = false;
+ $this->groups[$groupId]['opened'] = FALSE;
// Mark previous group as closed
$this->setPreviousGroupId('');
// Add the group to the stack
$this->subGroups[$this->totalCounter] = $subGroupId;
- $this->subGroups[$subGroupId]['opened'] = true;
+ $this->subGroups[$subGroupId]['opened'] = TRUE;
$this->subGroups[$subGroupId]['content'] = sprintf("<!-- sub-group %s opened (length: %s, tag: %s) //-->%s\n", $subGroupId, strlen($content), $tag, $content);
$this->subGroups[$subGroupId]['tag'] = $tag;
*/
public function closePreviousSubGroupByContent ($content = '') {
// Check if any sub group was opened before
- if ($this->ifSubGroupOpenedPreviously() === false) {
+ if ($this->ifSubGroupOpenedPreviously() === FALSE) {
// Then throw an exception
throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
} // END - if
// Add content to it and mark it as closed
$this->subGroups[$subGroupId]['content'] .= sprintf("<!-- sub-group %s closed (length: %s, tag: %s) //-->%s\n", $subGroupId, strlen($content), $this->subGroups[$subGroupId]['tag'], $content);
- $this->subGroups[$subGroupId]['opened'] = false;
+ $this->subGroups[$subGroupId]['opened'] = FALSE
+ ;
// Mark previous sub group as closed
$this->setPreviousSubGroupId('');
// Is header content there?
if (isset($this->groups['header'])) {
// Then add it
- $content .= $this->groups['header']['content'] . chr(10);
+ $content .= $this->groups['header']['content'] . PHP_EOL;
} // END - if
// Initiate content
// Now "walk" through all groups and sub-groups
for ($idx = 1; $idx <= $this->totalCounter; $idx++) {
// Is this a sub/group and is it closed?
- if ((isset($this->groups[$idx])) && ($this->groups[$this->groups[$idx]]['opened'] === false)) {
+ if ((isset($this->groups[$idx])) && ($this->groups[$this->groups[$idx]]['opened'] === FALSE)) {
// Then add it's content
$groupContent = trim($this->groups[$this->groups[$idx]]['content']);
//* DEBUG: */ echo "group={$this->groups[$idx]},content=<pre>".htmlentities($groupContent)."</pre><br />\n";
$content .= $groupContent;
- } elseif ((isset($this->subGroups[$idx])) && ($this->subGroups[$this->subGroups[$idx]]['opened'] === false)) {
+ } elseif ((isset($this->subGroups[$idx])) && ($this->subGroups[$this->subGroups[$idx]]['opened'] === FALSE)) {
// Then add it's content
$subGroupContent = $this->subGroups[$this->subGroups[$idx]]['content'];
//* DEBUG: */ echo "subgroup={$this->subGroups[$idx]},content=<pre>".htmlentities($subGroupContent)."</pre><br />\n";
// Is footer content there?
if (isset($this->groups['footer'])) {
// Then add it
- $content .= $this->groups['footer']['content'] . chr(10);
+ $content .= $this->groups['footer']['content'] . PHP_EOL;
} // END - if
// Return it
*/
protected function ifGroupIsOpened ($groupId) {
// Is the group open?
- $isOpened = ((isset($this->groups[$groupId])) && ($this->groups[$groupId]['opened'] === true));
+ $isOpened = ((isset($this->groups[$groupId])) && ($this->groups[$groupId]['opened'] === TRUE));
// Return status
return $isOpened;