},
{
"name": "scssphp/scssphp",
- "version": "v1.9.0",
+ "version": "v1.10.0",
"source": {
"type": "git",
"url": "https://github.com/scssphp/scssphp.git",
- "reference": "bc8bece4e5e176973a832f3763049ddbba16e6fd"
+ "reference": "9699a52a862da4efb43985943afa17150155dd3d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/scssphp/scssphp/zipball/bc8bece4e5e176973a832f3763049ddbba16e6fd",
- "reference": "bc8bece4e5e176973a832f3763049ddbba16e6fd",
+ "url": "https://api.github.com/repos/scssphp/scssphp/zipball/9699a52a862da4efb43985943afa17150155dd3d",
+ "reference": "9699a52a862da4efb43985943afa17150155dd3d",
"shasum": ""
},
"require": {
"symfony/phpunit-bridge": "^5.1",
"thoughtbot/bourbon": "^7.0",
"twbs/bootstrap": "~5.0",
- "twbs/bootstrap4": "4.6.0",
+ "twbs/bootstrap4": "4.6.1",
"zurb/foundation": "~6.5"
},
"suggest": {
],
"support": {
"issues": "https://github.com/scssphp/scssphp/issues",
- "source": "https://github.com/scssphp/scssphp/tree/v1.9.0"
+ "source": "https://github.com/scssphp/scssphp/tree/v1.10.0"
},
- "time": "2021-12-13T11:55:16+00:00"
+ "time": "2022-01-06T18:16:18+00:00"
},
{
"name": "symfony/css-selector",
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.23.1",
+ "version": "v1.24.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6"
+ "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6",
- "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
+ "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "provide": {
+ "ext-mbstring": "*"
+ },
"suggest": {
"ext-mbstring": "For best performance"
},
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-05-27T12:26:48+00:00"
+ "time": "2021-11-30T18:21:41+00:00"
},
{
"name": "symfony/polyfill-php73",
- "version": "v1.23.0",
+ "version": "v1.24.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010"
+ "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010",
- "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5",
+ "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5",
"shasum": ""
},
"require": {
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0"
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-02-19T12:13:01+00:00"
+ "time": "2021-06-05T21:20:04+00:00"
},
{
"name": "symfony/polyfill-php74",
- "version": "v1.23.0",
+ "version": "v1.24.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php74.git",
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php74/tree/v1.23.0"
+ "source": "https://github.com/symfony/polyfill-php74/tree/v1.24.0"
},
"funding": [
{
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.23.1",
+ "version": "v1.24.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be"
+ "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be",
- "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9",
+ "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9",
"shasum": ""
},
"require": {
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-07-28T13:41:28+00:00"
+ "time": "2021-09-13T13:58:33+00:00"
},
{
"name": "true/punycode",
'Sabberworm\\CSS\\Value\\ValueList' => $vendorDir . '/sabberworm/php-css-parser/src/Value/ValueList.php',
'ScssPhp\\ScssPhp\\Base\\Range' => $vendorDir . '/scssphp/scssphp/src/Base/Range.php',
'ScssPhp\\ScssPhp\\Block' => $vendorDir . '/scssphp/scssphp/src/Block.php',
+ 'ScssPhp\\ScssPhp\\Block\\AtRootBlock' => $vendorDir . '/scssphp/scssphp/src/Block/AtRootBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\CallableBlock' => $vendorDir . '/scssphp/scssphp/src/Block/CallableBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\ContentBlock' => $vendorDir . '/scssphp/scssphp/src/Block/ContentBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\DirectiveBlock' => $vendorDir . '/scssphp/scssphp/src/Block/DirectiveBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\EachBlock' => $vendorDir . '/scssphp/scssphp/src/Block/EachBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\ElseBlock' => $vendorDir . '/scssphp/scssphp/src/Block/ElseBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\ElseifBlock' => $vendorDir . '/scssphp/scssphp/src/Block/ElseifBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\ForBlock' => $vendorDir . '/scssphp/scssphp/src/Block/ForBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\IfBlock' => $vendorDir . '/scssphp/scssphp/src/Block/IfBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\MediaBlock' => $vendorDir . '/scssphp/scssphp/src/Block/MediaBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\NestedPropertyBlock' => $vendorDir . '/scssphp/scssphp/src/Block/NestedPropertyBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\WhileBlock' => $vendorDir . '/scssphp/scssphp/src/Block/WhileBlock.php',
'ScssPhp\\ScssPhp\\Cache' => $vendorDir . '/scssphp/scssphp/src/Cache.php',
'ScssPhp\\ScssPhp\\Colors' => $vendorDir . '/scssphp/scssphp/src/Colors.php',
'ScssPhp\\ScssPhp\\CompilationResult' => $vendorDir . '/scssphp/scssphp/src/CompilationResult.php',
'Sabberworm\\CSS\\Value\\ValueList' => __DIR__ . '/..' . '/sabberworm/php-css-parser/src/Value/ValueList.php',
'ScssPhp\\ScssPhp\\Base\\Range' => __DIR__ . '/..' . '/scssphp/scssphp/src/Base/Range.php',
'ScssPhp\\ScssPhp\\Block' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block.php',
+ 'ScssPhp\\ScssPhp\\Block\\AtRootBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/AtRootBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\CallableBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/CallableBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\ContentBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/ContentBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\DirectiveBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/DirectiveBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\EachBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/EachBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\ElseBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/ElseBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\ElseifBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/ElseifBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\ForBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/ForBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\IfBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/IfBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\MediaBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/MediaBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\NestedPropertyBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/NestedPropertyBlock.php',
+ 'ScssPhp\\ScssPhp\\Block\\WhileBlock' => __DIR__ . '/..' . '/scssphp/scssphp/src/Block/WhileBlock.php',
'ScssPhp\\ScssPhp\\Cache' => __DIR__ . '/..' . '/scssphp/scssphp/src/Cache.php',
'ScssPhp\\ScssPhp\\Colors' => __DIR__ . '/..' . '/scssphp/scssphp/src/Colors.php',
'ScssPhp\\ScssPhp\\CompilationResult' => __DIR__ . '/..' . '/scssphp/scssphp/src/CompilationResult.php',
},
{
"name": "scssphp/scssphp",
- "version": "v1.9.0",
- "version_normalized": "1.9.0.0",
+ "version": "v1.10.0",
+ "version_normalized": "1.10.0.0",
"source": {
"type": "git",
"url": "https://github.com/scssphp/scssphp.git",
- "reference": "bc8bece4e5e176973a832f3763049ddbba16e6fd"
+ "reference": "9699a52a862da4efb43985943afa17150155dd3d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/scssphp/scssphp/zipball/bc8bece4e5e176973a832f3763049ddbba16e6fd",
- "reference": "bc8bece4e5e176973a832f3763049ddbba16e6fd",
+ "url": "https://api.github.com/repos/scssphp/scssphp/zipball/9699a52a862da4efb43985943afa17150155dd3d",
+ "reference": "9699a52a862da4efb43985943afa17150155dd3d",
"shasum": ""
},
"require": {
"symfony/phpunit-bridge": "^5.1",
"thoughtbot/bourbon": "^7.0",
"twbs/bootstrap": "~5.0",
- "twbs/bootstrap4": "4.6.0",
+ "twbs/bootstrap4": "4.6.1",
"zurb/foundation": "~6.5"
},
"suggest": {
"ext-iconv": "Can be used as fallback when ext-mbstring is not available",
"ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv"
},
- "time": "2021-12-13T11:55:16+00:00",
+ "time": "2022-01-06T18:16:18+00:00",
"bin": [
"bin/pscss"
],
],
"support": {
"issues": "https://github.com/scssphp/scssphp/issues",
- "source": "https://github.com/scssphp/scssphp/tree/v1.9.0"
+ "source": "https://github.com/scssphp/scssphp/tree/v1.10.0"
},
"install-path": "../scssphp/scssphp"
},
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.23.1",
- "version_normalized": "1.23.1.0",
+ "version": "v1.24.0",
+ "version_normalized": "1.24.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6"
+ "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6",
- "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
+ "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "provide": {
+ "ext-mbstring": "*"
+ },
"suggest": {
"ext-mbstring": "For best performance"
},
- "time": "2021-05-27T12:26:48+00:00",
+ "time": "2021-11-30T18:21:41+00:00",
"type": "library",
"extra": {
"branch-alias": {
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0"
},
"funding": [
{
},
{
"name": "symfony/polyfill-php73",
- "version": "v1.23.0",
- "version_normalized": "1.23.0.0",
+ "version": "v1.24.0",
+ "version_normalized": "1.24.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010"
+ "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010",
- "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5",
+ "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
- "time": "2021-02-19T12:13:01+00:00",
+ "time": "2021-06-05T21:20:04+00:00",
"type": "library",
"extra": {
"branch-alias": {
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0"
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0"
},
"funding": [
{
},
{
"name": "symfony/polyfill-php74",
- "version": "v1.23.0",
- "version_normalized": "1.23.0.0",
+ "version": "v1.24.0",
+ "version_normalized": "1.24.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php74.git",
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php74/tree/v1.23.0"
+ "source": "https://github.com/symfony/polyfill-php74/tree/v1.24.0"
},
"funding": [
{
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.23.1",
- "version_normalized": "1.23.1.0",
+ "version": "v1.24.0",
+ "version_normalized": "1.24.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be"
+ "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be",
- "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9",
+ "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
- "time": "2021-07-28T13:41:28+00:00",
+ "time": "2021-09-13T13:58:33+00:00",
"type": "library",
"extra": {
"branch-alias": {
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0"
},
"funding": [
{
'dev_requirement' => false,
),
'scssphp/scssphp' => array(
- 'pretty_version' => 'v1.9.0',
- 'version' => '1.9.0.0',
+ 'pretty_version' => 'v1.10.0',
+ 'version' => '1.10.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../scssphp/scssphp',
'aliases' => array(),
- 'reference' => 'bc8bece4e5e176973a832f3763049ddbba16e6fd',
+ 'reference' => '9699a52a862da4efb43985943afa17150155dd3d',
'dev_requirement' => false,
),
'symfony/css-selector' => array(
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
- 'pretty_version' => 'v1.23.1',
- 'version' => '1.23.1.0',
+ 'pretty_version' => 'v1.24.0',
+ 'version' => '1.24.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
- 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6',
+ 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825',
'dev_requirement' => false,
),
'symfony/polyfill-php73' => array(
- 'pretty_version' => 'v1.23.0',
- 'version' => '1.23.0.0',
+ 'pretty_version' => 'v1.24.0',
+ 'version' => '1.24.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php73',
'aliases' => array(),
- 'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010',
+ 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5',
'dev_requirement' => false,
),
'symfony/polyfill-php74' => array(
- 'pretty_version' => 'v1.23.0',
- 'version' => '1.23.0.0',
+ 'pretty_version' => 'v1.24.0',
+ 'version' => '1.24.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php74',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
- 'pretty_version' => 'v1.23.1',
- 'version' => '1.23.1.0',
+ 'pretty_version' => 'v1.24.0',
+ 'version' => '1.24.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),
- 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be',
+ 'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9',
'dev_requirement' => false,
),
'true/punycode' => array(
/**
* Parse argument
*
- * @param integer $i
- * @param array $options
+ * @param int $i
+ * @param string[] $options
*
* @return string|null
*/
"symfony/phpunit-bridge": "^5.1",
"thoughtbot/bourbon": "^7.0",
"twbs/bootstrap": "~5.0",
- "twbs/bootstrap4": "4.6.0",
+ "twbs/bootstrap4": "4.6.1",
"zurb/foundation": "~6.5"
},
"repositories": [
"type": "package",
"package": {
"name": "sass/sass-spec",
- "version": "2021.09.15",
+ "version": "2021.11.30",
"source": {
"type": "git",
"url": "https://github.com/sass/sass-spec.git",
- "reference": "eb2d7a0865c1faf0b55a39ff962b24aca9b4c955"
+ "reference": "ee5b460ac84b1ce27b86e22c0252b4296444cf3a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sass/sass-spec/zipball/eb2d7a0865c1faf0b55a39ff962b24aca9b4c955",
- "reference": "eb2d7a0865c1faf0b55a39ff962b24aca9b4c955",
+ "url": "https://api.github.com/repos/sass/sass-spec/zipball/ee5b460ac84b1ce27b86e22c0252b4296444cf3a",
+ "reference": "ee5b460ac84b1ce27b86e22c0252b4296444cf3a",
"shasum": ""
}
}
"type": "package",
"package": {
"name": "twbs/bootstrap4",
- "version": "v4.6.0",
+ "version": "v4.6.1",
"source": {
"type": "git",
"url": "https://github.com/twbs/bootstrap.git",
- "reference": "6ffb0b48e455430f8a5359ed689ad64c1143fac2"
+ "reference": "043a03c95a2ad6738f85b65e53b9dbdfb03b8d10"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/twbs/bootstrap/zipball/6ffb0b48e455430f8a5359ed689ad64c1143fac2",
- "reference": "6ffb0b48e455430f8a5359ed689ad64c1143fac2",
+ "url": "https://api.github.com/repos/twbs/bootstrap/zipball/043a03c95a2ad6738f85b65e53b9dbdfb03b8d10",
+ "reference": "043a03c95a2ad6738f85b65e53b9dbdfb03b8d10",
"shasum": ""
}
}
],
"bin": ["bin/pscss"],
"config": {
- "sort-packages": true
+ "sort-packages": true,
+ "allow-plugins": {
+ "bamarni/composer-bin-plugin": true
+ }
}
}
/**
* Initialize range
*
- * @param integer|float $first
- * @param integer|float $last
+ * @param int|float $first
+ * @param int|float $last
*/
public function __construct($first, $last)
{
/**
* Test for inclusion in range
*
- * @param integer|float $value
+ * @param int|float $value
*
- * @return boolean
+ * @return bool
*/
public function includes($value)
{
class Block
{
/**
- * @var string
+ * @var string|null
*/
public $type;
/**
- * @var \ScssPhp\ScssPhp\Block
+ * @var Block|null
*/
public $parent;
public $sourceName;
/**
- * @var integer
+ * @var int
*/
public $sourceIndex;
/**
- * @var integer
+ * @var int
*/
public $sourceLine;
/**
- * @var integer
+ * @var int
*/
public $sourceColumn;
public $children;
/**
- * @var \ScssPhp\ScssPhp\Block|null
+ * @var Block|null
*/
public $selfParent;
}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class AtRootBlock extends Block
+{
+ /**
+ * @var array|null
+ */
+ public $selector;
+
+ /**
+ * @var array|null
+ */
+ public $with;
+
+ public function __construct()
+ {
+ $this->type = Type::T_AT_ROOT;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Compiler\Environment;
+
+/**
+ * @internal
+ */
+class CallableBlock extends Block
+{
+ /**
+ * @var string
+ */
+ public $name;
+
+ /**
+ * @var array|null
+ */
+ public $args;
+
+ /**
+ * @var Environment|null
+ */
+ public $parentEnv;
+
+ /**
+ * @param string $type
+ */
+ public function __construct($type)
+ {
+ $this->type = $type;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Compiler\Environment;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class ContentBlock extends Block
+{
+ /**
+ * @var array|null
+ */
+ public $child;
+
+ /**
+ * @var Environment|null
+ */
+ public $scope;
+
+ public function __construct()
+ {
+ $this->type = Type::T_INCLUDE;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class DirectiveBlock extends Block
+{
+ /**
+ * @var string|array
+ */
+ public $name;
+
+ /**
+ * @var string|array|null
+ */
+ public $value;
+
+ public function __construct()
+ {
+ $this->type = Type::T_DIRECTIVE;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class EachBlock extends Block
+{
+ /**
+ * @var string[]
+ */
+ public $vars = [];
+
+ /**
+ * @var array
+ */
+ public $list;
+
+ public function __construct()
+ {
+ $this->type = Type::T_EACH;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class ElseBlock extends Block
+{
+ public function __construct()
+ {
+ $this->type = Type::T_ELSE;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class ElseifBlock extends Block
+{
+ /**
+ * @var array
+ */
+ public $cond;
+
+ public function __construct()
+ {
+ $this->type = Type::T_ELSEIF;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class ForBlock extends Block
+{
+ /**
+ * @var string
+ */
+ public $var;
+
+ /**
+ * @var array
+ */
+ public $start;
+
+ /**
+ * @var array
+ */
+ public $end;
+
+ /**
+ * @var bool
+ */
+ public $until;
+
+ public function __construct()
+ {
+ $this->type = Type::T_FOR;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class IfBlock extends Block
+{
+ /**
+ * @var array
+ */
+ public $cond;
+
+ /**
+ * @var array<ElseifBlock|ElseBlock>
+ */
+ public $cases = [];
+
+ public function __construct()
+ {
+ $this->type = Type::T_IF;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class MediaBlock extends Block
+{
+ /**
+ * @var string|array|null
+ */
+ public $value;
+
+ /**
+ * @var array|null
+ */
+ public $queryList;
+
+ public function __construct()
+ {
+ $this->type = Type::T_MEDIA;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class NestedPropertyBlock extends Block
+{
+ /**
+ * @var bool
+ */
+ public $hasValue;
+
+ /**
+ * @var array
+ */
+ public $prefix;
+
+ public function __construct()
+ {
+ $this->type = Type::T_NESTED_PROPERTY;
+ }
+}
--- /dev/null
+<?php
+
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2020 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://scssphp.github.io/scssphp
+ */
+
+namespace ScssPhp\ScssPhp\Block;
+
+use ScssPhp\ScssPhp\Block;
+use ScssPhp\ScssPhp\Type;
+
+/**
+ * @internal
+ */
+class WhileBlock extends Block
+{
+ /**
+ * @var array
+ */
+ public $cond;
+
+ public function __construct()
+ {
+ $this->type = Type::T_WHILE;
+ }
+}
/**
* Reverse conversion : from RGBA to a color name if possible
*
- * @param integer $r
- * @param integer $g
- * @param integer $b
- * @param integer|float $a
+ * @param int $r
+ * @param int $g
+ * @param int $b
+ * @param int|float $a
*
* @return string|null
*/
namespace ScssPhp\ScssPhp;
use ScssPhp\ScssPhp\Base\Range;
+use ScssPhp\ScssPhp\Block\AtRootBlock;
+use ScssPhp\ScssPhp\Block\CallableBlock;
+use ScssPhp\ScssPhp\Block\DirectiveBlock;
+use ScssPhp\ScssPhp\Block\EachBlock;
+use ScssPhp\ScssPhp\Block\ElseBlock;
+use ScssPhp\ScssPhp\Block\ElseifBlock;
+use ScssPhp\ScssPhp\Block\ForBlock;
+use ScssPhp\ScssPhp\Block\IfBlock;
+use ScssPhp\ScssPhp\Block\MediaBlock;
+use ScssPhp\ScssPhp\Block\NestedPropertyBlock;
+use ScssPhp\ScssPhp\Block\WhileBlock;
use ScssPhp\ScssPhp\Compiler\CachedResult;
use ScssPhp\ScssPhp\Compiler\Environment;
use ScssPhp\ScssPhp\Exception\CompilerException;
* @param array $target
* @param array $origin
*
- * @return boolean
+ * @return bool
*/
protected function isSelfExtend($target, $origin)
{
/**
* Match extends
*
- * @param array $selector
- * @param array $out
- * @param integer $from
- * @param boolean $initial
+ * @param array $selector
+ * @param array $out
+ * @param int $from
+ * @param bool $initial
*
* @return void
*/
* @param string $part
* @param array $matches
*
- * @return boolean
+ * @return bool
*/
protected function isPseudoSelector($part, &$matches)
{
/**
* Match extends single
*
- * @param array $rawSingle
- * @param array $outOrigin
- * @param boolean $initial
+ * @param array $rawSingle
+ * @param array $outOrigin
+ * @param bool $initial
*
- * @return boolean
+ * @return bool
*/
protected function matchExtendsSingle($rawSingle, &$outOrigin, $initial = true)
{
*/
protected function compileMedia(Block $media)
{
+ assert($media instanceof MediaBlock);
$this->pushEnv($media);
$mediaQueries = $this->compileMediaQuery($this->multiplyMedia($this->env));
/**
* Compile directive
*
- * @param \ScssPhp\ScssPhp\Block|array $directive
+ * @param DirectiveBlock|array $directive
* @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out
*
* @return void
*/
protected function compileAtRoot(Block $block)
{
+ assert($block instanceof AtRootBlock);
$env = $this->pushEnv($block);
$envs = $this->compactEnv($env);
list($with, $without) = $this->compileWith(isset($block->with) ? $block->with : null);
}
/**
- * Filter at-root scope depending of with/without option
+ * Filter at-root scope depending on with/without option
*
* @param \ScssPhp\ScssPhp\Formatter\OutputBlock $scope
* @param array $with
* Find a selector by the depth node in the scope
*
* @param \ScssPhp\ScssPhp\Formatter\OutputBlock $scope
- * @param integer $depth
+ * @param int $depth
*
* @return array
*/
/**
* Compile @at-root's with: inclusion / without: exclusion into 2 lists uses to filter scope/env later
*
- * @param array $withCondition
+ * @param array|null $withCondition
*
* @return array
*
* @param array $with
* @param array $without
*
- * @return boolean
+ * @return bool
*/
protected function isWith($block, $with, $without)
{
}
if ($block->type === Type::T_DIRECTIVE) {
+ assert($block instanceof DirectiveBlock || $block instanceof OutputBlock);
if (isset($block->name)) {
return $this->testWithWithout($this->compileDirectiveName($block->name), $with, $without);
} elseif (isset($block->selectors) && preg_match(',@(\w+),ims', json_encode($block->selectors), $m)) {
* @param array $with
* @param array $without
*
- * @return boolean
+ * @return bool
* true if the block should be kept, false to reject
*/
protected function testWithWithout($what, $with, $without)
*/
protected function compileNestedPropertiesBlock(Block $block, OutputBlock $out)
{
+ assert($block instanceof NestedPropertyBlock);
$prefix = $this->compileValue($block->prefix) . '-';
$nested = $this->makeOutputBlock($block->type);
break;
case Type::T_NESTED_PROPERTY:
+ assert($child[1] instanceof NestedPropertyBlock);
array_unshift($child[1]->prefix[2], $prefix);
break;
}
// wrap assign children in a block
// except for @font-face
- if ($block->type !== Type::T_DIRECTIVE || $this->compileDirectiveName($block->name) !== 'font-face') {
+ if (!$block instanceof DirectiveBlock || $this->compileDirectiveName($block->name) !== 'font-face') {
// need wrapping?
$needWrapping = false;
/**
* Compile the value of a comment that can have interpolation
*
- * @param array $value
- * @param boolean $pushEnv
+ * @param array $value
+ * @param bool $pushEnv
*
* @return string
*/
*
* @param array $selector
*
- * @return boolean
+ * @return bool
*/
protected function hasSelectorPlaceholder($selector)
{
*
* @param array $rawPath
* @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out
- * @param boolean $once
+ * @param bool $once
*
- * @return boolean
+ * @return bool
*/
protected function compileImport($rawPath, OutputBlock $out, $once = false)
{
// insert the directive as a comment
$child = $this->makeOutputBlock(Type::T_COMMENT);
$child->lines[] = $line;
- $child->sourceName = $this->sourceNames[$this->sourceIndex];
+ $child->sourceName = $this->sourceNames[$this->sourceIndex] ?: '(stdin)';
$child->sourceLine = $this->sourceLine;
$child->sourceColumn = $this->sourceColumn;
case Type::T_MIXIN:
case Type::T_FUNCTION:
list(, $block) = $child;
+ assert($block instanceof CallableBlock);
// the block need to be able to go up to it's parent env to resolve vars
$block->parentEnv = $this->getStoreEnv();
$this->set(static::$namespaces[$block->type] . $block->name, $block, true);
case Type::T_IF:
list(, $if) = $child;
+ assert($if instanceof IfBlock);
if ($this->isTruthy($this->reduce($if->cond, true))) {
return $this->compileChildren($if->children, $out);
foreach ($if->cases as $case) {
if (
- $case->type === Type::T_ELSE ||
- $case->type === Type::T_ELSEIF && $this->isTruthy($this->reduce($case->cond))
+ $case instanceof ElseBlock ||
+ $case instanceof ElseifBlock && $this->isTruthy($this->reduce($case->cond))
) {
return $this->compileChildren($case->children, $out);
}
case Type::T_EACH:
list(, $each) = $child;
+ assert($each instanceof EachBlock);
$list = $this->coerceList($this->reduce($each->list), ',', true);
case Type::T_WHILE:
list(, $while) = $child;
+ assert($while instanceof WhileBlock);
while ($this->isTruthy($this->reduce($while->cond, true))) {
$ret = $this->compileChildren($while->children, $out);
case Type::T_FOR:
list(, $for) = $child;
+ assert($for instanceof ForBlock);
$startNumber = $this->assertNumber($this->reduce($for->start, true));
$endNumber = $this->assertNumber($this->reduce($for->end, true));
throw $this->error("Undefined mixin $name");
}
+ assert($mixin instanceof CallableBlock);
+
$callingScope = $this->getStoreEnv();
// push scope, apply args
*
* @param array|Number $value
*
- * @return boolean
+ * @return bool
*/
public function isTruthy($value)
{
*
* @param string $value
*
- * @return boolean
+ * @return bool
*/
protected function isImmediateRelationshipCombinator($value)
{
*
* @param array $value
*
- * @return boolean
+ * @return bool
*/
protected function shouldEval($value)
{
* Reduce value
*
* @param array|Number $value
- * @param boolean $inExp
+ * @param bool $inExp
*
* @return array|Number
*/
unset($value['enclosing']);
}
+ if ($value[1] === '' && count($value[2]) > 1) {
+ $value[1] = ' ';
+ }
+
return $value;
case Type::T_STRING:
* Boolean and
*
* @param array|Number $left
- * @param array|Number $right
- * @param boolean $shouldEval
+ * @param array|Number $right
+ * @param bool $shouldEval
*
* @return array|Number|null
*/
*
* @param array|Number $left
* @param array|Number $right
- * @param boolean $shouldEval
+ * @param bool $shouldEval
*
* @return array|Number|null
*/
// force double quote as string quote for the output in certain cases
if (
$value[1] === "'" &&
- (strpos($content, '"') === false or strpos($content, "'") !== false) &&
- strpbrk($content, '{}\\\'') !== false
+ (strpos($content, '"') === false or strpos($content, "'") !== false)
) {
$value[1] = '"';
} elseif (
}
}
+ $separator = $delim === '/' ? ' /' : $delim;
+
$prefix_value = '';
if ($delim !== ' ') {
$filtered[] = $compiled;
}
- return $pre . substr(implode("$delim", $filtered), \strlen($prefix_value)) . $post;
+ return $pre . substr(implode($separator, $filtered), \strlen($prefix_value)) . $post;
case Type::T_MAP:
$keys = $value[1];
/**
* Join selectors; looks for & to replace, or append parent before child
*
- * @param array $parent
- * @param array $child
- * @param boolean $stillHasSelf
- * @param array $selfParentSelectors
+ * @param array $parent
+ * @param array $child
+ * @param bool $stillHasSelf
+ * @param array $selfParentSelectors
* @return array
*/
return $this->multiplyMedia($env->parent, $childQueries);
}
+ assert($env->block instanceof MediaBlock);
+
$parentQueries = isset($env->block->queryList)
? $env->block->queryList
: [[[Type::T_MEDIA_VALUE, $env->block->value]]];
*
* @param string $name
* @param mixed $value
- * @param boolean $shadow
+ * @param bool $shadow
* @param \ScssPhp\ScssPhp\Compiler\Environment $env
* @param mixed $valueUnreduced
*
* @internal
*
* @param string $name
- * @param boolean $shouldThrow
+ * @param bool $shouldThrow
* @param \ScssPhp\ScssPhp\Compiler\Environment $env
- * @param boolean $unreduced
+ * @param bool $unreduced
*
* @return mixed|null
*/
* @param string $name
* @param \ScssPhp\ScssPhp\Compiler\Environment $env
*
- * @return boolean
+ * @return bool
*/
protected function has($name, Environment $env = null)
{
*
* @api
*
- * @param integer $numberPrecision
+ * @param int $numberPrecision
*
* @return void
*
*
* @api
*
- * @param integer $sourceMap
+ * @param int $sourceMap
*
* @return void
*
*
* @api
*
- * @param boolean $ignoreErrors
+ * @param bool $ignoreErrors
*
* @return \ScssPhp\ScssPhp\Compiler
*
/**
* Beautify call stack for output
*
- * @param boolean $all
+ * @param bool $all
* @param int|null $limit
*
* @return string
/**
* Call SCSS @function
*
- * @param Object $func
- * @param array $argValues
+ * @param CallableBlock|null $func
+ * @param array $argValues
*
* @return array|Number
*/
*
* @param array[] $argDef
* @param array|null $argValues
- * @param boolean $storeInEnv
- * @param boolean $reduce
- * only used if $storeInEnv = false
+ * @param bool $storeInEnv
+ * @param bool $reduce only used if $storeInEnv = false
*
* @return array<string, array|Number>
*
*
* @param array|Number $item
* @param string $delim
- * @param boolean $removeTrailingNull
+ * @param bool $removeTrailingNull
*
* @return array
*/
protected function coerceList($item, $delim = ',', $removeTrailingNull = false)
{
if ($item instanceof Number) {
- return [Type::T_LIST, $delim, [$item]];
+ return [Type::T_LIST, '', [$item]];
}
if ($item[0] === Type::T_LIST) {
$list[] = [
Type::T_LIST,
- '',
+ ' ',
[$key, $value]
];
}
- return [Type::T_LIST, ',', $list];
+ return [Type::T_LIST, $list ? ',' : '', $list];
}
- return [Type::T_LIST, $delim, [$item]];
+ return [Type::T_LIST, '', [$item]];
}
/**
}
/**
- * @param integer|Number $value
- * @param boolean $isAlpha
+ * @param int|Number $value
+ * @param bool $isAlpha
*
- * @return integer|mixed
+ * @return int|mixed
*/
protected function compileRGBAValue($value, $isAlpha = false)
{
}
/**
- * @param mixed $value
- * @param integer|float $min
- * @param integer|float $max
- * @param boolean $isInt
+ * @param mixed $value
+ * @param int|float $min
+ * @param int|float $max
+ * @param bool $isInt
*
- * @return integer|mixed
+ * @return int|mixed
*/
protected function compileColorPartValue($value, $min, $max, $isInt = true)
{
*
* @param array|Number $value
*
- * @return integer|float
+ * @return int|float
*
* @deprecated
*/
* @param array|Number $value
* @param string|null $varName
*
- * @return integer
+ * @return int
*
* @throws SassScriptException
*/
*
* @internal
*
- * @param integer $red
- * @param integer $green
- * @param integer $blue
+ * @param int $red
+ * @param int $green
+ * @param int $blue
*
* @return array
*/
*
* @api
*
- * @param integer $hue H from 0 to 360
- * @param integer $whiteness W from 0 to 100
- * @param integer $blackness B from 0 to 100
+ * @param int $hue H from 0 to 360
+ * @param int $whiteness W from 0 to 100
+ * @param int $blackness B from 0 to 100
*
* @return array
*/
*
* @api
*
- * @param integer $red
- * @param integer $green
- * @param integer $blue
+ * @param int $red
+ * @param int $green
+ * @param int $blue
*
* @return array
*/
$values = [];
-
foreach ($list[2] as $item) {
$values[] = $this->normalizeValue($item);
}
}
*/
+ /**
+ * @param array $color
+ * @param int $idx
+ * @param int|float $amount
+ *
+ * @return array
+ */
protected function adjustHsl($color, $idx, $amount)
{
$hsl = $this->toHSL($color[1], $color[2], $color[3]);
$list = $this->coerceList($args[0]);
- if (\count($list[2]) <= 1 && empty($list['enclosing'])) {
+ if ($list[1] === '' && \count($list[2]) <= 1 && empty($list['enclosing'])) {
return [Type::T_KEYWORD, 'space'];
}
return [Type::T_KEYWORD, 'comma'];
}
+ if ($list[1] === '/') {
+ return [Type::T_KEYWORD, 'slash'];
+ }
+
return [Type::T_KEYWORD, 'space'];
}
*
* @return string
* @throws CompilerException
+ *
+ * @deprecated
*/
protected function listSeparatorForJoin($list1, $sep)
{
+ @trigger_error(sprintf('The "%s" method is deprecated.', __METHOD__), E_USER_DEPRECATED);
+
if (! isset($sep)) {
return $list1[1];
}
}
}
- protected static $libJoin = ['list1', 'list2', 'separator:null', 'bracketed:auto'];
+ protected static $libJoin = ['list1', 'list2', 'separator:auto', 'bracketed:auto'];
protected function libJoin($args)
{
list($list1, $list2, $sep, $bracketed) = $args;
$list1 = $this->coerceList($list1, ' ', true);
$list2 = $this->coerceList($list2, ' ', true);
- $sep = $this->listSeparatorForJoin($list1, $sep);
+
+ switch ($this->compileStringContent($this->assertString($sep, 'separator'))) {
+ case 'comma':
+ $separator = ',';
+ break;
+
+ case 'space':
+ $separator = ' ';
+ break;
+
+ case 'slash':
+ $separator = '/';
+ break;
+
+ case 'auto':
+ if ($list1[1] !== '' || count($list1[2]) > 1 || !empty($list1['enclosing']) && $list1['enclosing'] !== 'parent') {
+ $separator = $list1[1] ?: ' ';
+ } elseif ($list2[1] !== '' || count($list2[2]) > 1 || !empty($list2['enclosing']) && $list2['enclosing'] !== 'parent') {
+ $separator = $list2[1] ?: ' ';
+ } else {
+ $separator = ' ';
+ }
+ break;
+
+ default:
+ throw SassScriptException::forArgument('Must be "space", "comma", "slash", or "auto".', 'separator');
+ }
if ($bracketed === static::$true) {
$bracketed = true;
}
}
- $res = [Type::T_LIST, $sep, array_merge($list1[2], $list2[2])];
-
- if (isset($list1['enclosing'])) {
- $res['enlcosing'] = $list1['enclosing'];
- }
+ $res = [Type::T_LIST, $separator, array_merge($list1[2], $list2[2])];
if ($bracketed) {
$res['enclosing'] = 'bracket';
return $res;
}
- protected static $libAppend = ['list', 'val', 'separator:null'];
+ protected static $libAppend = ['list', 'val', 'separator:auto'];
protected function libAppend($args)
{
list($list1, $value, $sep) = $args;
$list1 = $this->coerceList($list1, ' ', true);
- $sep = $this->listSeparatorForJoin($list1, $sep);
- $res = [Type::T_LIST, $sep, array_merge($list1[2], [$value])];
+
+ switch ($this->compileStringContent($this->assertString($sep, 'separator'))) {
+ case 'comma':
+ $separator = ',';
+ break;
+
+ case 'space':
+ $separator = ' ';
+ break;
+
+ case 'slash':
+ $separator = '/';
+ break;
+
+ case 'auto':
+ $separator = $list1[1] === '' && \count($list1[2]) <= 1 && (empty($list1['enclosing']) || $list1['enclosing'] === 'parent') ? ' ' : $list1[1];
+ break;
+
+ default:
+ throw SassScriptException::forArgument('Must be "space", "comma", "slash", or "auto".', 'separator');
+ }
+
+ $res = [Type::T_LIST, $separator, array_merge($list1[2], [$value])];
if (isset($list1['enclosing'])) {
$res['enclosing'] = $list1['enclosing'];
$result = [Type::T_LIST, ',', $lists];
if (! \is_null($firstList)) {
foreach ($firstList[2] as $key => $item) {
- $list = [Type::T_LIST, '', [$item]];
+ $list = [Type::T_LIST, ' ', [$item]];
foreach ($argLists as $arg) {
if (isset($arg[2][$key])) {
) {
$value['enclosing'] = 'forced_' . $value['enclosing'];
$force_enclosing_display = true;
+ } elseif (! \count($value[2])) {
+ $value['enclosing'] = 'forced_parent';
}
foreach ($value[2] as $k => $listelement) {
* @param array $super
* @param array $sub
*
- * @return boolean
+ * @return bool
*/
protected function isSuperSelector($super, $sub)
{
* @param array $superParts
* @param array $subParts
*
- * @return boolean
+ * @return bool
*/
protected function isSuperPart($superParts, $subParts)
{
// do the trick, happening $lastSelector to $previousSelector
$appended = [];
- foreach ($lastSelectors as $lastSelector) {
- $previous = $previousSelectors;
-
- foreach ($lastSelector as $lastSelectorParts) {
- foreach ($lastSelectorParts as $lastSelectorPart) {
- foreach ($previous as $i => $previousSelector) {
- foreach ($previousSelector as $j => $previousSelectorParts) {
- $previous[$i][$j][] = $lastSelectorPart;
+ foreach ($previousSelectors as $previousSelector) {
+ foreach ($lastSelectors as $lastSelector) {
+ $previous = $previousSelector;
+ foreach ($previousSelector as $j => $previousSelectorParts) {
+ foreach ($lastSelector as $lastSelectorParts) {
+ foreach ($lastSelectorParts as $lastSelectorPart) {
+ $previous[$j][] = $lastSelectorPart;
}
}
}
- }
- foreach ($previous as $ps) {
- $appended[] = $ps;
+ $appended[] = $previous;
}
}
* Extend/replace in selectors
* used by selector-extend and selector-replace that use the same logic
*
- * @param array $selectors
- * @param array $extendee
- * @param array $extender
- * @param boolean $replace
+ * @param array $selectors
+ * @param array $extendee
+ * @param array $extender
+ * @param bool $replace
*
* @return array
*/
*/
public $parent;
+ /**
+ * @var Environment|null
+ */
+ public $declarationScopeParent;
+
+ /**
+ * @var Environment|null
+ */
+ public $parentStore;
+
+ /**
+ * @var array|null
+ */
+ public $selectors;
+
+ /**
+ * @var string|null
+ */
+ public $marker;
+
/**
* @var array
*/
public $storeUnreduced;
/**
- * @var integer
+ * @var int
*/
public $depth;
}
abstract class Formatter
{
/**
- * @var integer
+ * @var int
*/
public $indentLevel;
public $assignSeparator;
/**
- * @var boolean
+ * @var bool
*/
public $keepSemicolons;
protected $currentBlock;
/**
- * @var integer
+ * @var int
*/
protected $currentLine;
/**
- * @var integer
+ * @var int
*/
protected $currentColumn;
*
* @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block
*
- * @return boolean
+ * @return bool
*/
protected function testEmptyChildren($block)
{
foreach ($block->lines as $index => $line) {
if (substr($line, 0, 2) === '/*' && substr($line, 2, 1) !== '!') {
unset($block->lines[$index]);
- } elseif (substr($line, 0, 3) === '/*!') {
- $block->lines[$index] = '/*' . substr($line, 3);
}
}
class Nested extends Formatter
{
/**
- * @var integer
+ * @var int
*/
private $depth;
*
* @param \ScssPhp\ScssPhp\Formatter\OutputBlock $block
*
- * @return boolean
+ * @return bool
*/
private function hasFlatChild($block)
{
public $type;
/**
- * @var integer
+ * @var int
*/
public $depth;
public $sourceName;
/**
- * @var integer|null
+ * @var int|null
*/
public $sourceLine;
/**
- * @var integer|null
+ * @var int|null
*/
public $sourceColumn;
}
public $type;
/**
- * @var integer
+ * @var int
*/
public $sourceIndex;
const PRECISION = 10;
/**
- * @var integer
+ * @var int
* @deprecated use {Number::PRECISION} instead to read the precision. Configuring it is not supported anymore.
*/
public static $precision = self::PRECISION;
];
/**
- * @var integer|float
+ * @var int|float
*/
private $dimension;
/**
* Initialize number
*
- * @param integer|float $dimension
+ * @param int|float $dimension
* @param string[]|string $numeratorUnits
* @param string[] $denominatorUnits
*
}
/**
- * {@inheritdoc}
+ * @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
}
/**
- * {@inheritdoc}
+ * @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
}
/**
- * {@inheritdoc}
+ * @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
}
/**
- * {@inheritdoc}
+ * @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
/**
* Returns true if the number is unitless
*
- * @return boolean
+ * @return bool
*/
public function unitless()
{
namespace ScssPhp\ScssPhp;
+use ScssPhp\ScssPhp\Block\AtRootBlock;
+use ScssPhp\ScssPhp\Block\CallableBlock;
+use ScssPhp\ScssPhp\Block\ContentBlock;
+use ScssPhp\ScssPhp\Block\DirectiveBlock;
+use ScssPhp\ScssPhp\Block\EachBlock;
+use ScssPhp\ScssPhp\Block\ElseBlock;
+use ScssPhp\ScssPhp\Block\ElseifBlock;
+use ScssPhp\ScssPhp\Block\ForBlock;
+use ScssPhp\ScssPhp\Block\IfBlock;
+use ScssPhp\ScssPhp\Block\MediaBlock;
+use ScssPhp\ScssPhp\Block\NestedPropertyBlock;
+use ScssPhp\ScssPhp\Block\WhileBlock;
use ScssPhp\ScssPhp\Exception\ParserException;
use ScssPhp\ScssPhp\Logger\LoggerInterface;
use ScssPhp\ScssPhp\Logger\QuietLogger;
* @api
*
* @param string|null $sourceName
- * @param integer $sourceIndex
+ * @param int $sourceIndex
* @param string|null $encoding
* @param Cache|null $cache
* @param bool $cssOnly
* @param string $buffer
* @param string|array $out
*
- * @return boolean
+ * @return bool
*/
public function parseValue($buffer, &$out)
{
* @param string|array $out
* @param bool $shouldValidate
*
- * @return boolean
+ * @return bool
*/
public function parseSelector($buffer, &$out, $shouldValidate = true)
{
* @param string $buffer
* @param string|array $out
*
- * @return boolean
+ * @return bool
*/
public function parseMediaQueryList($buffer, &$out)
{
* position into $s. Then if a chain fails, use $this->seek($s) to
* go back where we started.
*
- * @return boolean
+ * @return bool
*/
protected function parseChunk()
{
) {
! $this->cssOnly || $this->assertPlainCssValid(false, $s);
- $atRoot = $this->pushSpecialBlock(Type::T_AT_ROOT, $s);
+ $atRoot = new AtRootBlock();
+ $this->registerPushedBlock($atRoot, $s);
$atRoot->selector = $selector;
$atRoot->with = $with;
$this->mediaQueryList($mediaQueryList) &&
$this->matchChar('{', false)
) {
- $media = $this->pushSpecialBlock(Type::T_MEDIA, $s);
+ $media = new MediaBlock();
+ $this->registerPushedBlock($media, $s);
$media->queryList = $mediaQueryList[2];
return true;
) {
! $this->cssOnly || $this->assertPlainCssValid(false, $s);
- $mixin = $this->pushSpecialBlock(Type::T_MIXIN, $s);
+ $mixin = new CallableBlock(Type::T_MIXIN);
+ $this->registerPushedBlock($mixin, $s);
$mixin->name = $mixinName;
$mixin->args = $args;
];
if (! empty($hasBlock)) {
- $include = $this->pushSpecialBlock(Type::T_INCLUDE, $s);
+ $include = new ContentBlock();
+ $this->registerPushedBlock($include, $s);
$include->child = $child;
} else {
$this->append($child, $s);
) {
! $this->cssOnly || $this->assertPlainCssValid(false, $s);
- $func = $this->pushSpecialBlock(Type::T_FUNCTION, $s);
+ $func = new CallableBlock(Type::T_FUNCTION);
+ $this->registerPushedBlock($func, $s);
$func->name = $fnName;
$func->args = $args;
) {
! $this->cssOnly || $this->assertPlainCssValid(false, $s);
- $each = $this->pushSpecialBlock(Type::T_EACH, $s);
+ $each = new EachBlock();
+ $this->registerPushedBlock($each, $s);
foreach ($varNames[2] as $varName) {
$each->vars[] = $varName[1];
$cond = reset($cond[2]);
}
- $while = $this->pushSpecialBlock(Type::T_WHILE, $s);
+ $while = new WhileBlock();
+ $this->registerPushedBlock($while, $s);
$while->cond = $cond;
return true;
) {
! $this->cssOnly || $this->assertPlainCssValid(false, $s);
- $for = $this->pushSpecialBlock(Type::T_FOR, $s);
+ $for = new ForBlock();
+ $this->registerPushedBlock($for, $s);
$for->var = $varName[1];
$for->start = $start;
$for->end = $end;
) {
! $this->cssOnly || $this->assertPlainCssValid(false, $s);
- $if = $this->pushSpecialBlock(Type::T_IF, $s);
+ $if = new IfBlock();
+ $this->registerPushedBlock($if, $s);
while (
$cond[0] === Type::T_LIST &&
if (isset($last) && $last[0] === Type::T_IF) {
list(, $if) = $last;
+ assert($if instanceof IfBlock);
if ($this->literal('@else', 5)) {
if ($this->matchChar('{', false)) {
- $else = $this->pushSpecialBlock(Type::T_ELSE, $s);
+ $else = new ElseBlock();
} elseif (
$this->literal('if', 2) &&
$this->functionCallArgumentsList($cond, false, '{', false)
) {
- $else = $this->pushSpecialBlock(Type::T_ELSEIF, $s);
+ $else = new ElseifBlock();
$else->cond = $cond;
}
if (isset($else)) {
- $else->dontAppend = true;
+ $this->registerPushedBlock($else, $s);
$if->cases[] = $else;
return true;
($t1 = $this->supportsQuery($supportQuery)) &&
($t2 = $this->matchChar('{', false))
) {
- $directive = $this->pushSpecialBlock(Type::T_DIRECTIVE, $s);
+ $directive = new DirectiveBlock();
+ $this->registerPushedBlock($directive, $s);
$directive->name = 'supports';
$directive->value = $supportQuery;
$dirName = [Type::T_STRING, '', $dirName];
}
if ($dirName === 'media') {
- $directive = $this->pushSpecialBlock(Type::T_MEDIA, $s);
+ $directive = new MediaBlock();
} else {
- $directive = $this->pushSpecialBlock(Type::T_DIRECTIVE, $s);
+ $directive = new DirectiveBlock();
$directive->name = $dirName;
}
+ $this->registerPushedBlock($directive, $s);
if (isset($dirValue)) {
! $this->cssOnly || ($dirValue = $this->assertPlainCssValid($dirValue));
if ($this->matchChar('{', false)) {
! $this->cssOnly || $this->assertPlainCssValid(false);
- $propBlock = $this->pushSpecialBlock(Type::T_NESTED_PROPERTY, $s);
+ $propBlock = new NestedPropertyBlock();
+ $this->registerPushedBlock($propBlock, $s);
$propBlock->prefix = $name;
$propBlock->hasValue = $foundSomething;
}
}
- if (isset($block->type) && $block->type === Type::T_INCLUDE) {
+ if ($block instanceof ContentBlock) {
$include = $block->child;
+ assert(\is_array($include));
unset($block->child);
$include[3] = $block;
$this->append($include, $s);
- } elseif (empty($block->dontAppend)) {
+ } elseif (!$block instanceof ElseBlock && !$block instanceof ElseifBlock) {
$type = isset($block->type) ? $block->type : Type::T_BLOCK;
$this->append([$type, $block], $s);
}
* Push block onto parse tree
*
* @param array|null $selectors
- * @param integer $pos
+ * @param int $pos
*
* @return Block
*/
protected function pushBlock($selectors, $pos = 0)
+ {
+ $b = new Block();
+ $b->selectors = $selectors;
+
+ $this->registerPushedBlock($b, $pos);
+
+ return $b;
+ }
+
+ /**
+ * @param Block $b
+ * @param int $pos
+ *
+ * @return void
+ */
+ private function registerPushedBlock(Block $b, $pos)
{
list($line, $column) = $this->getSourcePosition($pos);
- $b = new Block();
$b->sourceName = $this->sourceName;
$b->sourceLine = $line;
$b->sourceColumn = $column;
$b->sourceIndex = $this->sourceIndex;
- $b->selectors = $selectors;
$b->comments = [];
$b->parent = $this->env;
$this->append(null);
}
}
-
- return $b;
}
/**
* Push special (named) block onto parse tree
*
+ * @deprecated
+ *
* @param string $type
- * @param integer $pos
+ * @param int $pos
*
* @return Block
*/
/**
* Peek input stream
*
- * @param string $regex
- * @param array $out
- * @param integer $from
+ * @param string $regex
+ * @param array $out
+ * @param int $from
*
- * @return integer
+ * @return int
*/
protected function peek($regex, &$out, $from = null)
{
/**
* Seek to position in input stream (or return current position in input stream)
*
- * @param integer $where
+ * @param int $where
*/
protected function seek($where)
{
* Assert a parsed part is plain CSS Valid
*
* @param array|false $parsed
- * @param int $startPos
+ * @param int $startPos
+ *
* @throws ParserException
*/
protected function assertPlainCssValid($parsed, $startPos = null)
/**
* Check a parsed element is plain CSS Valid
+ *
* @param array $parsed
+ * @param bool $allowExpression
+ *
* @return bool|array
*/
protected function isPlainCssValidElement($parsed, $allowExpression = false)
* @param array $m Matches (passed by reference)
* @param string $delim Delimiter
*
- * @return boolean True if match; false otherwise
+ * @return bool True if match; false otherwise
*/
protected function matchString(&$m, $delim)
{
/**
* Try to match something on head of buffer
*
- * @param string $regex
- * @param array $out
- * @param boolean $eatWhitespace
+ * @param string $regex
+ * @param array $out
+ * @param bool $eatWhitespace
*
- * @return boolean
+ * @return bool
*/
protected function match($regex, &$out, $eatWhitespace = null)
{
/**
* Match a single string
*
- * @param string $char
- * @param boolean $eatWhitespace
+ * @param string $char
+ * @param bool $eatWhitespace
*
- * @return boolean
+ * @return bool
*/
protected function matchChar($char, $eatWhitespace = null)
{
/**
* Match literal string
*
- * @param string $what
- * @param integer $len
- * @param boolean $eatWhitespace
+ * @param string $what
+ * @param int $len
+ * @param bool $eatWhitespace
*
- * @return boolean
+ * @return bool
*/
protected function literal($what, $len, $eatWhitespace = null)
{
/**
* Match some whitespace
*
- * @return boolean
+ * @return bool
*/
protected function whitespace()
{
* Append statement to current block
*
* @param array|null $statement
- * @param integer $pos
+ * @param int $pos
*/
protected function append($statement, $pos = null)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function mediaQueryList(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function mediaQuery(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function supportsQuery(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function mediaExpression(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function argValues(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function argValue(&$out)
{
/**
* Parse directive value list that considers $vars as keyword
*
- * @param array $out
- * @param boolean|string $endChar
+ * @param array $out
+ * @param bool|string $endChar
*
- * @return boolean
+ * @return bool
*/
protected function directiveValue(&$out, $endChar = false)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function valueList(&$out)
{
* Parse a function call, where externals () are part of the call
* and not of the value list
*
- * @param $out
- * @param bool $mandatoryEnclos
+ * @param array $out
+ * @param bool $mandatoryEnclos
* @param null|string $charAfter
- * @param null|bool $eatWhiteSp
+ * @param null|bool $eatWhiteSp
+ *
* @return bool
*/
protected function functionCallArgumentsList(&$out, $mandatoryEnclos = true, $charAfter = null, $eatWhiteSp = null)
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function spaceList(&$out)
{
/**
* Parse generic list
*
- * @param array $out
- * @param string $parseItem The name of the method used to parse items
- * @param string $delim
- * @param boolean $flatten
+ * @param array $out
+ * @param string $parseItem The name of the method used to parse items
+ * @param string $delim
+ * @param bool $flatten
*
- * @return boolean
+ * @return bool
*/
protected function genericList(&$out, $parseItem, $delim = '', $flatten = true)
{
/**
* Parse expression
*
- * @param array $out
- * @param boolean $listOnly
- * @param boolean $lookForExp
+ * @param array $out
+ * @param bool $listOnly
+ * @param bool $lookForExp
*
- * @return boolean
+ * @return bool
*/
protected function expression(&$out, $listOnly = false, $lookForExp = true)
{
* Parse expression specifically checking for lists in parenthesis or brackets
*
* @param array $out
- * @param integer $s
+ * @param int $s
* @param string $closingParen
* @param array $allowedTypes
*
- * @return boolean
+ * @return bool
*/
protected function enclosedExpression(&$out, $s, $closingParen = ')', $allowedTypes = [Type::T_LIST, Type::T_MAP])
{
/**
* Parse left-hand side of subexpression
*
- * @param array $lhs
- * @param integer $minP
+ * @param array $lhs
+ * @param int $minP
*
* @return array
*/
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function value(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function parenValue(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function progid(&$out)
{
* @param string $name
* @param array $func
*
- * @return boolean
+ * @return bool
*/
protected function func($name, &$func)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function argumentList(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function argumentDef(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function map(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function color(&$out)
{
*
* @param array $unit
*
- * @return boolean
+ * @return bool
*/
protected function unit(&$unit)
{
* Parse string
*
* @param array $out
+ * @param bool $keepDelimWithInterpolation
*
- * @return boolean
+ * @return bool
*/
protected function string(&$out, $keepDelimWithInterpolation = false)
{
/**
* @param string $out
- * @param bool $inKeywords
+ * @param bool $inKeywords
+ *
* @return bool
*/
protected function matchEscapeCharacter(&$out, $inKeywords = false)
/**
* Parse keyword or interpolation
*
- * @param array $out
- * @param boolean $restricted
+ * @param array $out
+ * @param bool $restricted
*
- * @return boolean
+ * @return bool
*/
protected function mixedKeyword(&$out, $restricted = false)
{
/**
* Parse an unbounded string stopped by $end
*
- * @param string $end
- * @param array $out
- * @param string $nestOpen
- * @param string $nestClose
- * @param boolean $rtrim
+ * @param string $end
+ * @param array $out
+ * @param string $nestOpen
+ * @param string $nestClose
+ * @param bool $rtrim
* @param string $disallow
*
- * @return boolean
+ * @return bool
*/
protected function openString($end, &$out, $nestOpen = null, $nestClose = null, $rtrim = true, $disallow = null)
{
* Parser interpolation
*
* @param string|array $out
- * @param boolean $lookWhite save information about whitespace before and after
+ * @param bool $lookWhite save information about whitespace before and after
*
- * @return boolean
+ * @return bool
*/
protected function interpolation(&$out, $lookWhite = true)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function propertyName(&$out)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function customProperty(&$out)
{
* Parse comma separated selector list
*
* @param array $out
- * @param string|boolean $subSelector
+ * @param string|bool $subSelector
*
- * @return boolean
+ * @return bool
*/
protected function selectors(&$out, $subSelector = false)
{
* Parse whitespace separated selector list
*
* @param array $out
- * @param string|boolean $subSelector
+ * @param string|bool $subSelector
*
- * @return boolean
+ * @return bool
*/
protected function selector(&$out, $subSelector = false)
{
* - but this require a better formal selector representation instead of the array we have now
*
* @param string $out
- * @param bool $keepEscapedNumber
+ * @param bool $keepEscapedNumber
+ *
* @return bool
*/
protected function matchEscapeCharacterInSelector(&$out, $keepEscapedNumber = false)
* }}
*
* @param array $out
- * @param string|boolean $subSelector
+ * @param string|bool $subSelector
*
- * @return boolean
+ * @return bool
*/
protected function selectorSingle(&$out, $subSelector = false)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function variable(&$out)
{
/**
* Parse a keyword
*
- * @param string $word
- * @param boolean $eatWhitespace
- * @param boolean $inSelector
+ * @param string $word
+ * @param bool $eatWhitespace
+ * @param bool $inSelector
*
- * @return boolean
+ * @return bool
*/
protected function keyword(&$word, $eatWhitespace = null, $inSelector = false)
{
/**
* Parse a keyword that should not start with a number
*
- * @param string $word
- * @param boolean $eatWhitespace
- * @param boolean $inSelector
+ * @param string $word
+ * @param bool $eatWhitespace
+ * @param bool $inSelector
*
- * @return boolean
+ * @return bool
*/
protected function restrictedKeyword(&$word, $eatWhitespace = null, $inSelector = false)
{
*
* @param string|array $placeholder
*
- * @return boolean
+ * @return bool
*/
protected function placeholder(&$placeholder)
{
*
* @param array $out
*
- * @return boolean
+ * @return bool
*/
protected function url(&$out)
{
* Consume an end of statement delimiter
* @param bool $eatWhitespace
*
- * @return boolean
+ * @return bool
*/
protected function end($eatWhitespace = null)
{
/**
* Get source line number and column (given character position in the buffer)
*
- * @param integer $pos
+ * @param int $pos
*
* @return array
*/
/**
* Convert to base64
*
- * @param integer $value
+ * @param int $value
*
* @return string
*/
*
* @param string $value
*
- * @return integer
+ * @return int
*/
public static function decode($value)
{
/**
* Returns the VLQ encoded value.
*
- * @param integer $value
+ * @param int $value
*
* @return string
*/
* Decodes VLQValue.
*
* @param string $str
- * @param integer $index
+ * @param int $index
*
- * @return integer
+ * @return int
*/
public static function decode($str, &$index)
{
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
*
- * @param integer $value
+ * @param int $value
*
- * @return integer
+ * @return int
*/
private static function toVLQSigned($value)
{
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
*
- * @param integer $value
+ * @param int $value
*
- * @return integer
+ * @return int
*/
private static function fromVLQSigned($value)
{
/**
* Adds a mapping
*
- * @param integer $generatedLine The line number in generated file
- * @param integer $generatedColumn The column number in generated file
- * @param integer $originalLine The line number in original file
- * @param integer $originalColumn The column number in original file
- * @param string $sourceFile The original source file
+ * @param int $generatedLine The line number in generated file
+ * @param int $generatedColumn The column number in generated file
+ * @param int $originalLine The line number in original file
+ * @param int $originalColumn The column number in original file
+ * @param string $sourceFile The original source file
*
* @return void
*/
*
* @param string $filename
*
- * @return integer|false
+ * @return int|false
*/
protected function findFileIndex($filename)
{
/**
* Fix windows paths
*
- * @param string $path
- * @param boolean $addEndSlash
+ * @param string $path
+ * @param bool $addEndSlash
*
* @return string
*/
*/
class Type
{
+ /**
+ * @internal
+ */
const T_ASSIGN = 'assign';
+ /**
+ * @internal
+ */
const T_AT_ROOT = 'at-root';
+ /**
+ * @internal
+ */
const T_BLOCK = 'block';
- /** @deprecated */
+ /**
+ * @deprecated
+ * @internal
+ */
const T_BREAK = 'break';
+ /**
+ * @internal
+ */
const T_CHARSET = 'charset';
const T_COLOR = 'color';
+ /**
+ * @internal
+ */
const T_COMMENT = 'comment';
- /** @deprecated */
+ /**
+ * @deprecated
+ * @internal
+ */
const T_CONTINUE = 'continue';
- /** @deprecated */
+ /**
+ * @deprecated
+ * @internal
+ */
const T_CONTROL = 'control';
+ /**
+ * @internal
+ */
const T_CUSTOM_PROPERTY = 'custom';
+ /**
+ * @internal
+ */
const T_DEBUG = 'debug';
+ /**
+ * @internal
+ */
const T_DIRECTIVE = 'directive';
+ /**
+ * @internal
+ */
const T_EACH = 'each';
+ /**
+ * @internal
+ */
const T_ELSE = 'else';
+ /**
+ * @internal
+ */
const T_ELSEIF = 'elseif';
+ /**
+ * @internal
+ */
const T_ERROR = 'error';
+ /**
+ * @internal
+ */
const T_EXPRESSION = 'exp';
+ /**
+ * @internal
+ */
const T_EXTEND = 'extend';
+ /**
+ * @internal
+ */
const T_FOR = 'for';
const T_FUNCTION = 'function';
+ /**
+ * @internal
+ */
const T_FUNCTION_REFERENCE = 'function-reference';
+ /**
+ * @internal
+ */
const T_FUNCTION_CALL = 'fncall';
+ /**
+ * @internal
+ */
const T_HSL = 'hsl';
+ /**
+ * @internal
+ */
const T_HWB = 'hwb';
+ /**
+ * @internal
+ */
const T_IF = 'if';
+ /**
+ * @internal
+ */
const T_IMPORT = 'import';
+ /**
+ * @internal
+ */
const T_INCLUDE = 'include';
+ /**
+ * @internal
+ */
const T_INTERPOLATE = 'interpolate';
+ /**
+ * @internal
+ */
const T_INTERPOLATED = 'interpolated';
+ /**
+ * @internal
+ */
const T_KEYWORD = 'keyword';
const T_LIST = 'list';
const T_MAP = 'map';
+ /**
+ * @internal
+ */
const T_MEDIA = 'media';
+ /**
+ * @internal
+ */
const T_MEDIA_EXPRESSION = 'mediaExp';
+ /**
+ * @internal
+ */
const T_MEDIA_TYPE = 'mediaType';
+ /**
+ * @internal
+ */
const T_MEDIA_VALUE = 'mediaValue';
+ /**
+ * @internal
+ */
const T_MIXIN = 'mixin';
+ /**
+ * @internal
+ */
const T_MIXIN_CONTENT = 'mixin_content';
+ /**
+ * @internal
+ */
const T_NESTED_PROPERTY = 'nestedprop';
+ /**
+ * @internal
+ */
const T_NOT = 'not';
const T_NULL = 'null';
const T_NUMBER = 'number';
+ /**
+ * @internal
+ */
const T_RETURN = 'return';
+ /**
+ * @internal
+ */
const T_ROOT = 'root';
+ /**
+ * @internal
+ */
const T_SCSSPHP_IMPORT_ONCE = 'scssphp-import-once';
+ /**
+ * @internal
+ */
const T_SELF = 'self';
const T_STRING = 'string';
+ /**
+ * @internal
+ */
const T_UNARY = 'unary';
+ /**
+ * @internal
+ */
const T_VARIABLE = 'var';
+ /**
+ * @internal
+ */
const T_WARN = 'warn';
+ /**
+ * @internal
+ */
const T_WHILE = 'while';
}
/**
* mb_chr() wrapper
*
- * @param integer $code
+ * @param int $code
*
* @return string
*/
*/
class Version
{
- const VERSION = '1.9.0';
+ const VERSION = '1.10.0';
}
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
{
- if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) {
+ if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) {
$fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
} else {
$fromEncoding = self::getEncoding($fromEncoding);
if (80000 > \PHP_VERSION_ID) {
return false;
}
+ if (\is_int($c) || 'long' === $c || 'entity' === $c) {
+ return false;
+ }
throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint');
}
"require": {
"php": ">=7.1"
},
+ "provide": {
+ "ext-mbstring": "*"
+ },
"autoload": {
"psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" },
"files": [ "bootstrap.php" ]
* file that was distributed with this source code.
*/
-class JsonException extends Exception
-{
+if (\PHP_VERSION_ID < 70300) {
+ class JsonException extends Exception
+ {
+ }
}
<?php
-class UnhandledMatchError extends Error
-{
+if (\PHP_VERSION_ID < 80000) {
+ class UnhandledMatchError extends Error
+ {
+ }
}
<?php
-class ValueError extends Error
-{
+if (\PHP_VERSION_ID < 80000) {
+ class ValueError extends Error
+ {
+ }
}