Re-dump autoloader and composer.lock

This commit is contained in:
Stephen Abello
2025-09-18 10:26:38 +02:00
parent 7e515e7216
commit edbe4974ac
613 changed files with 5661 additions and 4259 deletions

View File

@@ -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;