Core
3.2
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
Class.CrontabDocument.php
Go to the documentation of this file.
1
<?php
2
namespace
Dcp;
3
4
class
CrontabDocument
extends
CrontabElement
5
{
6
public
function
__toString
()
7
{
8
$previousElement = null;
9
/* Coalesce empty text elements */
10
$elements = array_filter($this->childs,
function
($currentElement) use (&$previousElement)
11
{
12
if
($previousElement !== null && is_a($previousElement,
'\Dcp\CrontabTextElement'
) && is_a($currentElement,
'\Dcp\CrontabTextElement'
)) {
13
if
(strlen((
string
)$previousElement) <= 0 && strlen((
string
)$currentElement) <= 0) {
14
return
false
;
15
}
16
}
17
$previousElement = $currentElement;
18
return
true
;
19
});
20
return
join(
"\n"
, $elements) .
"\n"
;
21
}
22
}
Dcp\CrontabDocument
Definition:
Class.CrontabDocument.php:4
Dcp\CrontabElement
Definition:
Class.CrontabElement.php:4
Dcp\CrontabDocument\__toString
__toString()
Definition:
Class.CrontabDocument.php:6
← centre documentaire
© anakeen