mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-27 04:28:44 +02:00
Re-dump autoloader and composer.lock
This commit is contained in:
@@ -6,7 +6,10 @@ use Sabberworm\CSS\OutputFormat;
|
||||
use Sabberworm\CSS\Property\AtRule;
|
||||
|
||||
/**
|
||||
* A RuleSet constructed by an unknown at-rule. `@font-face` rules are rendered into AtRuleSet objects.
|
||||
* This class represents rule sets for generic at-rules which are not covered by specific classes, i.e., not
|
||||
* `@import`, `@charset` or `@media`.
|
||||
*
|
||||
* A common example for this is `@font-face`.
|
||||
*/
|
||||
class AtRuleSet extends RuleSet implements AtRule
|
||||
{
|
||||
@@ -50,6 +53,8 @@ class AtRuleSet extends RuleSet implements AtRule
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
@@ -57,16 +62,19 @@ class AtRuleSet extends RuleSet implements AtRule
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OutputFormat|null $oOutputFormat
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function render(OutputFormat $oOutputFormat)
|
||||
public function render($oOutputFormat)
|
||||
{
|
||||
$sResult = $oOutputFormat->comments($this);
|
||||
$sArgs = $this->sArgs;
|
||||
if ($sArgs) {
|
||||
$sArgs = ' ' . $sArgs;
|
||||
}
|
||||
$sResult = "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
|
||||
$sResult .= parent::render($oOutputFormat);
|
||||
$sResult .= "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
|
||||
$sResult .= $this->renderRules($oOutputFormat);
|
||||
$sResult .= '}';
|
||||
return $sResult;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@ use Sabberworm\CSS\Value\URL;
|
||||
use Sabberworm\CSS\Value\Value;
|
||||
|
||||
/**
|
||||
* Declaration blocks are the parts of a CSS file which denote the rules belonging to a selector.
|
||||
* This class represents a `RuleSet` constrained by a `Selector`.
|
||||
*
|
||||
* It contains an array of selector objects (comma-separated in the CSS) as well as the rules to be applied to the
|
||||
* matching elements.
|
||||
*
|
||||
* Declaration blocks usually appear directly inside a `Document` or another `CSSList` (mostly a `MediaQuery`).
|
||||
*/
|
||||
@@ -46,6 +49,8 @@ class DeclarationBlock extends RuleSet
|
||||
*
|
||||
* @throws UnexpectedTokenException
|
||||
* @throws UnexpectedEOFException
|
||||
*
|
||||
* @internal since V8.8.0
|
||||
*/
|
||||
public static function parse(ParserState $oParserState, $oList = null)
|
||||
{
|
||||
@@ -178,6 +183,8 @@ class DeclarationBlock extends RuleSet
|
||||
* Splits shorthand declarations (e.g. `margin` or `font`) into their constituent parts.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function expandShorthands()
|
||||
{
|
||||
@@ -193,6 +200,8 @@ class DeclarationBlock extends RuleSet
|
||||
* Creates shorthand declarations (e.g. `margin` or `font`) whenever possible.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function createShorthands()
|
||||
{
|
||||
@@ -212,6 +221,8 @@ class DeclarationBlock extends RuleSet
|
||||
* Multiple borders are not yet supported as of 3.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function expandBorderShorthand()
|
||||
{
|
||||
@@ -273,6 +284,8 @@ class DeclarationBlock extends RuleSet
|
||||
* Handles `margin`, `padding`, `border-color`, `border-style` and `border-width`.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function expandDimensionsShorthand()
|
||||
{
|
||||
@@ -333,6 +346,8 @@ class DeclarationBlock extends RuleSet
|
||||
* into their constituent parts.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function expandFontShorthand()
|
||||
{
|
||||
@@ -403,6 +418,8 @@ class DeclarationBlock extends RuleSet
|
||||
* @see http://www.w3.org/TR/21/colors.html#propdef-background
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function expandBackgroundShorthand()
|
||||
{
|
||||
@@ -417,8 +434,8 @@ class DeclarationBlock extends RuleSet
|
||||
'background-repeat' => ['repeat'],
|
||||
'background-attachment' => ['scroll'],
|
||||
'background-position' => [
|
||||
new Size(0, '%', null, false, $this->iLineNo),
|
||||
new Size(0, '%', null, false, $this->iLineNo),
|
||||
new Size(0, '%', false, $this->getLineNo()),
|
||||
new Size(0, '%', false, $this->getLineNo()),
|
||||
],
|
||||
];
|
||||
$mRuleValue = $oRule->getValue();
|
||||
@@ -475,6 +492,8 @@ class DeclarationBlock extends RuleSet
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function expandListStyleShorthand()
|
||||
{
|
||||
@@ -558,10 +577,13 @@ class DeclarationBlock extends RuleSet
|
||||
* @param string $sShorthand
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function createShorthandProperties(array $aProperties, $sShorthand)
|
||||
{
|
||||
$aRules = $this->getRulesAssoc();
|
||||
$oRule = null;
|
||||
$aNewValues = [];
|
||||
foreach ($aProperties as $sProperty) {
|
||||
if (!isset($aRules[$sProperty])) {
|
||||
@@ -582,7 +604,7 @@ class DeclarationBlock extends RuleSet
|
||||
$this->removeRule($sProperty);
|
||||
}
|
||||
}
|
||||
if (count($aNewValues)) {
|
||||
if ($aNewValues !== [] && $oRule instanceof Rule) {
|
||||
$oNewRule = new Rule($sShorthand, $oRule->getLineNo(), $oRule->getColNo());
|
||||
foreach ($aNewValues as $mValue) {
|
||||
$oNewRule->addValue($mValue);
|
||||
@@ -593,6 +615,8 @@ class DeclarationBlock extends RuleSet
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function createBackgroundShorthand()
|
||||
{
|
||||
@@ -608,6 +632,8 @@ class DeclarationBlock extends RuleSet
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function createListStyleShorthand()
|
||||
{
|
||||
@@ -625,6 +651,8 @@ class DeclarationBlock extends RuleSet
|
||||
* Should be run after `create_dimensions_shorthand`!
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function createBorderShorthand()
|
||||
{
|
||||
@@ -642,6 +670,8 @@ class DeclarationBlock extends RuleSet
|
||||
* and converts them into shorthand CSS properties.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function createDimensionsShorthand()
|
||||
{
|
||||
@@ -716,6 +746,8 @@ class DeclarationBlock extends RuleSet
|
||||
* At least `font-size` AND `font-family` must be present in order to create a shorthand declaration.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @deprecated since 8.7.0, will be removed without substitution in version 9.0 in #511
|
||||
*/
|
||||
public function createFontShorthand()
|
||||
{
|
||||
@@ -769,7 +801,7 @@ class DeclarationBlock extends RuleSet
|
||||
$aLHValues = $mRuleValue->getListComponents();
|
||||
}
|
||||
if ($aLHValues[0] !== 'normal') {
|
||||
$val = new RuleValueList('/', $this->iLineNo);
|
||||
$val = new RuleValueList('/', $this->getLineNo());
|
||||
$val->addListComponent($aFSValues[0]);
|
||||
$val->addListComponent($aLHValues[0]);
|
||||
$oNewRule->addValue($val);
|
||||
@@ -785,7 +817,7 @@ class DeclarationBlock extends RuleSet
|
||||
} else {
|
||||
$aFFValues = $mRuleValue->getListComponents();
|
||||
}
|
||||
$oFFValue = new RuleValueList(',', $this->iLineNo);
|
||||
$oFFValue = new RuleValueList(',', $this->getLineNo());
|
||||
$oFFValue->setListComponents($aFFValues);
|
||||
$oNewRule->addValue($oFFValue);
|
||||
|
||||
@@ -799,6 +831,8 @@ class DeclarationBlock extends RuleSet
|
||||
* @return string
|
||||
*
|
||||
* @throws OutputException
|
||||
*
|
||||
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
@@ -806,24 +840,30 @@ class DeclarationBlock extends RuleSet
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OutputFormat|null $oOutputFormat
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws OutputException
|
||||
*/
|
||||
public function render(OutputFormat $oOutputFormat)
|
||||
public function render($oOutputFormat)
|
||||
{
|
||||
$sResult = $oOutputFormat->comments($this);
|
||||
if (count($this->aSelectors) === 0) {
|
||||
// If all the selectors have been removed, this declaration block becomes invalid
|
||||
throw new OutputException("Attempt to print declaration block with missing selector", $this->iLineNo);
|
||||
throw new OutputException(
|
||||
'Attempt to print declaration block with missing selector',
|
||||
$this->getLineNumber()
|
||||
);
|
||||
}
|
||||
$sResult = $oOutputFormat->sBeforeDeclarationBlock;
|
||||
$sResult .= $oOutputFormat->sBeforeDeclarationBlock;
|
||||
$sResult .= $oOutputFormat->implode(
|
||||
$oOutputFormat->spaceBeforeSelectorSeparator() . ',' . $oOutputFormat->spaceAfterSelectorSeparator(),
|
||||
$this->aSelectors
|
||||
);
|
||||
$sResult .= $oOutputFormat->sAfterDeclarationBlockSelectors;
|
||||
$sResult .= $oOutputFormat->spaceBeforeOpeningBrace() . '{';
|
||||
$sResult .= parent::render($oOutputFormat);
|
||||
$sResult .= $this->renderRules($oOutputFormat);
|
||||
$sResult .= '}';
|
||||
$sResult .= $oOutputFormat->sAfterDeclarationBlock;
|
||||
return $sResult;
|
||||
|
||||
@@ -4,31 +4,41 @@ namespace Sabberworm\CSS\RuleSet;
|
||||
|
||||
use Sabberworm\CSS\Comment\Comment;
|
||||
use Sabberworm\CSS\Comment\Commentable;
|
||||
use Sabberworm\CSS\CSSElement;
|
||||
use Sabberworm\CSS\OutputFormat;
|
||||
use Sabberworm\CSS\Parsing\ParserState;
|
||||
use Sabberworm\CSS\Parsing\UnexpectedEOFException;
|
||||
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
||||
use Sabberworm\CSS\Position\Position;
|
||||
use Sabberworm\CSS\Position\Positionable;
|
||||
use Sabberworm\CSS\Renderable;
|
||||
use Sabberworm\CSS\Rule\Rule;
|
||||
|
||||
/**
|
||||
* RuleSet is a generic superclass denoting rules. The typical example for rule sets are declaration block.
|
||||
* However, unknown At-Rules (like `@font-face`) are also rule sets.
|
||||
* This class is a container for individual 'Rule's.
|
||||
*
|
||||
* The most common form of a rule set is one constrained by a selector, i.e., a `DeclarationBlock`.
|
||||
* However, unknown `AtRule`s (like `@font-face`) are rule sets as well.
|
||||
*
|
||||
* If you want to manipulate a `RuleSet`, use the methods `addRule(Rule $rule)`, `getRules()` and `removeRule($rule)`
|
||||
* (which accepts either a `Rule` or a rule name; optionally suffixed by a dash to remove all related rules).
|
||||
*/
|
||||
abstract class RuleSet implements Renderable, Commentable
|
||||
abstract class RuleSet implements CSSElement, Commentable, Positionable
|
||||
{
|
||||
use Position;
|
||||
|
||||
/**
|
||||
* @var array<string, Rule>
|
||||
* the rules in this rule set, using the property name as the key,
|
||||
* with potentially multiple rules per property name.
|
||||
*
|
||||
* @var array<string, array<int<0, max>, Rule>>
|
||||
*/
|
||||
private $aRules;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $iLineNo;
|
||||
|
||||
/**
|
||||
* @var array<array-key, Comment>
|
||||
*
|
||||
* @internal since 8.8.0
|
||||
*/
|
||||
protected $aComments;
|
||||
|
||||
@@ -38,7 +48,7 @@ abstract class RuleSet implements Renderable, Commentable
|
||||
public function __construct($iLineNo = 0)
|
||||
{
|
||||
$this->aRules = [];
|
||||
$this->iLineNo = $iLineNo;
|
||||
$this->setPosition($iLineNo);
|
||||
$this->aComments = [];
|
||||
}
|
||||
|
||||
@@ -47,17 +57,23 @@ abstract class RuleSet implements Renderable, Commentable
|
||||
*
|
||||
* @throws UnexpectedTokenException
|
||||
* @throws UnexpectedEOFException
|
||||
*
|
||||
* @internal since V8.8.0
|
||||
*/
|
||||
public static function parseRuleSet(ParserState $oParserState, RuleSet $oRuleSet)
|
||||
{
|
||||
while ($oParserState->comes(';')) {
|
||||
$oParserState->consume(';');
|
||||
}
|
||||
while (!$oParserState->comes('}')) {
|
||||
while (true) {
|
||||
$commentsBeforeRule = $oParserState->consumeWhiteSpace();
|
||||
if ($oParserState->comes('}')) {
|
||||
break;
|
||||
}
|
||||
$oRule = null;
|
||||
if ($oParserState->getSettings()->bLenientParsing) {
|
||||
try {
|
||||
$oRule = Rule::parse($oParserState);
|
||||
$oRule = Rule::parse($oParserState, $commentsBeforeRule);
|
||||
} catch (UnexpectedTokenException $e) {
|
||||
try {
|
||||
$sConsume = $oParserState->consumeUntil(["\n", ";", '}'], true);
|
||||
@@ -75,7 +91,7 @@ abstract class RuleSet implements Renderable, Commentable
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$oRule = Rule::parse($oParserState);
|
||||
$oRule = Rule::parse($oParserState, $commentsBeforeRule);
|
||||
}
|
||||
if ($oRule) {
|
||||
$oRuleSet->addRule($oRule);
|
||||
@@ -84,20 +100,12 @@ abstract class RuleSet implements Renderable, Commentable
|
||||
$oParserState->consume('}');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLineNo()
|
||||
{
|
||||
return $this->iLineNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rule|null $oSibling
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addRule(Rule $oRule, Rule $oSibling = null)
|
||||
public function addRule(Rule $oRule, $oSibling = null)
|
||||
{
|
||||
$sRule = $oRule->getRule();
|
||||
if (!isset($this->aRules[$sRule])) {
|
||||
@@ -113,14 +121,19 @@ abstract class RuleSet implements Renderable, Commentable
|
||||
$oRule->setPosition($oSibling->getLineNo(), $oSibling->getColNo() - 1);
|
||||
}
|
||||
}
|
||||
if ($oRule->getLineNo() === 0 && $oRule->getColNo() === 0) {
|
||||
if ($oRule->getLineNumber() === null) {
|
||||
//this node is added manually, give it the next best line
|
||||
$columnNumber = $oRule->getColNo();
|
||||
$rules = $this->getRules();
|
||||
$pos = count($rules);
|
||||
if ($pos > 0) {
|
||||
$last = $rules[$pos - 1];
|
||||
$oRule->setPosition($last->getLineNo() + 1, 0);
|
||||
$oRule->setPosition($last->getLineNo() + 1, $columnNumber);
|
||||
} else {
|
||||
$oRule->setPosition(1, $columnNumber);
|
||||
}
|
||||
} elseif ($oRule->getColumnNumber() === null) {
|
||||
$oRule->setPosition($oRule->getLineNumber(), 0);
|
||||
}
|
||||
|
||||
array_splice($this->aRules[$sRule], $iPosition, 0, [$oRule]);
|
||||
@@ -138,7 +151,8 @@ abstract class RuleSet implements Renderable, Commentable
|
||||
* Pattern to search for. If null, returns all rules.
|
||||
* If the pattern ends with a dash, all rules starting with the pattern are returned
|
||||
* as well as one matching the pattern with the dash excluded.
|
||||
* Passing a Rule behaves like calling `getRules($mRule->getRule())`.
|
||||
* Passing a `Rule` for this parameter is deprecated in version 8.9.0, and will not work from v9.0.
|
||||
* Call `getRules($rule->getRule())` instead.
|
||||
*
|
||||
* @return array<int, Rule>
|
||||
*/
|
||||
@@ -197,7 +211,9 @@ abstract class RuleSet implements Renderable, Commentable
|
||||
* @param Rule|string|null $mRule $mRule
|
||||
* Pattern to search for. If null, returns all rules. If the pattern ends with a dash,
|
||||
* all rules starting with the pattern are returned as well as one matching the pattern with the dash
|
||||
* excluded. Passing a Rule behaves like calling `getRules($mRule->getRule())`.
|
||||
* excluded.
|
||||
* Passing a `Rule` for this parameter is deprecated in version 8.9.0, and will not work from v9.0.
|
||||
* Call `getRulesAssoc($rule->getRule())` instead.
|
||||
*
|
||||
* @return array<string, Rule>
|
||||
*/
|
||||
@@ -212,20 +228,12 @@ abstract class RuleSet implements Renderable, Commentable
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a rule from this RuleSet. This accepts all the possible values that `getRules()` accepts.
|
||||
*
|
||||
* If given a Rule, it will only remove this particular rule (by identity).
|
||||
* If given a name, it will remove all rules by that name.
|
||||
*
|
||||
* Note: this is different from pre-v.2.0 behaviour of PHP-CSS-Parser, where passing a Rule instance would
|
||||
* remove all rules with the same name. To get the old behaviour, use `removeRule($oRule->getRule())`.
|
||||
* Removes a `Rule` from this `RuleSet` by identity.
|
||||
*
|
||||
* @param Rule|string|null $mRule
|
||||
* pattern to remove. If $mRule is null, all rules are removed. If the pattern ends in a dash,
|
||||
* all rules starting with the pattern are removed as well as one matching the pattern with the dash
|
||||
* excluded. Passing a Rule behaves matches by identity.
|
||||
*
|
||||
* @return void
|
||||
* `Rule` to remove.
|
||||
* Passing a `string` or `null` is deprecated in version 8.9.0, and will no longer work from v9.0.
|
||||
* Use `removeMatchingRules()` or `removeAllRules()` instead.
|
||||
*/
|
||||
public function removeRule($mRule)
|
||||
{
|
||||
@@ -239,24 +247,48 @@ abstract class RuleSet implements Renderable, Commentable
|
||||
unset($this->aRules[$sRule][$iKey]);
|
||||
}
|
||||
}
|
||||
} elseif ($mRule !== null) {
|
||||
$this->removeMatchingRules($mRule);
|
||||
} else {
|
||||
foreach ($this->aRules as $sName => $aRules) {
|
||||
// Either no search rule is given or the search rule matches the found rule exactly
|
||||
// or the search rule ends in “-” and the found rule starts with the search rule or equals it
|
||||
// (without the trailing dash).
|
||||
if (
|
||||
!$mRule || $sName === $mRule
|
||||
|| (strrpos($mRule, '-') === strlen($mRule) - strlen('-')
|
||||
&& (strpos($sName, $mRule) === 0 || $sName === substr($mRule, 0, -1)))
|
||||
) {
|
||||
unset($this->aRules[$sName]);
|
||||
}
|
||||
}
|
||||
$this->removeAllRules();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes rules by property name or search pattern.
|
||||
*
|
||||
* @param string $searchPattern
|
||||
* pattern to remove.
|
||||
* If the pattern ends in a dash,
|
||||
* all rules starting with the pattern are removed as well as one matching the pattern with the dash
|
||||
* excluded.
|
||||
*/
|
||||
public function removeMatchingRules($searchPattern)
|
||||
{
|
||||
foreach ($this->aRules as $propertyName => $rules) {
|
||||
// Either the search rule matches the found rule exactly
|
||||
// or the search rule ends in “-” and the found rule starts with the search rule or equals it
|
||||
// (without the trailing dash).
|
||||
if (
|
||||
$propertyName === $searchPattern
|
||||
|| (\strrpos($searchPattern, '-') === \strlen($searchPattern) - \strlen('-')
|
||||
&& (\strpos($propertyName, $searchPattern) === 0
|
||||
|| $propertyName === \substr($searchPattern, 0, -1)))
|
||||
) {
|
||||
unset($this->aRules[$propertyName]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function removeAllRules()
|
||||
{
|
||||
$this->aRules = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
* @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
@@ -266,26 +298,25 @@ abstract class RuleSet implements Renderable, Commentable
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function render(OutputFormat $oOutputFormat)
|
||||
protected function renderRules(OutputFormat $oOutputFormat)
|
||||
{
|
||||
$sResult = '';
|
||||
$bIsFirst = true;
|
||||
foreach ($this->aRules as $aRules) {
|
||||
foreach ($aRules as $oRule) {
|
||||
$sRendered = $oOutputFormat->safely(function () use ($oRule, $oOutputFormat) {
|
||||
return $oRule->render($oOutputFormat->nextLevel());
|
||||
});
|
||||
if ($sRendered === null) {
|
||||
continue;
|
||||
}
|
||||
if ($bIsFirst) {
|
||||
$bIsFirst = false;
|
||||
$sResult .= $oOutputFormat->nextLevel()->spaceBeforeRules();
|
||||
} else {
|
||||
$sResult .= $oOutputFormat->nextLevel()->spaceBetweenRules();
|
||||
}
|
||||
$sResult .= $sRendered;
|
||||
$oNextLevel = $oOutputFormat->nextLevel();
|
||||
foreach ($this->getRules() as $oRule) {
|
||||
$sRendered = $oNextLevel->safely(function () use ($oRule, $oNextLevel) {
|
||||
return $oRule->render($oNextLevel);
|
||||
});
|
||||
if ($sRendered === null) {
|
||||
continue;
|
||||
}
|
||||
if ($bIsFirst) {
|
||||
$bIsFirst = false;
|
||||
$sResult .= $oNextLevel->spaceBeforeRules();
|
||||
} else {
|
||||
$sResult .= $oNextLevel->spaceBetweenRules();
|
||||
}
|
||||
$sResult .= $sRendered;
|
||||
}
|
||||
|
||||
if (!$bIsFirst) {
|
||||
|
||||
Reference in New Issue
Block a user