Ditty News Ticker - Version 3.0.6

Version Description

  • Ditty Editor Items javascript helper update
  • Minor update in legacy ditty-news-ticker.js file
Download this release

Release Info

Developer metaphorcreations
Plugin Icon 128x128 Ditty News Ticker
Version 3.0.6
Comparing to
See all releases

Code changes from version 3.0.5 to 3.0.6

Files changed (164) hide show
  1. composer.json +0 -8
  2. ditty-news-ticker.php +2 -2
  3. includes/admin/notices.php +47 -0
  4. includes/class-ditty.php +1 -0
  5. includes/css/ditty-admin.css +76 -28
  6. includes/js/ditty-admin.js +14 -0
  7. includes/js/ditty-admin.min.js +14 -0
  8. includes/js/ditty.min.js +5 -8
  9. includes/js/partials/helpers.js +5 -8
  10. includes/sass/admin/_dashboard.scss +29 -4
  11. includes/sass/admin/_settings.scss +2 -2
  12. includes/upgrades.php +22 -2
  13. legacy/inc/static/js/ditty-news-ticker.js +5 -1
  14. legacy/inc/static/js/ditty-news-ticker.min.js +1 -1
  15. readme.txt +6 -2
  16. vendor/.gitignore +0 -7
  17. vendor/autoload.php +1 -1
  18. vendor/composer/InstalledVersions.php +8 -8
  19. vendor/composer/autoload_namespaces.php +0 -1
  20. vendor/composer/autoload_psr4.php +1 -0
  21. vendor/composer/autoload_real.php +4 -4
  22. vendor/composer/autoload_static.php +9 -15
  23. vendor/composer/installed.json +23 -19
  24. vendor/composer/installed.php +8 -8
  25. vendor/composer/platform_check.php +2 -2
  26. vendor/sabberworm/php-css-parser/.gitignore +0 -1
  27. vendor/sabberworm/php-css-parser/.travis.yml +0 -22
  28. vendor/sabberworm/php-css-parser/CHANGELOG.md +101 -84
  29. vendor/sabberworm/php-css-parser/Doxyfile +0 -2310
  30. vendor/sabberworm/php-css-parser/LICENSE +21 -0
  31. vendor/sabberworm/php-css-parser/README.html +641 -0
  32. vendor/sabberworm/php-css-parser/README.md +75 -85
  33. vendor/sabberworm/php-css-parser/composer.json +54 -6
  34. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php +0 -50
  35. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php +0 -107
  36. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSList.php +0 -348
  37. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/Document.php +0 -110
  38. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/KeyFrame.php +0 -56
  39. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Comment.php +0 -51
  40. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Commentable.php +0 -23
  41. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/OutputFormat.php +0 -322
  42. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parser.php +0 -41
  43. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/OutputException.php +0 -12
  44. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/ParserState.php +0 -310
  45. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/SourceException.php +0 -18
  46. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/UnexpectedTokenException.php +0 -31
  47. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/AtRule.php +0 -16
  48. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/CSSNamespace.php +0 -75
  49. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Charset.php +0 -66
  50. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Import.php +0 -69
  51. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Selector.php +0 -74
  52. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Renderable.php +0 -9
  53. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Rule/Rule.php +0 -236
  54. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/AtRuleSet.php +0 -44
  55. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php +0 -628
  56. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php +0 -212
  57. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Settings.php +0 -54
  58. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSFunction.php +0 -40
  59. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSString.php +0 -66
  60. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CalcFunction.php +0 -62
  61. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CalcRuleValueList.php +0 -14
  62. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Color.php +0 -95
  63. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/LineName.php +0 -41
  64. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/PrimitiveValue.php +0 -10
  65. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/RuleValueList.php +0 -9
  66. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Size.php +0 -122
  67. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/URL.php +0 -49
  68. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Value.php +0 -131
  69. vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/ValueList.php +0 -47
  70. vendor/sabberworm/php-css-parser/phpunit.xml +0 -10
  71. vendor/sabberworm/php-css-parser/src/CSSList/AtRuleBlockList.php +83 -0
  72. vendor/sabberworm/php-css-parser/src/CSSList/CSSBlockList.php +143 -0
  73. vendor/sabberworm/php-css-parser/src/CSSList/CSSList.php +479 -0
  74. vendor/sabberworm/php-css-parser/src/CSSList/Document.php +172 -0
  75. vendor/sabberworm/php-css-parser/src/CSSList/KeyFrame.php +104 -0
  76. vendor/sabberworm/php-css-parser/src/Comment/Comment.php +71 -0
  77. vendor/sabberworm/php-css-parser/src/Comment/Commentable.php +25 -0
  78. vendor/sabberworm/php-css-parser/src/OutputFormat.php +334 -0
  79. vendor/sabberworm/php-css-parser/src/OutputFormatter.php +231 -0
  80. vendor/sabberworm/php-css-parser/src/Parser.php +60 -0
  81. vendor/sabberworm/php-css-parser/src/Parsing/OutputException.php +18 -0
  82. vendor/sabberworm/php-css-parser/src/Parsing/ParserState.php +516 -0
  83. vendor/sabberworm/php-css-parser/src/Parsing/SourceException.php +32 -0
  84. vendor/sabberworm/php-css-parser/src/Parsing/UnexpectedEOFException.php +12 -0
  85. vendor/sabberworm/php-css-parser/src/Parsing/UnexpectedTokenException.php +51 -0
  86. vendor/sabberworm/php-css-parser/src/Property/AtRule.php +34 -0
  87. vendor/sabberworm/php-css-parser/src/Property/CSSNamespace.php +154 -0
  88. vendor/sabberworm/php-css-parser/src/Property/Charset.php +129 -0
  89. vendor/sabberworm/php-css-parser/src/Property/Import.php +137 -0
  90. vendor/sabberworm/php-css-parser/src/Property/KeyframeSelector.php +23 -0
  91. vendor/sabberworm/php-css-parser/src/Property/Selector.php +138 -0
  92. vendor/sabberworm/php-css-parser/src/Renderable.php +21 -0
  93. vendor/sabberworm/php-css-parser/src/Rule/Rule.php +392 -0
  94. vendor/sabberworm/php-css-parser/src/RuleSet/AtRuleSet.php +73 -0
  95. vendor/sabberworm/php-css-parser/src/RuleSet/DeclarationBlock.php +831 -0
  96. vendor/sabberworm/php-css-parser/src/RuleSet/RuleSet.php +326 -0
  97. vendor/sabberworm/php-css-parser/src/Settings.php +89 -0
  98. vendor/sabberworm/php-css-parser/src/Value/CSSFunction.php +73 -0
  99. vendor/sabberworm/php-css-parser/src/Value/CSSString.php +105 -0
  100. vendor/sabberworm/php-css-parser/src/Value/CalcFunction.php +89 -0
  101. vendor/sabberworm/php-css-parser/src/Value/CalcRuleValueList.php +24 -0
  102. vendor/sabberworm/php-css-parser/src/Value/Color.php +166 -0
  103. vendor/sabberworm/php-css-parser/src/Value/LineName.php +65 -0
  104. vendor/sabberworm/php-css-parser/src/Value/PrimitiveValue.php +14 -0
  105. vendor/sabberworm/php-css-parser/src/Value/RuleValueList.php +15 -0
  106. vendor/sabberworm/php-css-parser/src/Value/Size.php +209 -0
  107. vendor/sabberworm/php-css-parser/src/Value/URL.php +82 -0
  108. vendor/sabberworm/php-css-parser/src/Value/Value.php +198 -0
  109. vendor/sabberworm/php-css-parser/src/Value/ValueList.php +100 -0
  110. vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/CSSList/AtRuleBlockListTest.php +0 -27
  111. vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/CSSList/DocumentTest.php +0 -26
  112. vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/OutputFormatTest.php +0 -170
  113. vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/ParserTest.php +0 -714
  114. vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/RuleSet/DeclarationBlockTest.php +0 -267
  115. vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/RuleSet/LenientParsingTest.php +0 -76
  116. vendor/sabberworm/php-css-parser/tests/bootstrap.php +0 -10
  117. vendor/sabberworm/php-css-parser/tests/files/-calc-no-space-around-minus.css +0 -1
  118. vendor/sabberworm/php-css-parser/tests/files/-charset-after-rule.css +0 -5
  119. vendor/sabberworm/php-css-parser/tests/files/-charset-in-block.css +0 -3
  120. vendor/sabberworm/php-css-parser/tests/files/-empty-grid-linename.css +0 -1
  121. vendor/sabberworm/php-css-parser/tests/files/-empty.css +0 -0
  122. vendor/sabberworm/php-css-parser/tests/files/-end-token-2.css +0 -1
  123. vendor/sabberworm/php-css-parser/tests/files/-end-token.css +0 -1
  124. vendor/sabberworm/php-css-parser/tests/files/-fault-tolerance.css +0 -15
  125. vendor/sabberworm/php-css-parser/tests/files/-tobedone.css +0 -9
  126. vendor/sabberworm/php-css-parser/tests/files/1readme.css +0 -10
  127. vendor/sabberworm/php-css-parser/tests/files/2readme.css +0 -5
  128. vendor/sabberworm/php-css-parser/tests/files/atrules.css +0 -57
  129. vendor/sabberworm/php-css-parser/tests/files/calc-nested.css +0 -4
  130. vendor/sabberworm/php-css-parser/tests/files/calc.css +0 -6
  131. vendor/sabberworm/php-css-parser/tests/files/case-insensitivity.css +0 -15
  132. vendor/sabberworm/php-css-parser/tests/files/colortest.css +0 -12
  133. vendor/sabberworm/php-css-parser/tests/files/comments.css +0 -17
  134. vendor/sabberworm/php-css-parser/tests/files/create-shorthands.css +0 -6
  135. vendor/sabberworm/php-css-parser/tests/files/docuwiki.css +0 -1
  136. vendor/sabberworm/php-css-parser/tests/files/empty-grid-linename.css +0 -1
  137. vendor/sabberworm/php-css-parser/tests/files/expand-shorthands.css +0 -7
  138. vendor/sabberworm/php-css-parser/tests/files/functions.css +0 -21
  139. vendor/sabberworm/php-css-parser/tests/files/grid-linename.css +0 -2
  140. vendor/sabberworm/php-css-parser/tests/files/hex-alpha.css +0 -2
  141. vendor/sabberworm/php-css-parser/tests/files/ie-hacks.css +0 -9
  142. vendor/sabberworm/php-css-parser/tests/files/ie.css +0 -6
  143. vendor/sabberworm/php-css-parser/tests/files/important.css +0 -8
  144. vendor/sabberworm/php-css-parser/tests/files/inner-color.css +0 -3
  145. vendor/sabberworm/php-css-parser/tests/files/line-numbers.css +0 -32
  146. vendor/sabberworm/php-css-parser/tests/files/missing-property-value.css +0 -4
  147. vendor/sabberworm/php-css-parser/tests/files/ms-filter.css +0 -1
  148. vendor/sabberworm/php-css-parser/tests/files/namespaces.css +0 -18
  149. vendor/sabberworm/php-css-parser/tests/files/nested.css +0 -17
  150. vendor/sabberworm/php-css-parser/tests/files/slashed.css +0 -4
  151. vendor/sabberworm/php-css-parser/tests/files/specificity.css +0 -7
  152. vendor/sabberworm/php-css-parser/tests/files/trailing-whitespace.css +0 -2
  153. vendor/sabberworm/php-css-parser/tests/files/unicode-range.css +0 -3
  154. vendor/sabberworm/php-css-parser/tests/files/unicode.css +0 -12
  155. vendor/sabberworm/php-css-parser/tests/files/unmatched_braces.css +0 -18
  156. vendor/sabberworm/php-css-parser/tests/files/unopened-close-brackets.css +0 -3
  157. vendor/sabberworm/php-css-parser/tests/files/url.css +0 -4
  158. vendor/sabberworm/php-css-parser/tests/files/values.css +0 -14
  159. vendor/sabberworm/php-css-parser/tests/files/webkit.css +0 -1
  160. vendor/sabberworm/php-css-parser/tests/files/whitespace.css +0 -3
  161. vendor/sabberworm/php-css-parser/tests/phpunit.xml +0 -1
  162. vendor/sabberworm/php-css-parser/tests/quickdump.php +0 -20
  163. vendor/scssphp/scssphp/src/Compiler.php +226 -43
  164. vendor/scssphp/scssphp/src/Version.php +1 -1
composer.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "require": {
3
- "padaliyajay/php-autoprefixer": "^1.2",
4
- "composer/installers": "^1",
5
- "thunderer/shortcode": "^0.7",
6
- "scssphp/scssphp": "^1.8.1"
7
- }
8
- }
 
 
 
 
 
 
 
 
ditty-news-ticker.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Ditty (formerly Ditty News Ticker)
5
  * Plugin URI: https://www.metaphorcreations.com/ditty
6
  * Description: Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
7
- * Version: 3.0.5
8
  * Author: Metaphor Creations
9
  * Author URI: https://www.metaphorcreations.com
10
  * License: GPL-2.0+
@@ -20,7 +20,7 @@ if ( ! defined( 'WPINC' ) ) {
20
 
21
  // Plugin version.
22
  if ( ! defined( 'DITTY_VERSION' ) ) {
23
- define( 'DITTY_VERSION', '3.0.5' );
24
  }
25
 
26
  // Plugin Folder Path.
4
  * Plugin Name: Ditty (formerly Ditty News Ticker)
5
  * Plugin URI: https://www.metaphorcreations.com/ditty
6
  * Description: Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
7
+ * Version: 3.0.6
8
  * Author: Metaphor Creations
9
  * Author URI: https://www.metaphorcreations.com
10
  * License: GPL-2.0+
20
 
21
  // Plugin version.
22
  if ( ! defined( 'DITTY_VERSION' ) ) {
23
+ define( 'DITTY_VERSION', '3.0.6' );
24
  }
25
 
26
  // Plugin Folder Path.
includes/admin/notices.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Add dashboard notices
5
+ *
6
+ * @since 3.0.6
7
+ */
8
+ function ditty_dashboard_notices() {
9
+ $ditty_notices = get_option( 'ditty_notices', array() );
10
+ if ( isset( $ditty_notices['v3_0_6'] ) ) {
11
+ ?>
12
+ <div class="notice notice-info is-dismissible ditty-dashboard-notice" data-notice_id="v3_0_6">
13
+ <p><?php printf( __( 'Ditty v%s', 'ditty-news-ticker' ), ditty_version() ); ?></p>
14
+ <p><?php _e( '<strong>Ditty News Ticker</strong> has now become <strong>Ditty</strong>!', 'ditty-news-ticker' ); ?></p>
15
+ <p><?php _e( "This major upgrade includes a complete rebuild of the Ditty News Ticker package. Due to the size of the ugrade we opted to create a new <strong>Ditty</strong> post type that you can start using right away. Ditty offers you more control over the display and look of your content, along with many highly requested features.", 'ditty-news-ticker' ); ?></p>
16
+ <ul class="ditty-features-list">
17
+ <li><i class="fas fa-redo-alt"></i> <?php _e( 'Live Updates', 'ditty-news-ticker' ); ?></li>
18
+ <li><i class="fas fa-edit"></i> <?php _e( 'Live Editing', 'ditty-news-ticker' ); ?></li>
19
+ <li><i class="fas fa-plus-square"></i> <?php _e( 'Global Rendering', 'ditty-news-ticker' ); ?></li>
20
+ <li><i class="fas fa-random"></i> <?php _e( 'Mix & Match Content', 'ditty-news-ticker' ); ?></li>
21
+ <li><i class="fas fa-tablet-alt"></i> <?php _e( 'Customized Displays', 'ditty-news-ticker' ); ?></li>
22
+ <li><i class="fas fa-pencil-ruler"></i> <?php _e( 'Customized Layouts', 'ditty-news-ticker' ); ?></li>
23
+ </ul>
24
+ <p><?php _e( "Don't worry, all of your existing <strong>News Tickers</strong> will still work! Although, we do urge you to start upgrading and updating your tickers to the new <strong>Ditty</strong> post type. <strong>Ditty News Ticker</strong> is now relegated to legacy code and there will be very limited updates from this point on. Most development time will now be assigned to <strong>Ditty</strong> along with existing and new <strong>Ditty</strong> extensions. Legacy <strong>News Tickers</strong> can be enabled on the <strong>Advanced</strong> tab of the <strong>Ditty > Settings</strong> page.", 'ditty-news-ticker' ); ?></p>
25
+ </div>
26
+ <?php
27
+ }
28
+ }
29
+ add_action( 'admin_notices', 'ditty_dashboard_notices' );
30
+
31
+
32
+ /**
33
+ * Close and save a notice
34
+ *
35
+ * @since 3.0.6
36
+ */
37
+ function ditty_notice_close_ajax() {
38
+ check_ajax_referer( 'ditty', 'security' );
39
+ $notice_id_ajax = isset( $_POST['notice_id'] ) ? $_POST['notice_id'] : false;
40
+ if ( ! $notice_id_ajax ) {
41
+ wp_die();
42
+ }
43
+ $ditty_notices = get_option( 'ditty_notices', array() );
44
+ unset( $ditty_notices[$notice_id_ajax] );
45
+ update_option( 'ditty_notices', $ditty_notices );
46
+ }
47
+ add_action( 'wp_ajax_ditty_notice_close', 'ditty_notice_close_ajax' );
includes/class-ditty.php CHANGED
@@ -304,6 +304,7 @@ class Ditty {
304
  require_once DITTY_DIR . 'includes/admin/EDD_SL_Plugin_Updater.php';
305
  }
306
  require_once DITTY_DIR . 'includes/admin/columns.php';
 
307
  require_once DITTY_DIR . 'includes/admin/settings.php';
308
  //require_once DITTY_DIR . 'includes/admin/info.php';
309
  }
304
  require_once DITTY_DIR . 'includes/admin/EDD_SL_Plugin_Updater.php';
305
  }
306
  require_once DITTY_DIR . 'includes/admin/columns.php';
307
+ require_once DITTY_DIR . 'includes/admin/notices.php';
308
  require_once DITTY_DIR . 'includes/admin/settings.php';
309
  //require_once DITTY_DIR . 'includes/admin/info.php';
310
  }
includes/css/ditty-admin.css CHANGED
@@ -1,22 +1,19 @@
1
- .wp-admin.post-type-ditty .wrap {
2
- margin-right: 2px; }
3
-
4
- .wp-admin.post-type-ditty #poststuff {
5
  min-width: inherit; }
6
 
7
- .wp-admin.post-type-ditty #post-body-content {
8
  min-width: inherit; }
9
 
10
- .wp-admin.post-type-ditty #post-body.columns-2 #postbox-container-1 {
11
  margin-right: -400px;
12
  width: 380px; }
13
 
14
- .wp-admin.post-type-ditty #poststuff #post-body.columns-2 {
15
  margin-right: 400px; }
16
- .wp-admin.post-type-ditty #poststuff #post-body.columns-2 #side-sortables {
17
  width: 380px; }
18
 
19
- .wp-admin.post-type-ditty #titlediv {
20
  display: none; }
21
 
22
  @media only screen and (max-width: 850px) {
@@ -59,6 +56,28 @@ table.wp-list-table .type-ditty_display .row-actions {
59
  padding-bottom: 8px;
60
  margin-bottom: -8px; }
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  .ditty-field {
63
  padding: 10px 0;
64
  border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
@@ -131,14 +150,17 @@ table.wp-list-table .type-ditty_display .row-actions {
131
  .ditty-field__input__actions a:hover {
132
  color: rgba(0, 0, 0, 0.7); }
133
  .ditty-field__input__actions a:hover i {
134
- transform: scale(1.2); }
 
135
  .ditty-field__input__actions i {
136
  display: block;
137
  width: 20px;
138
  height: 20px;
139
  text-align: center;
140
  line-height: 20px;
141
- transition: transform 0.3s ease; }
 
 
142
  .ditty-field__actions__clone {
143
  margin-bottom: 0; }
144
 
@@ -199,9 +221,12 @@ table.wp-list-table .type-ditty_display .row-actions {
199
  color: #FFF;
200
  background: rgba(255, 255, 255, 0.2);
201
  border-radius: 50%;
202
- transition: transform .25s ease; }
 
 
203
  .ditty-field-type--group[data-collapsible="expanded"] .ditty-field__collapsible-toggle {
204
- transform: rotate(180deg); }
 
205
 
206
  .ditty-input--group {
207
  margin: 0; }
@@ -435,7 +460,8 @@ table.wp-list-table .type-ditty_display .row-actions {
435
  position: absolute;
436
  top: 50%;
437
  left: 10px;
438
- transform: translateY(-50%);
 
439
  margin-top: -1px;
440
  font-family: 'Font Awesome 5 Pro';
441
  content: '\f073';
@@ -666,8 +692,11 @@ table.wp-list-table .type-ditty_display .row-actions {
666
  #ditty-extensions .ditty-extension__header__icon i {
667
  font-size: 260px;
668
  color: #FFF;
669
- transform: scale(0.8) rotate(-25deg);
670
- transition: transform .5s ease; }
 
 
 
671
  #ditty-extensions .ditty-extension__header__overlay {
672
  position: absolute;
673
  top: 0;
@@ -699,8 +728,11 @@ table.wp-list-table .type-ditty_display .row-actions {
699
  border: 4px solid #FFF;
700
  box-sizing: content-box;
701
  opacity: 0;
702
- transform: translateX(-50px);
 
 
703
  transition: transform .5s ease, opacity .25s ease;
 
704
  transition-delay: .25s;
705
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); }
706
  #ditty-extensions .ditty-extension__icon img {
@@ -726,7 +758,9 @@ table.wp-list-table .type-ditty_display .row-actions {
726
  border-radius: 50%;
727
  border: 4px solid #FFF;
728
  box-sizing: content-box;
 
729
  transition: transform .75s ease, border-width .75s ease;
 
730
  transition-delay: .75s; }
731
  #ditty-extensions .ditty-extension__title {
732
  position: relative;
@@ -889,13 +923,16 @@ table.wp-list-table .type-ditty_display .row-actions {
889
  #ditty-extensions .ditty-extension--init .ditty-extension__header__overlay {
890
  background: rgba(35, 40, 46, 0.5); }
891
  #ditty-extensions .ditty-extension--init .ditty-extension__header__icon i {
892
- transform: scale(1) rotate(0); }
 
893
  #ditty-extensions .ditty-extension--init .ditty-extension__icon {
894
  opacity: 1;
895
- transform: translateX(0); }
 
896
  #ditty-extensions .ditty-extension--init .ditty-extension__icon__small {
897
  border-width: 10px;
898
- transform: scale(0.3) translate(-120px, -120px); }
 
899
  #ditty-extensions .ditty-extension--init .ditty-extension__title {
900
  opacity: 1; }
901
 
@@ -971,8 +1008,11 @@ table.wp-list-table .type-ditty_display .row-actions {
971
  #ditty-extensions-app .ditty-extension__header__icon i {
972
  font-size: 260px;
973
  color: #FFF;
974
- transform: scale(0.8) rotate(-25deg);
975
- transition: transform .5s ease; }
 
 
 
976
  #ditty-extensions-app .ditty-extension__header__overlay {
977
  position: absolute;
978
  top: 0;
@@ -1001,8 +1041,11 @@ table.wp-list-table .type-ditty_display .row-actions {
1001
  border: 4px solid #FFF;
1002
  box-sizing: content-box;
1003
  opacity: 0;
1004
- transform: translateX(-50px);
 
 
1005
  transition: transform .5s ease, opacity .25s ease;
 
1006
  transition-delay: .25s;
1007
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); }
1008
  #ditty-extensions-app .ditty-extension__icon img {
@@ -1026,7 +1069,9 @@ table.wp-list-table .type-ditty_display .row-actions {
1026
  border-radius: 50%;
1027
  border: 4px solid #FFF;
1028
  box-sizing: content-box;
 
1029
  transition: transform .75s ease, border-width .75s ease;
 
1030
  transition-delay: .75s; }
1031
  #ditty-extensions-app .ditty-extension__title {
1032
  position: relative;
@@ -1183,13 +1228,16 @@ table.wp-list-table .type-ditty_display .row-actions {
1183
  #ditty-extensions-app .ditty-extension--init .ditty-extension__header__overlay {
1184
  background: rgba(35, 40, 46, 0.5); }
1185
  #ditty-extensions-app .ditty-extension--init .ditty-extension__header__icon i {
1186
- transform: scale(1) rotate(0); }
 
1187
  #ditty-extensions-app .ditty-extension--init .ditty-extension__icon {
1188
  opacity: 1;
1189
- transform: translateX(0); }
 
1190
  #ditty-extensions-app .ditty-extension--init .ditty-extension__icon__small {
1191
  border-width: 10px;
1192
- transform: scale(0.3) translate(-120px, -120px); }
 
1193
  #ditty-extensions-app .ditty-extension--init .ditty-extension__title {
1194
  opacity: 1; }
1195
 
@@ -1329,7 +1377,7 @@ table.wp-list-table .type-ditty_display .row-actions {
1329
 
1330
  #ditty-page {
1331
  width: 1200px;
1332
- max-width: calc( 100% - 22px);
1333
  border-radius: 5px;
1334
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
1335
  margin-top: 22px;
@@ -1359,7 +1407,7 @@ table.wp-list-table .type-ditty_display .row-actions {
1359
 
1360
  @media screen and (max-width: 782px) {
1361
  #ditty-page {
1362
- max-width: calc( 100% - 10px);
1363
  margin-top: 10px; } }
1364
 
1365
  #ditty-settings {
1
+ .wp-admin.post-php.post-type-ditty #poststuff {
 
 
 
2
  min-width: inherit; }
3
 
4
+ .wp-admin.post-php.post-type-ditty #post-body-content {
5
  min-width: inherit; }
6
 
7
+ .wp-admin.post-php.post-type-ditty #post-body.columns-2 #postbox-container-1 {
8
  margin-right: -400px;
9
  width: 380px; }
10
 
11
+ .wp-admin.post-php.post-type-ditty #poststuff #post-body.columns-2 {
12
  margin-right: 400px; }
13
+ .wp-admin.post-php.post-type-ditty #poststuff #post-body.columns-2 #side-sortables {
14
  width: 380px; }
15
 
16
+ .wp-admin.post-php.post-type-ditty #titlediv {
17
  display: none; }
18
 
19
  @media only screen and (max-width: 850px) {
56
  padding-bottom: 8px;
57
  margin-bottom: -8px; }
58
 
59
+ .ditty-dashboard-notice.notice-info {
60
+ border-left-color: #19BF7C; }
61
+
62
+ .ditty-dashboard-notice .ditty-features-list {
63
+ display: flex;
64
+ flex-direction: row;
65
+ align-items: center;
66
+ justify-content: flex-start;
67
+ flex-wrap: wrap; }
68
+ .ditty-dashboard-notice .ditty-features-list li {
69
+ display: flex;
70
+ flex-direction: row;
71
+ align-items: center;
72
+ justify-content: flex-start;
73
+ color: #FFF;
74
+ background: #19BF7C;
75
+ border-radius: 3px;
76
+ padding: 5px 10px;
77
+ margin: 0 5px 5px 0; }
78
+ .ditty-dashboard-notice .ditty-features-list li i {
79
+ margin-right: 5px; }
80
+
81
  .ditty-field {
82
  padding: 10px 0;
83
  border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
150
  .ditty-field__input__actions a:hover {
151
  color: rgba(0, 0, 0, 0.7); }
152
  .ditty-field__input__actions a:hover i {
153
+ -webkit-transform: scale(1.2);
154
+ transform: scale(1.2); }
155
  .ditty-field__input__actions i {
156
  display: block;
157
  width: 20px;
158
  height: 20px;
159
  text-align: center;
160
  line-height: 20px;
161
+ transition: -webkit-transform 0.3s ease;
162
+ transition: transform 0.3s ease;
163
+ transition: transform 0.3s ease, -webkit-transform 0.3s ease; }
164
  .ditty-field__actions__clone {
165
  margin-bottom: 0; }
166
 
221
  color: #FFF;
222
  background: rgba(255, 255, 255, 0.2);
223
  border-radius: 50%;
224
+ transition: -webkit-transform .25s ease;
225
+ transition: transform .25s ease;
226
+ transition: transform .25s ease, -webkit-transform .25s ease; }
227
  .ditty-field-type--group[data-collapsible="expanded"] .ditty-field__collapsible-toggle {
228
+ -webkit-transform: rotate(180deg);
229
+ transform: rotate(180deg); }
230
 
231
  .ditty-input--group {
232
  margin: 0; }
460
  position: absolute;
461
  top: 50%;
462
  left: 10px;
463
+ -webkit-transform: translateY(-50%);
464
+ transform: translateY(-50%);
465
  margin-top: -1px;
466
  font-family: 'Font Awesome 5 Pro';
467
  content: '\f073';
692
  #ditty-extensions .ditty-extension__header__icon i {
693
  font-size: 260px;
694
  color: #FFF;
695
+ -webkit-transform: scale(0.8) rotate(-25deg);
696
+ transform: scale(0.8) rotate(-25deg);
697
+ transition: -webkit-transform .5s ease;
698
+ transition: transform .5s ease;
699
+ transition: transform .5s ease, -webkit-transform .5s ease; }
700
  #ditty-extensions .ditty-extension__header__overlay {
701
  position: absolute;
702
  top: 0;
728
  border: 4px solid #FFF;
729
  box-sizing: content-box;
730
  opacity: 0;
731
+ -webkit-transform: translateX(-50px);
732
+ transform: translateX(-50px);
733
+ transition: opacity .25s ease, -webkit-transform .5s ease;
734
  transition: transform .5s ease, opacity .25s ease;
735
+ transition: transform .5s ease, opacity .25s ease, -webkit-transform .5s ease;
736
  transition-delay: .25s;
737
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); }
738
  #ditty-extensions .ditty-extension__icon img {
758
  border-radius: 50%;
759
  border: 4px solid #FFF;
760
  box-sizing: content-box;
761
+ transition: border-width .75s ease, -webkit-transform .75s ease;
762
  transition: transform .75s ease, border-width .75s ease;
763
+ transition: transform .75s ease, border-width .75s ease, -webkit-transform .75s ease;
764
  transition-delay: .75s; }
765
  #ditty-extensions .ditty-extension__title {
766
  position: relative;
923
  #ditty-extensions .ditty-extension--init .ditty-extension__header__overlay {
924
  background: rgba(35, 40, 46, 0.5); }
925
  #ditty-extensions .ditty-extension--init .ditty-extension__header__icon i {
926
+ -webkit-transform: scale(1) rotate(0);
927
+ transform: scale(1) rotate(0); }
928
  #ditty-extensions .ditty-extension--init .ditty-extension__icon {
929
  opacity: 1;
930
+ -webkit-transform: translateX(0);
931
+ transform: translateX(0); }
932
  #ditty-extensions .ditty-extension--init .ditty-extension__icon__small {
933
  border-width: 10px;
934
+ -webkit-transform: scale(0.3) translate(-120px, -120px);
935
+ transform: scale(0.3) translate(-120px, -120px); }
936
  #ditty-extensions .ditty-extension--init .ditty-extension__title {
937
  opacity: 1; }
938
 
1008
  #ditty-extensions-app .ditty-extension__header__icon i {
1009
  font-size: 260px;
1010
  color: #FFF;
1011
+ -webkit-transform: scale(0.8) rotate(-25deg);
1012
+ transform: scale(0.8) rotate(-25deg);
1013
+ transition: -webkit-transform .5s ease;
1014
+ transition: transform .5s ease;
1015
+ transition: transform .5s ease, -webkit-transform .5s ease; }
1016
  #ditty-extensions-app .ditty-extension__header__overlay {
1017
  position: absolute;
1018
  top: 0;
1041
  border: 4px solid #FFF;
1042
  box-sizing: content-box;
1043
  opacity: 0;
1044
+ -webkit-transform: translateX(-50px);
1045
+ transform: translateX(-50px);
1046
+ transition: opacity .25s ease, -webkit-transform .5s ease;
1047
  transition: transform .5s ease, opacity .25s ease;
1048
+ transition: transform .5s ease, opacity .25s ease, -webkit-transform .5s ease;
1049
  transition-delay: .25s;
1050
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); }
1051
  #ditty-extensions-app .ditty-extension__icon img {
1069
  border-radius: 50%;
1070
  border: 4px solid #FFF;
1071
  box-sizing: content-box;
1072
+ transition: border-width .75s ease, -webkit-transform .75s ease;
1073
  transition: transform .75s ease, border-width .75s ease;
1074
+ transition: transform .75s ease, border-width .75s ease, -webkit-transform .75s ease;
1075
  transition-delay: .75s; }
1076
  #ditty-extensions-app .ditty-extension__title {
1077
  position: relative;
1228
  #ditty-extensions-app .ditty-extension--init .ditty-extension__header__overlay {
1229
  background: rgba(35, 40, 46, 0.5); }
1230
  #ditty-extensions-app .ditty-extension--init .ditty-extension__header__icon i {
1231
+ -webkit-transform: scale(1) rotate(0);
1232
+ transform: scale(1) rotate(0); }
1233
  #ditty-extensions-app .ditty-extension--init .ditty-extension__icon {
1234
  opacity: 1;
1235
+ -webkit-transform: translateX(0);
1236
+ transform: translateX(0); }
1237
  #ditty-extensions-app .ditty-extension--init .ditty-extension__icon__small {
1238
  border-width: 10px;
1239
+ -webkit-transform: scale(0.3) translate(-120px, -120px);
1240
+ transform: scale(0.3) translate(-120px, -120px); }
1241
  #ditty-extensions-app .ditty-extension--init .ditty-extension__title {
1242
  opacity: 1; }
1243
 
1377
 
1378
  #ditty-page {
1379
  width: 1200px;
1380
+ max-width: calc( 100%);
1381
  border-radius: 5px;
1382
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
1383
  margin-top: 22px;
1407
 
1408
  @media screen and (max-width: 782px) {
1409
  #ditty-page {
1410
+ max-width: calc( 100%);
1411
  margin-top: 10px; } }
1412
 
1413
  #ditty-settings {
includes/js/ditty-admin.js CHANGED
@@ -17,6 +17,20 @@ jQuery( document ).ready( function( $ ) {
17
  $( '#poststuff' ).trigger( 'ditty_init_fields' );
18
  $( '#ditty-settings' ).ditty_settings();
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }() );
21
 
22
  } );
17
  $( '#poststuff' ).trigger( 'ditty_init_fields' );
18
  $( '#ditty-settings' ).ditty_settings();
19
 
20
+ // Notice close
21
+ $( '.ditty-dashboard-notice' ).on( 'click', '.notice-dismiss', function() {
22
+ var $notice = $( this ).parents( '.ditty-dashboard-notice' ),
23
+ notice_id = $notice.data( 'notice_id' );
24
+
25
+ var data = {
26
+ action : 'ditty_notice_close',
27
+ notice_id : notice_id,
28
+ security : dittyAdminVars.security
29
+ };
30
+ $.post( dittyAdminVars.ajaxurl, data );
31
+
32
+ } );
33
+
34
  }() );
35
 
36
  } );
includes/js/ditty-admin.min.js CHANGED
@@ -17,6 +17,20 @@ jQuery( document ).ready( function( $ ) {
17
  $( '#poststuff' ).trigger( 'ditty_init_fields' );
18
  $( '#ditty-settings' ).ditty_settings();
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }() );
21
 
22
  } );
17
  $( '#poststuff' ).trigger( 'ditty_init_fields' );
18
  $( '#ditty-settings' ).ditty_settings();
19
 
20
+ // Notice close
21
+ $( '.ditty-dashboard-notice' ).on( 'click', '.notice-dismiss', function() {
22
+ var $notice = $( this ).parents( '.ditty-dashboard-notice' ),
23
+ notice_id = $notice.data( 'notice_id' );
24
+
25
+ var data = {
26
+ action : 'ditty_notice_close',
27
+ notice_id : notice_id,
28
+ security : dittyAdminVars.security
29
+ };
30
+ $.post( dittyAdminVars.ajaxurl, data );
31
+
32
+ } );
33
+
34
  }() );
35
 
36
  } );
includes/js/ditty.min.js CHANGED
@@ -307,12 +307,15 @@ function dittyDisplayCss( displayCss, displayId ) {
307
  function dittyUpdateItems( itemSwaps ) {
308
  var animationSpeed = 500;
309
 
 
 
310
  jQuery.each( itemSwaps, function( index, data ) {
311
  var $current = data.currentItem,
312
  $new = data.newItem;
313
 
314
  $current.wrap( '<div class="ditty-update-wrapper"></div>' );
315
- var $updateWrapper = $current.parent();
 
316
 
317
  $updateWrapper.stop().css( {
318
  height: $current.outerHeight()
@@ -346,13 +349,7 @@ function dittyUpdateItems( itemSwaps ) {
346
  $updateWrapper.removeAttr( 'style' );
347
  $current.unwrap();
348
  $current.remove();
349
- $new.removeAttr( 'style' );
350
- // $new.css( {
351
- // position: 'relative',
352
- // top: 'auto',
353
- // left: 'auto',
354
- // width: 'auto'
355
- // } );
356
  if ( $new.hasClass( 'ditty-temp-item' ) ) {
357
  $new.remove();
358
  }
307
  function dittyUpdateItems( itemSwaps ) {
308
  var animationSpeed = 500;
309
 
310
+ console.log( 'itemSwaps:', itemSwaps );
311
+
312
  jQuery.each( itemSwaps, function( index, data ) {
313
  var $current = data.currentItem,
314
  $new = data.newItem;
315
 
316
  $current.wrap( '<div class="ditty-update-wrapper"></div>' );
317
+ var $updateWrapper = $current.parent(),
318
+ newStyle = $new.attr( 'style' );
319
 
320
  $updateWrapper.stop().css( {
321
  height: $current.outerHeight()
349
  $updateWrapper.removeAttr( 'style' );
350
  $current.unwrap();
351
  $current.remove();
352
+ $new.attr( 'style', newStyle );
 
 
 
 
 
 
353
  if ( $new.hasClass( 'ditty-temp-item' ) ) {
354
  $new.remove();
355
  }
includes/js/partials/helpers.js CHANGED
@@ -39,12 +39,15 @@ function dittyDisplayCss( displayCss, displayId ) {
39
  function dittyUpdateItems( itemSwaps ) {
40
  var animationSpeed = 500;
41
 
 
 
42
  jQuery.each( itemSwaps, function( index, data ) {
43
  var $current = data.currentItem,
44
  $new = data.newItem;
45
 
46
  $current.wrap( '<div class="ditty-update-wrapper"></div>' );
47
- var $updateWrapper = $current.parent();
 
48
 
49
  $updateWrapper.stop().css( {
50
  height: $current.outerHeight()
@@ -78,13 +81,7 @@ function dittyUpdateItems( itemSwaps ) {
78
  $updateWrapper.removeAttr( 'style' );
79
  $current.unwrap();
80
  $current.remove();
81
- $new.removeAttr( 'style' );
82
- // $new.css( {
83
- // position: 'relative',
84
- // top: 'auto',
85
- // left: 'auto',
86
- // width: 'auto'
87
- // } );
88
  if ( $new.hasClass( 'ditty-temp-item' ) ) {
89
  $new.remove();
90
  }
39
  function dittyUpdateItems( itemSwaps ) {
40
  var animationSpeed = 500;
41
 
42
+ console.log( 'itemSwaps:', itemSwaps );
43
+
44
  jQuery.each( itemSwaps, function( index, data ) {
45
  var $current = data.currentItem,
46
  $new = data.newItem;
47
 
48
  $current.wrap( '<div class="ditty-update-wrapper"></div>' );
49
+ var $updateWrapper = $current.parent(),
50
+ newStyle = $new.attr( 'style' );
51
 
52
  $updateWrapper.stop().css( {
53
  height: $current.outerHeight()
81
  $updateWrapper.removeAttr( 'style' );
82
  $current.unwrap();
83
  $current.remove();
84
+ $new.attr( 'style', newStyle );
 
 
 
 
 
 
85
  if ( $new.hasClass( 'ditty-temp-item' ) ) {
86
  $new.remove();
87
  }
includes/sass/admin/_dashboard.scss CHANGED
@@ -1,7 +1,4 @@
1
- .wp-admin.post-type-ditty {
2
- .wrap {
3
- margin-right: 2px;
4
- }
5
  #poststuff {
6
  min-width: inherit;
7
  }
@@ -70,3 +67,31 @@ table.wp-list-table .type-ditty_display .row-actions {
70
  padding-bottom: 8px;
71
  margin-bottom: -8px;
72
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wp-admin.post-php.post-type-ditty {
 
 
 
2
  #poststuff {
3
  min-width: inherit;
4
  }
67
  padding-bottom: 8px;
68
  margin-bottom: -8px;
69
  }
70
+
71
+ .ditty-dashboard-notice {
72
+ &.notice-info {
73
+ border-left-color: $green;
74
+ }
75
+ .ditty-features-list {
76
+ display: flex;
77
+ flex-direction: row;
78
+ align-items: center;
79
+ justify-content: flex-start;
80
+ flex-wrap: wrap;
81
+ li {
82
+ display: flex;
83
+ flex-direction: row;
84
+ align-items: center;
85
+ justify-content: flex-start;
86
+ color: #FFF;
87
+ background: $green;
88
+ border-radius: 3px;
89
+ padding: 5px 10px;
90
+ margin: 0 5px 5px 0;
91
+ i {
92
+ margin-right: 5px;
93
+ }
94
+ }
95
+ }
96
+ }
97
+
includes/sass/admin/_settings.scss CHANGED
@@ -1,6 +1,6 @@
1
  #ditty-page {
2
  width: 1200px;
3
- max-width: calc( 100% - 22px );
4
  border-radius: 5px;
5
  box-shadow: 0 0 1px rgba( 0, 0, 0, 0.2 );
6
  margin-top: 22px;
@@ -43,7 +43,7 @@
43
  }
44
  @media screen and ( max-width: 782px ) {
45
  #ditty-page {
46
- max-width: calc( 100% - 10px );
47
  margin-top: 10px;
48
  }
49
  }
1
  #ditty-page {
2
  width: 1200px;
3
+ max-width: calc( 100% );
4
  border-radius: 5px;
5
  box-shadow: 0 0 1px rgba( 0, 0, 0, 0.2 );
6
  margin-top: 22px;
43
  }
44
  @media screen and ( max-width: 782px ) {
45
  #ditty-page {
46
+ max-width: calc( 100% );
47
  margin-top: 10px;
48
  }
49
  }
includes/upgrades.php CHANGED
@@ -10,13 +10,15 @@ function ditty_updates() {
10
  if ( wp_doing_ajax() ) {
11
  return false;
12
  }
13
-
14
  $current_version = get_option( 'ditty_plugin_version', '0' );
15
 
16
  if ( version_compare( $current_version, '3.0', '<' ) ) {
17
  ditty_v3_upgrades();
18
  }
19
-
 
 
 
20
  if ( DITTY_VERSION != $current_version ) {
21
  update_option( 'ditty_plugin_version_upgraded_from', $current_version );
22
  update_option( 'ditty_plugin_version', DITTY_VERSION );
@@ -121,4 +123,22 @@ function ditty_v3_upgrades() {
121
  if ( is_array( $news_tickers ) && count( $news_tickers ) > 0 ) {
122
  ditty_settings( 'ditty_news_ticker', '1' );
123
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  }
10
  if ( wp_doing_ajax() ) {
11
  return false;
12
  }
 
13
  $current_version = get_option( 'ditty_plugin_version', '0' );
14
 
15
  if ( version_compare( $current_version, '3.0', '<' ) ) {
16
  ditty_v3_upgrades();
17
  }
18
+ if ( version_compare( $current_version, '3.0.6', '<' ) ) {
19
+ ditty_v3_0_6_upgrades();
20
+ }
21
+
22
  if ( DITTY_VERSION != $current_version ) {
23
  update_option( 'ditty_plugin_version_upgraded_from', $current_version );
24
  update_option( 'ditty_plugin_version', DITTY_VERSION );
123
  if ( is_array( $news_tickers ) && count( $news_tickers ) > 0 ) {
124
  ditty_settings( 'ditty_news_ticker', '1' );
125
  }
126
+ }
127
+
128
+ /**
129
+ * Version 3.0.6 Updates
130
+ *
131
+ * @since 3.0.6
132
+ * @return void
133
+ */
134
+ function ditty_v3_0_6_upgrades() {
135
+ $ditty_notices = get_option( 'ditty_notices', array() );
136
+ $args = array(
137
+ 'post_type' => 'ditty_news_ticker',
138
+ );
139
+ $news_tickers = get_posts( $args );
140
+ if ( is_array( $news_tickers ) && count( $news_tickers ) > 0 ) {
141
+ $ditty_notices['v3_0_6'] = 'v3_0_6';
142
+ update_option( 'ditty_notices', $ditty_notices );
143
+ }
144
  }
legacy/inc/static/js/ditty-news-ticker.js CHANGED
@@ -1450,8 +1450,12 @@
1450
  /* !Listen for resize event from other plugins - 1.4.1 */
1451
  /* --------------------------------------------------------- */
1452
 
1453
- $container.on('mtphr_dnt_resize_single', function() {
 
1454
  if( settings.type === 'scroll' ) {
 
 
 
1455
  mtphr_dnt_scroll_resize_ticks();
1456
  } else if( settings.type === 'rotate' ) {
1457
  mtphr_dnt_rotator_resize_ticks();
1450
  /* !Listen for resize event from other plugins - 1.4.1 */
1451
  /* --------------------------------------------------------- */
1452
 
1453
+ $container.on('mtphr_dnt_resize_single', function( e, reset ) {
1454
+ ticker_width = $ticker.outerWidth(true);
1455
  if( settings.type === 'scroll' ) {
1456
+ if ( reset ) {
1457
+ mtphr_dnt_scroll_reset_ticks();
1458
+ }
1459
  mtphr_dnt_scroll_resize_ticks();
1460
  } else if( settings.type === 'rotate' ) {
1461
  mtphr_dnt_rotator_resize_ticks();
legacy/inc/static/js/ditty-news-ticker.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={init:function(e){return this.each((function(){function i(){P.tick_count=S.find(".mtphr-dnt-tick").length,P.tick_count>0&&("scroll"===N.type?r():"rotate"===N.type&&m()),N.after_load.call(R,S),R.trigger("mtphr_dnt_after_load_single",[P,it]),t("body").trigger("mtphr_dnt_after_load",[R,P,it])}function n(){S.find(".mtphr-dnt-tick").each((function(){t(this).height()>et&&(et=t(this).height()),"up"!==N.scroll_direction&&"down"!==N.scroll_direction||t(this).css("height","auto")})),S.css("height",et+"px")}function r(){var e=S.find(".mtphr-dnt-tick:first");if(e.attr("style")){var i,r=e.attr("style").split("width:");rt=!(r.length>1)}it=[],S.find("img").length?S.imagesLoaded((function(){n(),S.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];it.push(e)})),g(),o()})):(n(),S.find(".mtphr-dnt-tick").each((function(){t(this).show();var e=[{headline:t(this)}];it.push(e)})),g(),o()),S.on({mouseenter:function(){N.scroll_pause&&s()},mouseleave:function(){N.scroll_pause&&!P.paused&&a()}}),S.find("a").on("click",(function(){N.scroll_pause&&!P.paused&&a()}))}function s(){clearTimeout(ct),cancelAnimationFrame(nt)}function a(){o()}function o(){function t(){for(var e=0;e<P.tick_count;e++)if(!0===it[e][0].visible){var i="reset";"left"===N.scroll_direction||"right"===N.scroll_direction?("reset"===(i="left"===N.scroll_direction?c(e):p(e))?(i=it[e][0].reset,it[e][0].headline.css("opacity",0)):it[e][0].headline.css("opacity",1),it[e][0].headline.css({transform:"translateX( "+i+"px )"})):("reset"===(i="up"===N.scroll_direction?l(e):_(e))?(i=it[e][0].reset,it[e][0].headline.css("opacity",0)):it[e][0].headline.css("opacity",1),it[e][0].headline.css({transform:"translateY( "+i+"px )"})),it[e][0].position=i}N.scroll_init&&pt?(pt=!1,ct=setTimeout((function(){nt=requestAnimationFrame(t)}),1e3*N.scroll_init_delay)):(pt=!1,nt=requestAnimationFrame(t))}clearTimeout(ct),cancelAnimationFrame(nt),nt=requestAnimationFrame(t)}function c(t){var e=parseFloat(it[t][0].position-N.scroll_speed*lt);return e<-(it[t][0].headline.width()+N.offset)?e=u(t):e<parseFloat(tt-it[t][0].headline.width()-N.scroll_spacing)&&d(t),e}function p(t){var e=parseFloat(it[t][0].position+N.scroll_speed*lt);return e>tt+N.offset?e=u(t):e>N.scroll_spacing&&d(t),e}function l(t){var e=parseFloat(it[t][0].position-N.scroll_speed*lt);return e<-(it[t][0].headline.height()+N.offset)?e=u(t):e<et-it[t][0].headline.height()-N.scroll_spacing&&d(t),e}function _(t){var e=parseFloat(it[t][0].position+N.scroll_speed*lt);return e>et+N.offset?e=u(t):e>N.scroll_spacing&&d(t),e}function u(e){return P.tick_count>1&&(it[e][0].visible=!1),P.tick_count===e+1&&(R.trigger("mtphr_dnt_scroll_complete",[P,it]),t("body").trigger("mtphr_dnt_scroll_complete",[R,P,it])),"reset"}function f(t){!1===it[t][0].visible&&(P.previous_tick=parseInt(t-1),P.previous_tick<0&&(P.previous_tick=parseInt(P.tick_count-1)),P.current_tick=t,P.next_tick=parseInt(t+1),P.next_tick>=P.tick_count&&(P.next_tick=0))}function d(t){t===P.tick_count-1?N.scroll_loop&&(f(0),it[0][0].visible=!0):(f(parseInt(t+1)),it[t+1][0].visible=!0)}function h(){for(var t=0;t<P.tick_count;t++){var e,i=it[t][0].headline;switch(N.scroll_direction){case"left":e=tt+N.offset,!1===it[t][0].visible&&i.css("transform","translateX( "+e+"px )");break;case"right":e=parseInt("-"+(i.width()+N.offset)),!1===it[t][0].visible&&i.css("transform","translateX( "+e+"px )");break;case"up":rt&&i.css("width",tt),e=parseInt(et+N.offset),!1===it[t][0].visible&&i.css("transform","translateY( "+e+"px )");break;case"down":rt&&i.css("width",tt),e=parseInt("-"+(i.height()+N.offset)),!1===it[t][0].visible&&i.css("transform","translateY( "+e+"px )");break}it[t][0].width=i.width(),it[t][0].height=i.height(),!1===it[t][0].visible&&(it[t][0].position=e),it[t][0].reset=e}}function g(){for(var t,e,i=0;i<P.tick_count;i++)if(it[i]){switch(e=it[i][0].headline,N.scroll_direction){case"left":t=tt+N.offset,e.css("transform","translateX( "+t+"px )");break;case"right":t=parseInt("-"+(e.width()+N.offset)),e.css("transform","translateX( "+t+"px )");break;case"up":rt&&e.css("width",tt),t=parseInt(et+N.offset),e.css("transform","translateY( "+t+"px )");break;case"down":rt&&e.css("width",tt),t=parseInt("-"+(e.height()+N.offset)),e.css("transform","translateY( "+t+"px )");break}it[i][0].width=e.width(),it[i][0].height=e.height(),it[i][0].position=t,it[i][0].reset=t,it[i][0].visible=!1,e=it[i][0].headline}if(P.current_tick=0,it[P.current_tick][0].visible=!0,N.scroll_init)for("left"===N.scroll_direction?t=0:"right"===N.scroll_direction?t=tt:"up"===N.scroll_direction?t=0:"down"===N.scroll_direction&&(t=et),i=0;i<P.tick_count;i++)switch(e=it[i][0].headline,N.scroll_direction){case"left":t<tt&&(e.css("transform","translateX( "+t+"px )"),it[i][0].position=t,it[i][0].visible=!0,t=t+it[i][0].width+N.scroll_spacing);break;case"right":t>0&&(t-=it[i][0].width,e.css("transform","translateX( "+t+"px )"),it[i][0].position=t,it[i][0].visible=!0,t-=N.scroll_spacing);break;case"up":t<et&&(e.css("transform","translateY( "+t+"px )"),it[i][0].position=t,it[i][0].visible=!0,t=t+it[i][0].height+N.scroll_spacing);break;case"down":t>0&&(e.css("transform","translateY( "+t+"px )"),e.stop(!0,!0).css("top",t+"px"),it[i][0].position=t,it[i][0].visible=!0,t-=N.scroll_spacing);break}}function k(){y()}function v(){clearInterval(st)}function m(){switch(S.find(".mtphr-dnt-tick").each((function(){it.push(t(this)),t(this).imagesLoaded((function(){F()}))})),F(),S.find(".mtphr-dnt-tick").show(),N.rotate_type){case"fade":T(S,it,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":Y(S,it,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":E(S,it,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":q(S,it,parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":O(S,it,parseInt(100*N.rotate_speed),N.rotate_ease);break}w(0),N.auto_rotate&&k(),S.on({mouseenter:function(){N.auto_rotate&&N.rotate_pause&&!P.running&&v()},mouseleave:function(){N.auto_rotate&&N.rotate_pause&&!P.running&&!P.paused&&k()}}),S.find("a").on("click",(function(){N.auto_rotate&&N.rotate_pause&&!P.running&&!P.paused&&k()}))}function y(){v(),st=setInterval((function(){var t=parseInt(P.current_tick+1);t===P.tick_count&&(t=0),b(t)}),parseInt(1e3*N.rotate_delay))}function b(e){P.current_tick!==e&&(N.auto_rotate&&v(),P.next_tick=e,N.before_change.call(R,S),R.trigger("mtphr_dnt_before_change_single",[P,it]),t("body").trigger("mtphr_dnt_before_change",[R,P,it]),P.running=1,I(e),x(e),P.previous_tick=P.current_tick,P.current_tick=e,ot=setTimeout((function(){N.after_change.call(R,S),R.trigger("mtphr_dnt_after_change_single",[P,it]),t("body").trigger("mtphr_dnt_after_change",[R,P,it]),at=N.rotate_type,P.reverse=0,P.running=0,N.auto_rotate&&!P.paused&&y()}),parseInt(100*N.rotate_speed)))}function w(t){Z&&(Z.children("a").removeClass("active"),Z.children('a[href="'+t+'"]').addClass("active"))}function x(e){switch(w(e),at){case"fade":A(S,t(it[e]),t(it[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":C(S,t(it[e]),t(it[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":L(S,t(it[e]),t(it[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":z(S,t(it[e]),t(it[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":M(S,t(it[e]),t(it[P.current_tick]),parseInt(100*N.rotate_speed),N.rotate_ease);break}}function I(e){switch(at){case"fade":X(S,t(it[P.current_tick]),t(it[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_left":D(S,t(it[P.current_tick]),t(it[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_right":W(S,t(it[P.current_tick]),t(it[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_down":j(S,t(it[P.current_tick]),t(it[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break;case"slide_up":Q(S,t(it[P.current_tick]),t(it[e]),parseInt(100*N.rotate_speed),N.rotate_ease);break}}function F(){for(var e=0;e<P.tick_count;e++)t(it[e]).width(tt+"px"),P.current_tick!==e&&t(it[e]).css({left:parseFloat(tt+N.offset)+"px"});var i=t(it[P.current_tick]).height();S.stop().css("height",i+"px")}function T(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,left:"auto"})}function A(t,e,i,n,r){e.css({opacity:0,left:"auto"}),e.stop().animate({opacity:1},n,r);var s=e.height();t.stop().animate({height:s+"px"},n,r)}function X(e,i,n,r,s){i.stop().animate({opacity:0},r,s,(function(){t(this).css({left:parseFloat(tt+N.offset)+"px"}),i.remove(),e.append(i)}))}function Y(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,left:0})}function C(t,e,i,n,r){var s=e.height();e.css({opacity:1,left:parseFloat(tt+N.offset)+"px"}),t.stop().animate({height:s+"px"},n,r,(function(){})),e.stop().animate({left:"0"},n,r,(function(){}))}function D(t,e,i,n,r){e.stop().animate({left:"-"+parseFloat(tt+N.offset)+"px"},n,r,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function E(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,left:0})}function L(t,e,i,n,r){var s=e.height();e.css({opacity:1,left:"-"+parseFloat(tt+N.offset)+"px"}),t.stop().animate({height:s+"px"},n,r,(function(){})),e.stop().animate({left:"0"},n,r)}function W(t,e,i,n,r){e.stop().animate({left:parseFloat(tt+N.offset)+"px"},n,r,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function q(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,top:0,left:"auto"})}function z(t,e,i,n,r){var s=e.height();e.css({opacity:1,top:"-"+parseFloat(s+N.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},n,r),e.stop().animate({top:"0"},n,r)}function j(t,e,i,n,r){var s=i.height();e.stop().animate({top:parseFloat(s+N.offset)+"px"},n,r,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function O(t,e){var i=e[0],n=i.height();t.css({height:n+"px",left:"auto"}),i.css({opacity:1,top:0})}function M(t,e,i,n,r){var s=e.height();e.css({opacity:1,top:parseFloat(i.height()+N.offset)+"px",left:"auto"}),t.stop().animate({height:s+"px"},n,r),e.stop().animate({top:"0"},n,r)}function Q(t,e,i,n,r){var s=e.height();e.stop().animate({top:"-"+parseFloat(s+N.offset)+"px"},n,r,(function(){e.css({opacity:0}),e.remove(),t.append(e)}))}function B(){if(P.running)return!1;var t=parseInt(P.current_tick+1);t===P.tick_count&&(t=0),b(t)}function G(){if(P.running)return!1;var t=parseInt(P.current_tick-1);t<0&&(t=P.tick_count-1),N.nav_reverse&&("slide_left"===N.rotate_type?at="slide_right":"slide_right"===N.rotate_type?at="slide_left":"slide_down"===N.rotate_type?at="slide_up":"slide_up"===N.rotate_type&&(at="slide_down"),P.reverse=1),b(t)}function H(t){t?(P.paused=!1,$.removeClass("paused"),"scroll"===N.type?a():k()):(P.paused=!0,$.addClass("paused"),"scroll"===N.type?s():v()),R.trigger("mtphr_dnt_play_pause",[P,it])}function J(){if(P.running)return!1;var t=parseInt(P.current_tick+1);t===P.tick_count&&(t=0),"slide_left"!==N.rotate_type&&"slide_right"!==N.rotate_type||(at="slide_left"),b(t)}function K(){if(P.running)return!1;var t=parseInt(P.current_tick-1);t<0&&(t=P.tick_count-1),"slide_left"!==N.rotate_type&&"slide_right"!==N.rotate_type||(at="slide_right"),N.nav_reverse&&("slide_down"===N.rotate_type?at="slide_up":"slide_up"===N.rotate_type&&(at="slide_down"),P.reverse=1),b(t)}var N={id:"",type:"scroll",scroll_direction:"left",scroll_speed:10,scroll_pause:0,scroll_spacing:40,scroll_units:10,scroll_init:0,scroll_init_delay:2,scroll_loop:1,rotate_type:"fade",auto_rotate:0,rotate_delay:10,rotate_pause:0,rotate_speed:10,rotate_ease:"easeOutExpo",nav_reverse:0,disable_touchswipe:0,offset:20,before_change:function(){},after_change:function(){},after_load:function(){}},P={id:N.id,tick_count:0,previous_tick:0,current_tick:0,next_tick:0,reverse:0,running:0,paused:0};e&&t.extend(N,e);var R=t(this),S=R.find(".mtphr-dnt-tick-contents"),U=R.find(".mtphr-dnt-nav-prev"),V=R.find(".mtphr-dnt-nav-next"),Z=R.find(".mtphr-dnt-control-links"),$=R.find(".mtphr-dnt-play-pause"),tt=S.outerWidth(!0),et=0,it=[],nt,rt=!0,st,at=N.rotate_type,ot,ct,pt=!0,lt=.13;if(S.data("ditty:vars",P),U&&"rotate"===N.type&&(U.on("click",(function(t){t.preventDefault(),G()})),V.on("click",(function(t){t.preventDefault(),B()}))),Z&&"rotate"===N.type&&Z.children("a").on("click",(function(e){e.preventDefault();var i=parseInt(t(this).attr("href"));if(P.running)return!1;if(i===P.current_tick)return!1;var n=i<P.current_tick?1:0;N.nav_reverse&&n&&("slide_left"===N.rotate_type?at="slide_right":"slide_right"===N.rotate_type?at="slide_left":"slide_down"===N.rotate_type?at="slide_up":"slide_up"===N.rotate_type&&(at="slide_down"),P.reverse=1),b(i)})),$.on("click",(function(t){t.preventDefault(),H(P.paused)})),"rotate"!==N.type||N.disable_touchswipe||(S[0].addEventListener("swiped-left",(function(){J()})),S[0].addEventListener("swiped-right",(function(){K()}))),R.on("mtphr_dnt_next",(function(){B()})),R.on("mtphr_dnt_prev",(function(){G()})),R.on("mtphr_dnt_goto",(function(t,e){b(parseInt(e))})),R.on("mtphr_dnt_pause",(function(){H()})),R.on("mtphr_dnt_play",(function(){H(!0)})),t(window).on("resize",(function(){S.outerWidth()!==tt&&(tt=S.outerWidth(!0),"scroll"===N.type?("up"===N.scroll_direction||"down"===N.scroll_direction)&&rt?g():h():"rotate"===N.type&&F())})),R.on("mtphr_dnt_resize_single",(function(){"scroll"===N.type?h():"rotate"===N.type&&F()})),t("body").on("mtphr_dnt_resize",(function(t,e){e&&e.indexOf(N.id)>=0&&("scroll"===N.type?h():"rotate"===N.type&&F())})),R.on("mtphr_dnt_replace_ticks",(function(e,n,r){clearTimeout(ct),cancelAnimationFrame(nt),R.find(".mtphr-dnt-tick").remove(),n.each((function(){S.append(t(this))})),setTimeout((function(){i()}),r)})),0===R.width()){var _t=!0;setTimeout((function t(){R.width()>10&&(_t=!1,tt=S.outerWidth(!0),i()),_t&&setTimeout(t,100)}),100)}else i()}))}};t.fn.ditty_news_ticker=function(t){if(e[t])return e[t].apply(this,Array.prototype.slice.call(arguments,1));if("object"!=typeof t&&t)throw new Error("Method "+t+" does not exist in ditty_news_ticker");return e.init.apply(this,arguments)}}(jQuery);
1
+ !function($){var t={init:function(t){return this.each((function(){var e={id:"",type:"scroll",scroll_direction:"left",scroll_speed:10,scroll_pause:0,scroll_spacing:40,scroll_units:10,scroll_init:0,scroll_init_delay:2,scroll_loop:1,rotate_type:"fade",auto_rotate:0,rotate_delay:10,rotate_pause:0,rotate_speed:10,rotate_ease:"easeOutExpo",nav_reverse:0,disable_touchswipe:0,offset:20,before_change:function(){},after_change:function(){},after_load:function(){}},i={id:e.id,tick_count:0,previous_tick:0,current_tick:0,next_tick:0,reverse:0,running:0,paused:0};t&&$.extend(e,t);var n,r,s,a=$(this),o=a.find(".mtphr-dnt-tick-contents"),c=a.find(".mtphr-dnt-nav-prev"),p=a.find(".mtphr-dnt-nav-next"),l=a.find(".mtphr-dnt-control-links"),_=a.find(".mtphr-dnt-play-pause"),u=o.outerWidth(!0),f=0,d=[],h=!0,g=e.rotate_type,v=!0,m=.13;function k(){i.tick_count=o.find(".mtphr-dnt-tick").length,i.tick_count>0&&("scroll"===e.type?function(){var t=o.find(".mtphr-dnt-tick:first");if(t.attr("style")){var n=t.attr("style").split("width:");h=!(n.length>1)}d=[],o.find("img").length?o.imagesLoaded((function(){y(),o.find(".mtphr-dnt-tick").each((function(){$(this).show();var t=[{headline:$(this)}];d.push(t)})),D(),x()})):(y(),o.find(".mtphr-dnt-tick").each((function(){$(this).show();var t=[{headline:$(this)}];d.push(t)})),D(),x());o.on({mouseenter:function(){e.scroll_pause&&w()},mouseleave:function(){e.scroll_pause&&!i.paused&&b()}}),o.find("a").on("click",(function(){e.scroll_pause&&!i.paused&&b()}))}():"rotate"===e.type&&function(){switch(o.find(".mtphr-dnt-tick").each((function(){d.push($(this)),$(this).imagesLoaded((function(){O()}))})),O(),o.find(".mtphr-dnt-tick").show(),e.rotate_type){case"fade":!function(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,left:"auto"})}(o,d,parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_left":!function(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,left:0})}(o,d,parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_right":!function(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,left:0})}(o,d,parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_down":!function(t,e){var i=e[0],n=i.height();t.css("height",n+"px"),i.css({opacity:1,top:0,left:"auto"})}(o,d,parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_up":!function(t,e){var i=e[0],n=i.height();t.css({height:n+"px",left:"auto"}),i.css({opacity:1,top:0})}(o,d,parseInt(100*e.rotate_speed),e.rotate_ease)}j(0),e.auto_rotate&&E();o.on({mouseenter:function(){e.auto_rotate&&e.rotate_pause&&!i.running&&L()},mouseleave:function(){e.auto_rotate&&e.rotate_pause&&!i.running&&!i.paused&&E()}}),o.find("a").on("click",(function(){e.auto_rotate&&e.rotate_pause&&!i.running&&!i.paused&&E()}))}()),e.after_load.call(a,o),a.trigger("mtphr_dnt_after_load_single",[i,d]),$("body").trigger("mtphr_dnt_after_load",[a,i,d])}function y(){o.find(".mtphr-dnt-tick").each((function(){$(this).height()>f&&(f=$(this).height()),"up"!==e.scroll_direction&&"down"!==e.scroll_direction||$(this).css("height","auto")})),o.css("height",f+"px")}function w(){clearTimeout(s),cancelAnimationFrame(n)}function b(){x()}function x(){clearTimeout(s),cancelAnimationFrame(n),n=requestAnimationFrame((function t(){for(var r=0;r<i.tick_count;r++)if(!0===d[r][0].visible){var a="reset";"left"===e.scroll_direction||"right"===e.scroll_direction?("reset"===(a="left"===e.scroll_direction?I(r):F(r))?(a=d[r][0].reset,d[r][0].headline.css("opacity",0)):d[r][0].headline.css("opacity",1),d[r][0].headline.css({transform:"translateX( "+a+"px )"})):("reset"===(a="up"===e.scroll_direction?T(r):A(r))?(a=d[r][0].reset,d[r][0].headline.css("opacity",0)):d[r][0].headline.css("opacity",1),d[r][0].headline.css({transform:"translateY( "+a+"px )"})),d[r][0].position=a}e.scroll_init&&v?(v=!1,s=setTimeout((function(){n=requestAnimationFrame(t)}),1e3*e.scroll_init_delay)):(v=!1,n=requestAnimationFrame(t))}))}function I(t){var i=parseFloat(d[t][0].position-e.scroll_speed*m);return i<-(d[t][0].headline.width()+e.offset)?i=X(t):i<parseFloat(u-d[t][0].headline.width()-e.scroll_spacing)&&W(t),i}function F(t){var i=parseFloat(d[t][0].position+e.scroll_speed*m);return i>u+e.offset?i=X(t):i>e.scroll_spacing&&W(t),i}function T(t){var i=parseFloat(d[t][0].position-e.scroll_speed*m);return i<-(d[t][0].headline.height()+e.offset)?i=X(t):i<f-d[t][0].headline.height()-e.scroll_spacing&&W(t),i}function A(t){var i=parseFloat(d[t][0].position+e.scroll_speed*m);return i>f+e.offset?i=X(t):i>e.scroll_spacing&&W(t),i}function X(t){return i.tick_count>1&&(d[t][0].visible=!1),i.tick_count===t+1&&(a.trigger("mtphr_dnt_scroll_complete",[i,d]),$("body").trigger("mtphr_dnt_scroll_complete",[a,i,d])),"reset"}function Y(t){!1===d[t][0].visible&&(i.previous_tick=parseInt(t-1),i.previous_tick<0&&(i.previous_tick=parseInt(i.tick_count-1)),i.current_tick=t,i.next_tick=parseInt(t+1),i.next_tick>=i.tick_count&&(i.next_tick=0))}function W(t){t===i.tick_count-1?e.scroll_loop&&(Y(0),d[0][0].visible=!0):(Y(parseInt(t+1)),d[t+1][0].visible=!0)}function C(){for(var t=0;t<i.tick_count;t++){var n,r=d[t][0].headline;switch(e.scroll_direction){case"left":n=u+e.offset,!1===d[t][0].visible&&r.css("transform","translateX( "+n+"px )");break;case"right":n=parseInt("-"+(r.width()+e.offset)),!1===d[t][0].visible&&r.css("transform","translateX( "+n+"px )");break;case"up":h&&r.css("width",u),n=parseInt(f+e.offset),!1===d[t][0].visible&&r.css("transform","translateY( "+n+"px )");break;case"down":h&&r.css("width",u),n=parseInt("-"+(r.height()+e.offset)),!1===d[t][0].visible&&r.css("transform","translateY( "+n+"px )")}d[t][0].width=r.width(),d[t][0].height=r.height(),!1===d[t][0].visible&&(d[t][0].position=n),d[t][0].reset=n}}function D(){for(var t,n,r=0;r<i.tick_count;r++)if(d[r]){switch(n=d[r][0].headline,e.scroll_direction){case"left":t=u+e.offset,n.css("transform","translateX( "+t+"px )");break;case"right":t=parseInt("-"+(n.width()+e.offset)),n.css("transform","translateX( "+t+"px )");break;case"up":h&&n.css("width",u),t=parseInt(f+e.offset),n.css("transform","translateY( "+t+"px )");break;case"down":h&&n.css("width",u),t=parseInt("-"+(n.height()+e.offset)),n.css("transform","translateY( "+t+"px )")}d[r][0].width=n.width(),d[r][0].height=n.height(),d[r][0].position=t,d[r][0].reset=t,d[r][0].visible=!1,n=d[r][0].headline}if(i.current_tick=0,d[i.current_tick][0].visible=!0,e.scroll_init)for("left"===e.scroll_direction?t=0:"right"===e.scroll_direction?t=u:"up"===e.scroll_direction?t=0:"down"===e.scroll_direction&&(t=f),r=0;r<i.tick_count;r++)switch(n=d[r][0].headline,e.scroll_direction){case"left":t<u&&(n.css("transform","translateX( "+t+"px )"),d[r][0].position=t,d[r][0].visible=!0,t=t+d[r][0].width+e.scroll_spacing);break;case"right":t>0&&(t-=d[r][0].width,n.css("transform","translateX( "+t+"px )"),d[r][0].position=t,d[r][0].visible=!0,t-=e.scroll_spacing);break;case"up":t<f&&(n.css("transform","translateY( "+t+"px )"),d[r][0].position=t,d[r][0].visible=!0,t=t+d[r][0].height+e.scroll_spacing);break;case"down":t>0&&(n.css("transform","translateY( "+t+"px )"),n.stop(!0,!0).css("top",t+"px"),d[r][0].position=t,d[r][0].visible=!0,t-=e.scroll_spacing)}}function E(){q()}function L(){clearInterval(r)}function q(){L(),r=setInterval((function(){var t=parseInt(i.current_tick+1);t===i.tick_count&&(t=0),z(t)}),parseInt(1e3*e.rotate_delay))}function z(t){i.current_tick!==t&&(e.auto_rotate&&L(),i.next_tick=t,e.before_change.call(a,o),a.trigger("mtphr_dnt_before_change_single",[i,d]),$("body").trigger("mtphr_dnt_before_change",[a,i,d]),i.running=1,function(t){switch(g){case"fade":!function(t,i,n,r,s){i.stop().animate({opacity:0},r,s,(function(){$(this).css({left:parseFloat(u+e.offset)+"px"}),i.remove(),t.append(i)}))}(o,$(d[i.current_tick]),$(d[t]),parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_left":!function(t,i,n,r,s){i.stop().animate({left:"-"+parseFloat(u+e.offset)+"px"},r,s,(function(){i.css({opacity:0}),i.remove(),t.append(i)}))}(o,$(d[i.current_tick]),$(d[t]),parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_right":!function(t,i,n,r,s){i.stop().animate({left:parseFloat(u+e.offset)+"px"},r,s,(function(){i.css({opacity:0}),i.remove(),t.append(i)}))}(o,$(d[i.current_tick]),$(d[t]),parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_down":!function(t,i,n,r,s){var a=n.height();i.stop().animate({top:parseFloat(a+e.offset)+"px"},r,s,(function(){i.css({opacity:0}),i.remove(),t.append(i)}))}(o,$(d[i.current_tick]),$(d[t]),parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_up":!function(t,i,n,r,s){var a=i.height();i.stop().animate({top:"-"+parseFloat(a+e.offset)+"px"},r,s,(function(){i.css({opacity:0}),i.remove(),t.append(i)}))}(o,$(d[i.current_tick]),$(d[t]),parseInt(100*e.rotate_speed),e.rotate_ease)}}(t),function(t){switch(j(t),g){case"fade":!function(t,e,i,n,r){e.css({opacity:0,left:"auto"}),e.stop().animate({opacity:1},n,r);var s=e.height();t.stop().animate({height:s+"px"},n,r)}(o,$(d[t]),$(d[i.current_tick]),parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_left":!function(t,i,n,r,s){var a=i.height();i.css({opacity:1,left:parseFloat(u+e.offset)+"px"}),t.stop().animate({height:a+"px"},r,s,(function(){})),i.stop().animate({left:"0"},r,s,(function(){}))}(o,$(d[t]),$(d[i.current_tick]),parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_right":!function(t,i,n,r,s){var a=i.height();i.css({opacity:1,left:"-"+parseFloat(u+e.offset)+"px"}),t.stop().animate({height:a+"px"},r,s,(function(){})),i.stop().animate({left:"0"},r,s)}(o,$(d[t]),$(d[i.current_tick]),parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_down":!function(t,i,n,r,s){var a=i.height();i.css({opacity:1,top:"-"+parseFloat(a+e.offset)+"px",left:"auto"}),t.stop().animate({height:a+"px"},r,s),i.stop().animate({top:"0"},r,s)}(o,$(d[t]),$(d[i.current_tick]),parseInt(100*e.rotate_speed),e.rotate_ease);break;case"slide_up":!function(t,i,n,r,s){var a=i.height();i.css({opacity:1,top:parseFloat(n.height()+e.offset)+"px",left:"auto"}),t.stop().animate({height:a+"px"},r,s),i.stop().animate({top:"0"},r,s)}(o,$(d[t]),$(d[i.current_tick]),parseInt(100*e.rotate_speed),e.rotate_ease)}}(t),i.previous_tick=i.current_tick,i.current_tick=t,setTimeout((function(){e.after_change.call(a,o),a.trigger("mtphr_dnt_after_change_single",[i,d]),$("body").trigger("mtphr_dnt_after_change",[a,i,d]),g=e.rotate_type,i.reverse=0,i.running=0,e.auto_rotate&&!i.paused&&q()}),parseInt(100*e.rotate_speed)))}function j(t){l&&(l.children("a").removeClass("active"),l.children('a[href="'+t+'"]').addClass("active"))}function O(){for(var t=0;t<i.tick_count;t++)$(d[t]).width(u+"px"),i.current_tick!==t&&$(d[t]).css({left:parseFloat(u+e.offset)+"px"});var n=$(d[i.current_tick]).height();o.stop().css("height",n+"px")}function M(){if(i.running)return!1;var t=parseInt(i.current_tick+1);t===i.tick_count&&(t=0),z(t)}function Q(){if(i.running)return!1;var t=parseInt(i.current_tick-1);t<0&&(t=i.tick_count-1),e.nav_reverse&&("slide_left"===e.rotate_type?g="slide_right":"slide_right"===e.rotate_type?g="slide_left":"slide_down"===e.rotate_type?g="slide_up":"slide_up"===e.rotate_type&&(g="slide_down"),i.reverse=1),z(t)}function B(t){t?(i.paused=!1,_.removeClass("paused"),"scroll"===e.type?b():E()):(i.paused=!0,_.addClass("paused"),"scroll"===e.type?w():L()),a.trigger("mtphr_dnt_play_pause",[i,d])}if(o.data("ditty:vars",i),c&&"rotate"===e.type&&(c.on("click",(function(t){t.preventDefault(),Q()})),p.on("click",(function(t){t.preventDefault(),M()}))),l&&"rotate"===e.type&&l.children("a").on("click",(function(t){t.preventDefault();var n=parseInt($(this).attr("href"));if(i.running)return!1;if(n===i.current_tick)return!1;var r=n<i.current_tick?1:0;e.nav_reverse&&r&&("slide_left"===e.rotate_type?g="slide_right":"slide_right"===e.rotate_type?g="slide_left":"slide_down"===e.rotate_type?g="slide_up":"slide_up"===e.rotate_type&&(g="slide_down"),i.reverse=1),z(n)})),_.on("click",(function(t){t.preventDefault(),B(i.paused)})),"rotate"!==e.type||e.disable_touchswipe||(o[0].addEventListener("swiped-left",(function(){!function(){if(i.running)return!1;var t=parseInt(i.current_tick+1);t===i.tick_count&&(t=0),"slide_left"!==e.rotate_type&&"slide_right"!==e.rotate_type||(g="slide_left"),z(t)}()})),o[0].addEventListener("swiped-right",(function(){!function(){if(i.running)return!1;var t=parseInt(i.current_tick-1);t<0&&(t=i.tick_count-1),"slide_left"!==e.rotate_type&&"slide_right"!==e.rotate_type||(g="slide_right"),e.nav_reverse&&("slide_down"===e.rotate_type?g="slide_up":"slide_up"===e.rotate_type&&(g="slide_down"),i.reverse=1),z(t)}()}))),a.on("mtphr_dnt_next",(function(){M()})),a.on("mtphr_dnt_prev",(function(){Q()})),a.on("mtphr_dnt_goto",(function(t,e){z(parseInt(e))})),a.on("mtphr_dnt_pause",(function(){B()})),a.on("mtphr_dnt_play",(function(){B(!0)})),$(window).on("resize",(function(){o.outerWidth()!==u&&(u=o.outerWidth(!0),"scroll"===e.type?("up"===e.scroll_direction||"down"===e.scroll_direction)&&h?D():C():"rotate"===e.type&&O())})),a.on("mtphr_dnt_resize_single",(function(t,i){u=o.outerWidth(!0),"scroll"===e.type?(i&&D(),C()):"rotate"===e.type&&O()})),$("body").on("mtphr_dnt_resize",(function(t,i){i&&i.indexOf(e.id)>=0&&("scroll"===e.type?C():"rotate"===e.type&&O())})),a.on("mtphr_dnt_replace_ticks",(function(t,e,i){clearTimeout(s),cancelAnimationFrame(n),a.find(".mtphr-dnt-tick").remove(),e.each((function(){o.append($(this))})),setTimeout((function(){k()}),i)})),0===a.width()){var G=!0;setTimeout((function t(){a.width()>10&&(G=!1,u=o.outerWidth(!0),k()),G&&setTimeout(t,100)}),100)}else k()}))}};$.fn.ditty_news_ticker=function(e){if(t[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));if("object"!=typeof e&&e)throw new Error("Method "+e+" does not exist in ditty_news_ticker");return t.init.apply(this,arguments)}}(jQuery);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: ticker, news, news ticker, rotator, data rotator, lists, data, aggregator, latest posts
5
  Requires at least: 4.5
6
  Tested up to: 5.8.2
7
- Stable tag: 3.0.5
8
  License: GPL2
9
 
10
  Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
@@ -66,6 +66,10 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
66
 
67
  == Changelog ==
68
 
 
 
 
 
69
  = 3.0.5 =
70
  * Added checks for auto-enabling Ditty News Ticker if old shortcode or function is used on front-end
71
 
@@ -605,4 +609,4 @@ The most common cause for an unresponsive Ditty (when using scroll or rotate mod
605
 
606
  == Upgrade Notice ==
607
 
608
- Added checks for auto-enabling Ditty News Ticker if old shortcode or function is used on front-end
4
  Tags: ticker, news, news ticker, rotator, data rotator, lists, data, aggregator, latest posts
5
  Requires at least: 4.5
6
  Tested up to: 5.8.2
7
+ Stable tag: 3.0.6
8
  License: GPL2
9
 
10
  Formerly Ditty News Ticker. Ditty is a multi-functional data display plugin.
66
 
67
  == Changelog ==
68
 
69
+ = 3.0.6 =
70
+ * Ditty Editor Items javascript helper update
71
+ * Minor update in legacy ditty-news-ticker.js file
72
+
73
  = 3.0.5 =
74
  * Added checks for auto-enabling Ditty News Ticker if old shortcode or function is used on front-end
75
 
609
 
610
  == Upgrade Notice ==
611
 
612
+ Ditty Editor Items javascript helper update
vendor/.gitignore DELETED
@@ -1,7 +0,0 @@
1
- composer.lock
2
- config.codekit3
3
- /node_modules/
4
- /logs/
5
- /reports/
6
- .DS_Store
7
- .nova
 
 
 
 
 
 
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit92bf871a7580d37400ed04591bee96b6::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit9e098bafa3f1e3262b28a2fdaed4ed46::getLoader();
vendor/composer/InstalledVersions.php CHANGED
@@ -19,7 +19,7 @@ private static $installed = array (
19
  'aliases' =>
20
  array (
21
  ),
22
- 'reference' => '7ec4bc14e6485630bced6a9788f8cf80d66b3197',
23
  'name' => '__root__',
24
  ),
25
  'versions' =>
@@ -31,7 +31,7 @@ private static $installed = array (
31
  'aliases' =>
32
  array (
33
  ),
34
- 'reference' => '7ec4bc14e6485630bced6a9788f8cf80d66b3197',
35
  ),
36
  'composer/installers' =>
37
  array (
@@ -60,21 +60,21 @@ private static $installed = array (
60
  ),
61
  'sabberworm/php-css-parser' =>
62
  array (
63
- 'pretty_version' => '8.3.1',
64
- 'version' => '8.3.1.0',
65
  'aliases' =>
66
  array (
67
  ),
68
- 'reference' => 'd217848e1396ef962fb1997cf3e2421acba7f796',
69
  ),
70
  'scssphp/scssphp' =>
71
  array (
72
- 'pretty_version' => 'v1.8.1',
73
- 'version' => '1.8.1.0',
74
  'aliases' =>
75
  array (
76
  ),
77
- 'reference' => '5e37759a63caf54392a4b709358a39ac7425a69f',
78
  ),
79
  'shama/baton' =>
80
  array (
19
  'aliases' =>
20
  array (
21
  ),
22
+ 'reference' => '1235a3c138c15909678b34f0293d85c8f7f6cdf5',
23
  'name' => '__root__',
24
  ),
25
  'versions' =>
31
  'aliases' =>
32
  array (
33
  ),
34
+ 'reference' => '1235a3c138c15909678b34f0293d85c8f7f6cdf5',
35
  ),
36
  'composer/installers' =>
37
  array (
60
  ),
61
  'sabberworm/php-css-parser' =>
62
  array (
63
+ 'pretty_version' => '8.4.0',
64
+ 'version' => '8.4.0.0',
65
  'aliases' =>
66
  array (
67
  ),
68
+ 'reference' => 'e41d2140031d533348b2192a83f02d8dd8a71d30',
69
  ),
70
  'scssphp/scssphp' =>
71
  array (
72
+ 'pretty_version' => 'v1.9.0',
73
+ 'version' => '1.9.0.0',
74
  'aliases' =>
75
  array (
76
  ),
77
+ 'reference' => 'bc8bece4e5e176973a832f3763049ddbba16e6fd',
78
  ),
79
  'shama/baton' =>
80
  array (
vendor/composer/autoload_namespaces.php CHANGED
@@ -6,5 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'Sabberworm\\CSS' => array($vendorDir . '/sabberworm/php-css-parser/lib'),
10
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  );
vendor/composer/autoload_psr4.php CHANGED
@@ -8,6 +8,7 @@ $baseDir = dirname($vendorDir);
8
  return array(
9
  'Thunder\\Shortcode\\' => array($vendorDir . '/thunderer/shortcode/src'),
10
  'ScssPhp\\ScssPhp\\' => array($vendorDir . '/scssphp/scssphp/src'),
 
11
  'Padaliyajay\\PHPAutoprefixer\\' => array($vendorDir . '/padaliyajay/php-autoprefixer/src'),
12
  'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
13
  );
8
  return array(
9
  'Thunder\\Shortcode\\' => array($vendorDir . '/thunderer/shortcode/src'),
10
  'ScssPhp\\ScssPhp\\' => array($vendorDir . '/scssphp/scssphp/src'),
11
+ 'Sabberworm\\CSS\\' => array($vendorDir . '/sabberworm/php-css-parser/src'),
12
  'Padaliyajay\\PHPAutoprefixer\\' => array($vendorDir . '/padaliyajay/php-autoprefixer/src'),
13
  'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
14
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit92bf871a7580d37400ed04591bee96b6
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit92bf871a7580d37400ed04591bee96b6
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit92bf871a7580d37400ed04591bee96b6', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
29
- spl_autoload_unregister(array('ComposerAutoloaderInit92bf871a7580d37400ed04591bee96b6', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
- call_user_func(\Composer\Autoload\ComposerStaticInit92bf871a7580d37400ed04591bee96b6::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit9e098bafa3f1e3262b28a2fdaed4ed46
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInit9e098bafa3f1e3262b28a2fdaed4ed46', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit9e098bafa3f1e3262b28a2fdaed4ed46', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInit9e098bafa3f1e3262b28a2fdaed4ed46::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit92bf871a7580d37400ed04591bee96b6
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
@@ -14,6 +14,7 @@ class ComposerStaticInit92bf871a7580d37400ed04591bee96b6
14
  'S' =>
15
  array (
16
  'ScssPhp\\ScssPhp\\' => 16,
 
17
  ),
18
  'P' =>
19
  array (
@@ -34,6 +35,10 @@ class ComposerStaticInit92bf871a7580d37400ed04591bee96b6
34
  array (
35
  0 => __DIR__ . '/..' . '/scssphp/scssphp/src',
36
  ),
 
 
 
 
37
  'Padaliyajay\\PHPAutoprefixer\\' =>
38
  array (
39
  0 => __DIR__ . '/..' . '/padaliyajay/php-autoprefixer/src',
@@ -44,16 +49,6 @@ class ComposerStaticInit92bf871a7580d37400ed04591bee96b6
44
  ),
45
  );
46
 
47
- public static $prefixesPsr0 = array (
48
- 'S' =>
49
- array (
50
- 'Sabberworm\\CSS' =>
51
- array (
52
- 0 => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib',
53
- ),
54
- ),
55
- );
56
-
57
  public static $classMap = array (
58
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
59
  );
@@ -61,10 +56,9 @@ class ComposerStaticInit92bf871a7580d37400ed04591bee96b6
61
  public static function getInitializer(ClassLoader $loader)
62
  {
63
  return \Closure::bind(function () use ($loader) {
64
- $loader->prefixLengthsPsr4 = ComposerStaticInit92bf871a7580d37400ed04591bee96b6::$prefixLengthsPsr4;
65
- $loader->prefixDirsPsr4 = ComposerStaticInit92bf871a7580d37400ed04591bee96b6::$prefixDirsPsr4;
66
- $loader->prefixesPsr0 = ComposerStaticInit92bf871a7580d37400ed04591bee96b6::$prefixesPsr0;
67
- $loader->classMap = ComposerStaticInit92bf871a7580d37400ed04591bee96b6::$classMap;
68
 
69
  }, null, ClassLoader::class);
70
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit9e098bafa3f1e3262b28a2fdaed4ed46
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
14
  'S' =>
15
  array (
16
  'ScssPhp\\ScssPhp\\' => 16,
17
+ 'Sabberworm\\CSS\\' => 15,
18
  ),
19
  'P' =>
20
  array (
35
  array (
36
  0 => __DIR__ . '/..' . '/scssphp/scssphp/src',
37
  ),
38
+ 'Sabberworm\\CSS\\' =>
39
+ array (
40
+ 0 => __DIR__ . '/..' . '/sabberworm/php-css-parser/src',
41
+ ),
42
  'Padaliyajay\\PHPAutoprefixer\\' =>
43
  array (
44
  0 => __DIR__ . '/..' . '/padaliyajay/php-autoprefixer/src',
49
  ),
50
  );
51
 
 
 
 
 
 
 
 
 
 
 
52
  public static $classMap = array (
53
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
54
  );
56
  public static function getInitializer(ClassLoader $loader)
57
  {
58
  return \Closure::bind(function () use ($loader) {
59
+ $loader->prefixLengthsPsr4 = ComposerStaticInit9e098bafa3f1e3262b28a2fdaed4ed46::$prefixLengthsPsr4;
60
+ $loader->prefixDirsPsr4 = ComposerStaticInit9e098bafa3f1e3262b28a2fdaed4ed46::$prefixDirsPsr4;
61
+ $loader->classMap = ComposerStaticInit9e098bafa3f1e3262b28a2fdaed4ed46::$classMap;
 
62
 
63
  }, null, ClassLoader::class);
64
  }
vendor/composer/installed.json CHANGED
@@ -198,32 +198,36 @@
198
  },
199
  {
200
  "name": "sabberworm/php-css-parser",
201
- "version": "8.3.1",
202
- "version_normalized": "8.3.1.0",
203
  "source": {
204
  "type": "git",
205
  "url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
206
- "reference": "d217848e1396ef962fb1997cf3e2421acba7f796"
207
  },
208
  "dist": {
209
  "type": "zip",
210
- "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/d217848e1396ef962fb1997cf3e2421acba7f796",
211
- "reference": "d217848e1396ef962fb1997cf3e2421acba7f796",
212
  "shasum": ""
213
  },
214
  "require": {
215
- "php": ">=5.3.2"
 
216
  },
217
  "require-dev": {
218
  "codacy/coverage": "^1.4",
219
- "phpunit/phpunit": "~4.8"
220
  },
221
- "time": "2020-06-01T09:10:00+00:00",
 
 
 
222
  "type": "library",
223
  "installation-source": "dist",
224
  "autoload": {
225
- "psr-0": {
226
- "Sabberworm\\CSS": "lib/"
227
  }
228
  },
229
  "notification-url": "https://packagist.org/downloads/",
@@ -236,7 +240,7 @@
236
  }
237
  ],
238
  "description": "Parser for CSS Files written in PHP",
239
- "homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser",
240
  "keywords": [
241
  "css",
242
  "parser",
@@ -244,23 +248,23 @@
244
  ],
245
  "support": {
246
  "issues": "https://github.com/sabberworm/PHP-CSS-Parser/issues",
247
- "source": "https://github.com/sabberworm/PHP-CSS-Parser/tree/8.3.1"
248
  },
249
  "install-path": "../sabberworm/php-css-parser"
250
  },
251
  {
252
  "name": "scssphp/scssphp",
253
- "version": "v1.8.1",
254
- "version_normalized": "1.8.1.0",
255
  "source": {
256
  "type": "git",
257
  "url": "https://github.com/scssphp/scssphp.git",
258
- "reference": "5e37759a63caf54392a4b709358a39ac7425a69f"
259
  },
260
  "dist": {
261
  "type": "zip",
262
- "url": "https://api.github.com/repos/scssphp/scssphp/zipball/5e37759a63caf54392a4b709358a39ac7425a69f",
263
- "reference": "5e37759a63caf54392a4b709358a39ac7425a69f",
264
  "shasum": ""
265
  },
266
  "require": {
@@ -283,7 +287,7 @@
283
  "ext-iconv": "Can be used as fallback when ext-mbstring is not available",
284
  "ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv"
285
  },
286
- "time": "2021-09-18T21:20:53+00:00",
287
  "bin": [
288
  "bin/pscss"
289
  ],
@@ -321,7 +325,7 @@
321
  ],
322
  "support": {
323
  "issues": "https://github.com/scssphp/scssphp/issues",
324
- "source": "https://github.com/scssphp/scssphp/tree/v1.8.1"
325
  },
326
  "install-path": "../scssphp/scssphp"
327
  },
198
  },
199
  {
200
  "name": "sabberworm/php-css-parser",
201
+ "version": "8.4.0",
202
+ "version_normalized": "8.4.0.0",
203
  "source": {
204
  "type": "git",
205
  "url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
206
+ "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30"
207
  },
208
  "dist": {
209
  "type": "zip",
210
+ "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/e41d2140031d533348b2192a83f02d8dd8a71d30",
211
+ "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30",
212
  "shasum": ""
213
  },
214
  "require": {
215
+ "ext-iconv": "*",
216
+ "php": ">=5.6.20"
217
  },
218
  "require-dev": {
219
  "codacy/coverage": "^1.4",
220
+ "phpunit/phpunit": "^4.8.36"
221
  },
222
+ "suggest": {
223
+ "ext-mbstring": "for parsing UTF-8 CSS"
224
+ },
225
+ "time": "2021-12-11T13:40:54+00:00",
226
  "type": "library",
227
  "installation-source": "dist",
228
  "autoload": {
229
+ "psr-4": {
230
+ "Sabberworm\\CSS\\": "src/"
231
  }
232
  },
233
  "notification-url": "https://packagist.org/downloads/",
240
  }
241
  ],
242
  "description": "Parser for CSS Files written in PHP",
243
+ "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser",
244
  "keywords": [
245
  "css",
246
  "parser",
248
  ],
249
  "support": {
250
  "issues": "https://github.com/sabberworm/PHP-CSS-Parser/issues",
251
+ "source": "https://github.com/sabberworm/PHP-CSS-Parser/tree/8.4.0"
252
  },
253
  "install-path": "../sabberworm/php-css-parser"
254
  },
255
  {
256
  "name": "scssphp/scssphp",
257
+ "version": "v1.9.0",
258
+ "version_normalized": "1.9.0.0",
259
  "source": {
260
  "type": "git",
261
  "url": "https://github.com/scssphp/scssphp.git",
262
+ "reference": "bc8bece4e5e176973a832f3763049ddbba16e6fd"
263
  },
264
  "dist": {
265
  "type": "zip",
266
+ "url": "https://api.github.com/repos/scssphp/scssphp/zipball/bc8bece4e5e176973a832f3763049ddbba16e6fd",
267
+ "reference": "bc8bece4e5e176973a832f3763049ddbba16e6fd",
268
  "shasum": ""
269
  },
270
  "require": {
287
  "ext-iconv": "Can be used as fallback when ext-mbstring is not available",
288
  "ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv"
289
  },
290
+ "time": "2021-12-13T11:55:16+00:00",
291
  "bin": [
292
  "bin/pscss"
293
  ],
325
  ],
326
  "support": {
327
  "issues": "https://github.com/scssphp/scssphp/issues",
328
+ "source": "https://github.com/scssphp/scssphp/tree/v1.9.0"
329
  },
330
  "install-path": "../scssphp/scssphp"
331
  },
vendor/composer/installed.php CHANGED
@@ -6,7 +6,7 @@
6
  'aliases' =>
7
  array (
8
  ),
9
- 'reference' => '7ec4bc14e6485630bced6a9788f8cf80d66b3197',
10
  'name' => '__root__',
11
  ),
12
  'versions' =>
@@ -18,7 +18,7 @@
18
  'aliases' =>
19
  array (
20
  ),
21
- 'reference' => '7ec4bc14e6485630bced6a9788f8cf80d66b3197',
22
  ),
23
  'composer/installers' =>
24
  array (
@@ -47,21 +47,21 @@
47
  ),
48
  'sabberworm/php-css-parser' =>
49
  array (
50
- 'pretty_version' => '8.3.1',
51
- 'version' => '8.3.1.0',
52
  'aliases' =>
53
  array (
54
  ),
55
- 'reference' => 'd217848e1396ef962fb1997cf3e2421acba7f796',
56
  ),
57
  'scssphp/scssphp' =>
58
  array (
59
- 'pretty_version' => 'v1.8.1',
60
- 'version' => '1.8.1.0',
61
  'aliases' =>
62
  array (
63
  ),
64
- 'reference' => '5e37759a63caf54392a4b709358a39ac7425a69f',
65
  ),
66
  'shama/baton' =>
67
  array (
6
  'aliases' =>
7
  array (
8
  ),
9
+ 'reference' => '1235a3c138c15909678b34f0293d85c8f7f6cdf5',
10
  'name' => '__root__',
11
  ),
12
  'versions' =>
18
  'aliases' =>
19
  array (
20
  ),
21
+ 'reference' => '1235a3c138c15909678b34f0293d85c8f7f6cdf5',
22
  ),
23
  'composer/installers' =>
24
  array (
47
  ),
48
  'sabberworm/php-css-parser' =>
49
  array (
50
+ 'pretty_version' => '8.4.0',
51
+ 'version' => '8.4.0.0',
52
  'aliases' =>
53
  array (
54
  ),
55
+ 'reference' => 'e41d2140031d533348b2192a83f02d8dd8a71d30',
56
  ),
57
  'scssphp/scssphp' =>
58
  array (
59
+ 'pretty_version' => 'v1.9.0',
60
+ 'version' => '1.9.0.0',
61
  'aliases' =>
62
  array (
63
  ),
64
+ 'reference' => 'bc8bece4e5e176973a832f3763049ddbba16e6fd',
65
  ),
66
  'shama/baton' =>
67
  array (
vendor/composer/platform_check.php CHANGED
@@ -4,8 +4,8 @@
4
 
5
  $issues = array();
6
 
7
- if (!(PHP_VERSION_ID >= 50600)) {
8
- $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.';
9
  }
10
 
11
  if ($issues) {
4
 
5
  $issues = array();
6
 
7
+ if (!(PHP_VERSION_ID >= 50620)) {
8
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.20". You are running ' . PHP_VERSION . '.';
9
  }
10
 
11
  if ($issues) {
vendor/sabberworm/php-css-parser/.gitignore DELETED
@@ -1 +0,0 @@
1
- vendor/
 
vendor/sabberworm/php-css-parser/.travis.yml DELETED
@@ -1,22 +0,0 @@
1
- language: php
2
- php:
3
- - "5.4"
4
- - "5.5"
5
- - "5.6"
6
- - "7.0"
7
- - "7.1"
8
- - "7.2"
9
- - "7.3"
10
- - hhvm
11
- sudo: false
12
- dist: trusty
13
- matrix:
14
- include:
15
- -
16
- php: "5.3"
17
- dist: precise
18
- sudo: false
19
- before_script: rm composer.lock && composer install
20
- script: ./vendor/bin/phpunit --coverage-clover build/coverage/xml
21
- after_script: ./vendor/bin/codacycoverage clover build/coverage/xml
22
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/CHANGELOG.md CHANGED
@@ -1,26 +1,47 @@
1
  # Revision History
2
 
3
- ## 8.0
4
 
5
- ### 8.0.0 (2016-06-30)
6
 
7
- * Store source CSS line numbers in tokens and parsing exceptions.
 
 
 
8
  * *No deprecations*
9
 
10
- #### Backwards-incompatible changes
11
 
12
- * Unrecoverable parser errors throw an exception of type `Sabberworm\CSS\Parsing\SourceException` instead of `\Exception`.
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
- ### 8.1.0 (2016-07-19)
15
 
16
- * Comments are no longer silently ignored but stored with the object with which they appear (no render support, though). Thanks to @FMCorz.
17
- * The IE hacks using `\0` and `\9` can now be parsed (and rendered) in lenient mode. Thanks (again) to @FMCorz.
18
- * Media queries with or without spaces before the query are parsed. Still no *real* parsing support, though. Sorry…
19
- * PHPUnit is now listed as a dev-dependency in composer.json.
 
 
 
 
 
 
20
  * *No backwards-incompatible changes*
21
  * *No deprecations*
22
 
23
- ### 8.2.0 (2018-07-13)
24
 
25
  * Support parsing `calc()`, thanks to @raxbg.
26
  * Support parsing grid-lines, again thanks to @raxbg.
@@ -29,188 +50,184 @@
29
  * *No backwards-incompatible changes*
30
  * *No deprecations*
31
 
32
- ### 8.3.0 (2019-02-22)
33
 
34
- * Refactor parsing logic to mostly reside in the class files whose data structure is to be parsed (this should eventually allow us to unit-test specific parts of the parsing logic individually).
35
- * Fix error in parsing `calc` expessions when the first operand is a negative number, thanks to @raxbg.
36
- * Support parsing CSS4 colors in hex notation with alpha values, thanks to @raxbg.
37
- * Swallow more errors in lenient mode, thanks to @raxbg.
38
- * Allow specifying arbitrary strings to output before and after declaration blocks, thanks to @westonruter.
39
  * *No backwards-incompatible changes*
40
  * *No deprecations*
41
 
42
- ## 7.0
43
-
44
- ### 7.0.0 (2015-08-24)
45
 
46
- * Compatibility with PHP 7. Well timed, eh?
47
  * *No deprecations*
48
 
49
- #### Backwards-incompatible changes
50
 
51
- * The `Sabberworm\CSS\Value\String` class has been renamed to `Sabberworm\CSS\Value\CSSString`.
52
 
53
- ### 7.0.1 (2015-12-25)
54
 
55
- * No more suppressed `E_NOTICE`
56
  * *No backwards-incompatible changes*
57
  * *No deprecations*
58
 
59
- ### 7.0.2 (2016-02-11)
60
 
61
  * 150 time performance boost thanks to @[ossinkine](https://github.com/ossinkine)
62
  * *No backwards-incompatible changes*
63
  * *No deprecations*
64
 
65
- ### 7.0.3 (2016-04-27)
66
 
67
- * Fixed parsing empty CSS when multibyte is off
68
  * *No backwards-incompatible changes*
69
  * *No deprecations*
70
 
71
- ## 6.0
72
 
73
- ### 6.0.0 (2014-07-03)
74
-
75
- * Format output using Sabberworm\CSS\OutputFormat
76
- * *No backwards-incompatible changes*
77
 
78
- #### Deprecations
79
 
80
- * The parse() method replaces __toString with an optional argument (instance of the OutputFormat class)
81
 
82
- ### 6.0.1 (2015-08-24)
83
 
84
  * Remove some declarations in interfaces incompatible with PHP 5.3 (< 5.3.9)
85
  * *No deprecations*
86
 
87
- ## 5.0
 
 
 
 
 
88
 
89
- ### 5.0.0 (2013-03-20)
 
 
 
 
 
90
 
91
- * Correctly parse all known CSS 3 units (including Hz and kHz).
92
- * Output RGB colors in short (#aaa or #ababab) notation
93
- * Be case-insensitive when parsing identifiers.
94
  * *No deprecations*
95
 
96
  #### Backwards-incompatible changes
97
 
98
- * `Sabberworm\CSS\Value\Color`’s `__toString` method overrides `CSSList`’s to maybe return something other than `type(value,)` (see above).
99
 
100
- ### 5.0.1 (2013-03-20)
101
 
102
- * Internal cleanup
 
 
103
  * *No backwards-incompatible changes*
104
  * *No deprecations*
105
 
106
- ### 5.0.2 (2013-03-21)
107
 
108
- * CHANGELOG.md file added to distribution
109
  * *No backwards-incompatible changes*
110
  * *No deprecations*
111
 
112
- ### 5.0.3 (2013-03-21)
113
 
114
- * More size units recognized
 
115
  * *No backwards-incompatible changes*
116
  * *No deprecations*
117
 
118
- ### 5.0.4 (2013-03-21)
119
 
120
- * Dont output floats with locale-aware separator chars
121
  * *No backwards-incompatible changes*
122
  * *No deprecations*
123
 
124
- ### 5.0.5 (2013-04-17)
125
 
126
- * Initial support for lenient parsing (setting this parser option will catch some exceptions internally and recover the parser’s state as neatly as possible).
127
  * *No backwards-incompatible changes*
128
  * *No deprecations*
129
 
130
- ### 5.0.6 (2013-05-31)
131
 
132
  * Fix broken unit test
133
  * *No backwards-incompatible changes*
134
  * *No deprecations*
135
 
136
- ### 5.0.7 (2013-08-04)
137
 
138
- * Fix broken decimal point output optimization
139
  * *No backwards-incompatible changes*
140
  * *No deprecations*
141
 
142
- ### 5.0.8 (2013-08-15)
143
 
144
- * Make default settingsmultibyte parsing option dependent on whether or not the mbstring extension is actually installed.
145
  * *No backwards-incompatible changes*
146
  * *No deprecations*
147
 
148
- ### 5.1.0 (2013-10-24)
149
 
150
- * Performance enhancements by Michael M Slusarz
151
- * More rescue entry points for lenient parsing (unexpected tokens between declaration blocks and unclosed comments)
152
  * *No backwards-incompatible changes*
153
  * *No deprecations*
154
 
155
- ### 5.1.1 (2013-10-28)
156
 
157
- * Updated CHANGELOG.md to reflect changes since 5.0.4
158
  * *No backwards-incompatible changes*
159
  * *No deprecations*
160
 
161
- ### 5.1.2 (2013-10-30)
162
 
163
- * Remove the use of consumeUntil in comment parsing. This makes it possible to parse comments such as `/** Perfectly valid **/`
164
- * Add fr relative size unit
165
- * Fix some issues with HHVM
166
  * *No backwards-incompatible changes*
167
  * *No deprecations*
168
 
169
- ### 5.2.0 (2014-06-30)
170
-
171
- * Support removing a selector from a declaration block using `$oBlock->removeSelector($mSelector)`
172
- * Introduce a specialized exception (Sabberworm\CSS\Parsing\OuputException) for exceptions during output rendering
173
 
 
 
 
174
  * *No deprecations*
175
 
176
- #### Backwards-incompatible changes
177
-
178
- * Outputting a declaration block that has no selectors throws an OuputException instead of outputting an invalid ` {…}` into the CSS document.
179
 
180
- ## 4.0
181
 
182
- ### 4.0.0 (2013-03-19)
183
 
184
  * Support for more @-rules
185
  * Generic interface `Sabberworm\CSS\Property\AtRule`, implemented by all @-rule classes
186
  * *No deprecations*
187
 
188
- #### Backwards-incompatible changes
189
 
190
  * `Sabberworm\CSS\RuleSet\AtRule` renamed to `Sabberworm\CSS\RuleSet\AtRuleSet`
191
  * `Sabberworm\CSS\CSSList\MediaQuery` renamed to `Sabberworm\CSS\RuleSet\CSSList\AtRuleBlockList` with differing semantics and API (which also works for other block-list-based @-rules like `@supports`).
192
 
193
- ## 3.0
194
-
195
- ### 3.0.0 (2013-03-06)
196
 
197
  * Support for lenient parsing (on by default)
198
  * *No deprecations*
199
 
200
- #### Backwards-incompatible changes
201
 
202
  * All properties (like whether or not to use `mb_`-functions, which default charset to use and – new – whether or not to be forgiving when parsing) are now encapsulated in an instance of `Sabberworm\CSS\Settings` which can be passed as the second argument to `Sabberworm\CSS\Parser->__construct()`.
203
  * Specifying a charset as the second argument to `Sabberworm\CSS\Parser->__construct()` is no longer supported. Use `Sabberworm\CSS\Settings::create()->withDefaultCharset('some-charset')` instead.
204
  * Setting `Sabberworm\CSS\Parser->bUseMbFunctions` has no effect. Use `Sabberworm\CSS\Settings::create()->withMultibyteSupport(true/false)` instead.
205
  * `Sabberworm\CSS\Parser->parse()` may throw a `Sabberworm\CSS\Parsing\UnexpectedTokenException` when in strict parsing mode.
206
 
207
- ## 2.0
208
-
209
- ### 2.0.0 (2013-01-29)
210
 
211
  * Allow multiple rules of the same type per rule set
212
 
213
- #### Backwards-incompatible changes
214
 
215
  * `Sabberworm\CSS\RuleSet->getRules()` returns an index-based array instead of an associative array. Use `Sabberworm\CSS\RuleSet->getRulesAssoc()` (which eliminates duplicate rules and lets the later rule of the same name win).
216
  * `Sabberworm\CSS\RuleSet->removeRule()` works as it did before except when passed an instance of `Sabberworm\CSS\Rule\Rule`, in which case it would only remove the exact rule given instead of all the rules of the same type. To get the old behaviour, use `Sabberworm\CSS\RuleSet->removeRule($oRule->getRule()`;
1
  # Revision History
2
 
3
+ ## 8.4.0
4
 
5
+ ### Features
6
 
7
+ * Support for PHP 8.x
8
+ * PHPDoc annotations
9
+ * Allow usage of CSS variables inside color functions (by parsing them as regular functions)
10
+ * Use PSR-12 code style
11
  * *No deprecations*
12
 
13
+ ### Bugfixes
14
 
15
+ * Improved handling of whitespace in `calc()`
16
+ * Fix parsing units whose prefix is also a valid unit, like `vmin`
17
+ * Allow passing an object to `CSSList#replace`
18
+ * Fix PHP 7.3 warnings
19
+ * Correctly parse keyframes with `%`
20
+ * Don’t convert large numbers to scientific notation
21
+ * Allow a file to end after an `@import`
22
+ * Preserve case of CSS variables as specced
23
+ * Allow identifiers to use escapes the same way as strings
24
+ * No longer use `eval` for the comparison in `getSelectorsBySpecificity`, in case it gets passed untrusted input (CVE-2020-13756). Also fixed in 8.3.1, 8.2.1, 8.1.1, 8.0.1, 7.0.4, 6.0.2, 5.2.1, 5.1.3, 5.0.9, 4.0.1, 3.0.1, 2.0.1, 1.0.1.
25
+ * Prevent an infinite loop when parsing invalid grid line names
26
+ * Remove invalid unit `vm`
27
+ * Retain rule order after expanding shorthands
28
 
29
+ ### Backwards-incompatible changes
30
 
31
+ * PHP 5.6 is now required
32
+ * HHVM compatibility target dropped
33
+
34
+ ## 8.3.0 (2019-02-22)
35
+
36
+ * Refactor parsing logic to mostly reside in the class files whose data structure is to be parsed (this should eventually allow us to unit-test specific parts of the parsing logic individually).
37
+ * Fix error in parsing `calc` expessions when the first operand is a negative number, thanks to @raxbg.
38
+ * Support parsing CSS4 colors in hex notation with alpha values, thanks to @raxbg.
39
+ * Swallow more errors in lenient mode, thanks to @raxbg.
40
+ * Allow specifying arbitrary strings to output before and after declaration blocks, thanks to @westonruter.
41
  * *No backwards-incompatible changes*
42
  * *No deprecations*
43
 
44
+ ## 8.2.0 (2018-07-13)
45
 
46
  * Support parsing `calc()`, thanks to @raxbg.
47
  * Support parsing grid-lines, again thanks to @raxbg.
50
  * *No backwards-incompatible changes*
51
  * *No deprecations*
52
 
53
+ ## 8.1.0 (2016-07-19)
54
 
55
+ * Comments are no longer silently ignored but stored with the object with which they appear (no render support, though). Thanks to @FMCorz.
56
+ * The IE hacks using `\0` and `\9` can now be parsed (and rendered) in lenient mode. Thanks (again) to @FMCorz.
57
+ * Media queries with or without spaces before the query are parsed. Still no *real* parsing support, though. Sorry…
58
+ * PHPUnit is now listed as a dev-dependency in composer.json.
 
59
  * *No backwards-incompatible changes*
60
  * *No deprecations*
61
 
62
+ ## 8.0.0 (2016-06-30)
 
 
63
 
64
+ * Store source CSS line numbers in tokens and parsing exceptions.
65
  * *No deprecations*
66
 
67
+ ### Backwards-incompatible changes
68
 
69
+ * Unrecoverable parser errors throw an exception of type `Sabberworm\CSS\Parsing\SourceException` instead of `\Exception`.
70
 
71
+ ## 7.0.3 (2016-04-27)
72
 
73
+ * Fixed parsing empty CSS when multibyte is off
74
  * *No backwards-incompatible changes*
75
  * *No deprecations*
76
 
77
+ ## 7.0.2 (2016-02-11)
78
 
79
  * 150 time performance boost thanks to @[ossinkine](https://github.com/ossinkine)
80
  * *No backwards-incompatible changes*
81
  * *No deprecations*
82
 
83
+ ## 7.0.1 (2015-12-25)
84
 
85
+ * No more suppressed `E_NOTICE`
86
  * *No backwards-incompatible changes*
87
  * *No deprecations*
88
 
89
+ ## 7.0.0 (2015-08-24)
90
 
91
+ * Compatibility with PHP 7. Well timed, eh?
92
+ * *No deprecations*
 
 
93
 
94
+ ### Backwards-incompatible changes
95
 
96
+ * The `Sabberworm\CSS\Value\String` class has been renamed to `Sabberworm\CSS\Value\CSSString`.
97
 
98
+ ## 6.0.1 (2015-08-24)
99
 
100
  * Remove some declarations in interfaces incompatible with PHP 5.3 (< 5.3.9)
101
  * *No deprecations*
102
 
103
+ ## 6.0.0 (2014-07-03)
104
+
105
+ * Format output using Sabberworm\CSS\OutputFormat
106
+ * *No backwards-incompatible changes*
107
+
108
+ ### Deprecations
109
 
110
+ * The parse() method replaces __toString with an optional argument (instance of the OutputFormat class)
111
+
112
+ ## 5.2.0 (2014-06-30)
113
+
114
+ * Support removing a selector from a declaration block using `$oBlock->removeSelector($mSelector)`
115
+ * Introduce a specialized exception (Sabberworm\CSS\Parsing\OuputException) for exceptions during output rendering
116
 
 
 
 
117
  * *No deprecations*
118
 
119
  #### Backwards-incompatible changes
120
 
121
+ * Outputting a declaration block that has no selectors throws an OuputException instead of outputting an invalid ` {}` into the CSS document.
122
 
123
+ ## 5.1.2 (2013-10-30)
124
 
125
+ * Remove the use of consumeUntil in comment parsing. This makes it possible to parse comments such as `/** Perfectly valid **/`
126
+ * Add fr relative size unit
127
+ * Fix some issues with HHVM
128
  * *No backwards-incompatible changes*
129
  * *No deprecations*
130
 
131
+ ## 5.1.1 (2013-10-28)
132
 
133
+ * Updated CHANGELOG.md to reflect changes since 5.0.4
134
  * *No backwards-incompatible changes*
135
  * *No deprecations*
136
 
137
+ ## 5.1.0 (2013-10-24)
138
 
139
+ * Performance enhancements by Michael M Slusarz
140
+ * More rescue entry points for lenient parsing (unexpected tokens between declaration blocks and unclosed comments)
141
  * *No backwards-incompatible changes*
142
  * *No deprecations*
143
 
144
+ ## 5.0.8 (2013-08-15)
145
 
146
+ * Make default settingsmultibyte parsing option dependent on whether or not the mbstring extension is actually installed.
147
  * *No backwards-incompatible changes*
148
  * *No deprecations*
149
 
150
+ ## 5.0.7 (2013-08-04)
151
 
152
+ * Fix broken decimal point output optimization
153
  * *No backwards-incompatible changes*
154
  * *No deprecations*
155
 
156
+ ## 5.0.6 (2013-05-31)
157
 
158
  * Fix broken unit test
159
  * *No backwards-incompatible changes*
160
  * *No deprecations*
161
 
162
+ ## 5.0.5 (2013-04-17)
163
 
164
+ * Initial support for lenient parsing (setting this parser option will catch some exceptions internally and recover the parser’s state as neatly as possible).
165
  * *No backwards-incompatible changes*
166
  * *No deprecations*
167
 
168
+ ## 5.0.4 (2013-03-21)
169
 
170
+ * Dont output floats with locale-aware separator chars
171
  * *No backwards-incompatible changes*
172
  * *No deprecations*
173
 
174
+ ## 5.0.3 (2013-03-21)
175
 
176
+ * More size units recognized
 
177
  * *No backwards-incompatible changes*
178
  * *No deprecations*
179
 
180
+ ## 5.0.2 (2013-03-21)
181
 
182
+ * CHANGELOG.md file added to distribution
183
  * *No backwards-incompatible changes*
184
  * *No deprecations*
185
 
186
+ ## 5.0.1 (2013-03-20)
187
 
188
+ * Internal cleanup
 
 
189
  * *No backwards-incompatible changes*
190
  * *No deprecations*
191
 
192
+ ## 5.0.0 (2013-03-20)
 
 
 
193
 
194
+ * Correctly parse all known CSS 3 units (including Hz and kHz).
195
+ * Output RGB colors in short (#aaa or #ababab) notation
196
+ * Be case-insensitive when parsing identifiers.
197
  * *No deprecations*
198
 
199
+ ### Backwards-incompatible changes
 
 
200
 
201
+ * `Sabberworm\CSS\Value\Color`’s `__toString` method overrides `CSSList`’s to maybe return something other than `type(value, …)` (see above).
202
 
203
+ ## 4.0.0 (2013-03-19)
204
 
205
  * Support for more @-rules
206
  * Generic interface `Sabberworm\CSS\Property\AtRule`, implemented by all @-rule classes
207
  * *No deprecations*
208
 
209
+ ### Backwards-incompatible changes
210
 
211
  * `Sabberworm\CSS\RuleSet\AtRule` renamed to `Sabberworm\CSS\RuleSet\AtRuleSet`
212
  * `Sabberworm\CSS\CSSList\MediaQuery` renamed to `Sabberworm\CSS\RuleSet\CSSList\AtRuleBlockList` with differing semantics and API (which also works for other block-list-based @-rules like `@supports`).
213
 
214
+ ## 3.0.0 (2013-03-06)
 
 
215
 
216
  * Support for lenient parsing (on by default)
217
  * *No deprecations*
218
 
219
+ ### Backwards-incompatible changes
220
 
221
  * All properties (like whether or not to use `mb_`-functions, which default charset to use and – new – whether or not to be forgiving when parsing) are now encapsulated in an instance of `Sabberworm\CSS\Settings` which can be passed as the second argument to `Sabberworm\CSS\Parser->__construct()`.
222
  * Specifying a charset as the second argument to `Sabberworm\CSS\Parser->__construct()` is no longer supported. Use `Sabberworm\CSS\Settings::create()->withDefaultCharset('some-charset')` instead.
223
  * Setting `Sabberworm\CSS\Parser->bUseMbFunctions` has no effect. Use `Sabberworm\CSS\Settings::create()->withMultibyteSupport(true/false)` instead.
224
  * `Sabberworm\CSS\Parser->parse()` may throw a `Sabberworm\CSS\Parsing\UnexpectedTokenException` when in strict parsing mode.
225
 
226
+ ## 2.0.0 (2013-01-29)
 
 
227
 
228
  * Allow multiple rules of the same type per rule set
229
 
230
+ ### Backwards-incompatible changes
231
 
232
  * `Sabberworm\CSS\RuleSet->getRules()` returns an index-based array instead of an associative array. Use `Sabberworm\CSS\RuleSet->getRulesAssoc()` (which eliminates duplicate rules and lets the later rule of the same name win).
233
  * `Sabberworm\CSS\RuleSet->removeRule()` works as it did before except when passed an instance of `Sabberworm\CSS\Rule\Rule`, in which case it would only remove the exact rule given instead of all the rules of the same type. To get the old behaviour, use `Sabberworm\CSS\RuleSet->removeRule($oRule->getRule()`;
vendor/sabberworm/php-css-parser/Doxyfile DELETED
@@ -1,2310 +0,0 @@
1
- # Doxyfile 1.8.7
2
-
3
- # This file describes the settings to be used by the documentation system
4
- # doxygen (www.doxygen.org) for a project.
5
- #
6
- # All text after a double hash (##) is considered a comment and is placed in
7
- # front of the TAG it is preceding.
8
- #
9
- # All text after a single hash (#) is considered a comment and will be ignored.
10
- # The format is:
11
- # TAG = value [value, ...]
12
- # For lists, items can also be appended using:
13
- # TAG += value [value, ...]
14
- # Values that contain spaces should be placed between quotes (\" \").
15
-
16
- #---------------------------------------------------------------------------
17
- # Project related configuration options
18
- #---------------------------------------------------------------------------
19
-
20
- # This tag specifies the encoding used for all characters in the config file
21
- # that follow. The default is UTF-8 which is also the encoding used for all text
22
- # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
23
- # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
24
- # for the list of possible encodings.
25
- # The default value is: UTF-8.
26
-
27
- DOXYFILE_ENCODING = UTF-8
28
-
29
- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
30
- # double-quotes, unless you are using Doxywizard) that should identify the
31
- # project for which the documentation is generated. This name is used in the
32
- # title of most generated pages and in a few other places.
33
- # The default value is: My Project.
34
-
35
- PROJECT_NAME = "Sabberworm/PHP-CSS-Parser"
36
-
37
- # The PROJECT_NUMBER tag can be used to enter a project or revision number. This
38
- # could be handy for archiving the generated documentation or if some version
39
- # control system is used.
40
-
41
- PROJECT_NUMBER = "7.0.3"
42
-
43
- # Using the PROJECT_BRIEF tag one can provide an optional one line description
44
- # for a project that appears at the top of each page and should give viewer a
45
- # quick idea about the purpose of the project. Keep the description short.
46
-
47
- PROJECT_BRIEF = "A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS"
48
-
49
- # With the PROJECT_LOGO tag one can specify an logo or icon that is included in
50
- # the documentation. The maximum height of the logo should not exceed 55 pixels
51
- # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
52
- # to the output directory.
53
-
54
- PROJECT_LOGO =
55
-
56
- # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
57
- # into which the generated documentation will be written. If a relative path is
58
- # entered, it will be relative to the location where doxygen was started. If
59
- # left blank the current directory will be used.
60
-
61
- OUTPUT_DIRECTORY = "../PHP-CSS-Parser-Documentation"
62
-
63
- # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
64
- # directories (in 2 levels) under the output directory of each output format and
65
- # will distribute the generated files over these directories. Enabling this
66
- # option can be useful when feeding doxygen a huge amount of source files, where
67
- # putting all generated files in the same directory would otherwise causes
68
- # performance problems for the file system.
69
- # The default value is: NO.
70
-
71
- CREATE_SUBDIRS = NO
72
-
73
- # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
74
- # characters to appear in the names of generated files. If set to NO, non-ASCII
75
- # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
76
- # U+3044.
77
- # The default value is: NO.
78
-
79
- ALLOW_UNICODE_NAMES = NO
80
-
81
- # The OUTPUT_LANGUAGE tag is used to specify the language in which all
82
- # documentation generated by doxygen is written. Doxygen will use this
83
- # information to generate all constant output in the proper language.
84
- # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
85
- # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
86
- # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
87
- # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
88
- # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
89
- # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
90
- # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
91
- # Ukrainian and Vietnamese.
92
- # The default value is: English.
93
-
94
- OUTPUT_LANGUAGE = English
95
-
96
- # If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
97
- # descriptions after the members that are listed in the file and class
98
- # documentation (similar to Javadoc). Set to NO to disable this.
99
- # The default value is: YES.
100
-
101
- BRIEF_MEMBER_DESC = YES
102
-
103
- # If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
104
- # description of a member or function before the detailed description
105
- #
106
- # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
107
- # brief descriptions will be completely suppressed.
108
- # The default value is: YES.
109
-
110
- REPEAT_BRIEF = YES
111
-
112
- # This tag implements a quasi-intelligent brief description abbreviator that is
113
- # used to form the text in various listings. Each string in this list, if found
114
- # as the leading text of the brief description, will be stripped from the text
115
- # and the result, after processing the whole list, is used as the annotated
116
- # text. Otherwise, the brief description is used as-is. If left blank, the
117
- # following values are used ($name is automatically replaced with the name of
118
- # the entity):The $name class, The $name widget, The $name file, is, provides,
119
- # specifies, contains, represents, a, an and the.
120
-
121
- ABBREVIATE_BRIEF =
122
-
123
- # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
124
- # doxygen will generate a detailed section even if there is only a brief
125
- # description.
126
- # The default value is: NO.
127
-
128
- ALWAYS_DETAILED_SEC = NO
129
-
130
- # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
131
- # inherited members of a class in the documentation of that class as if those
132
- # members were ordinary class members. Constructors, destructors and assignment
133
- # operators of the base classes will not be shown.
134
- # The default value is: NO.
135
-
136
- INLINE_INHERITED_MEMB = NO
137
-
138
- # If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
139
- # before files name in the file list and in the header files. If set to NO the
140
- # shortest path that makes the file name unique will be used
141
- # The default value is: YES.
142
-
143
- FULL_PATH_NAMES = YES
144
-
145
- # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
146
- # Stripping is only done if one of the specified strings matches the left-hand
147
- # part of the path. The tag can be used to show relative paths in the file list.
148
- # If left blank the directory from which doxygen is run is used as the path to
149
- # strip.
150
- #
151
- # Note that you can specify absolute paths here, but also relative paths, which
152
- # will be relative from the directory where doxygen is started.
153
- # This tag requires that the tag FULL_PATH_NAMES is set to YES.
154
-
155
- STRIP_FROM_PATH = ./lib
156
-
157
- # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
158
- # path mentioned in the documentation of a class, which tells the reader which
159
- # header file to include in order to use a class. If left blank only the name of
160
- # the header file containing the class definition is used. Otherwise one should
161
- # specify the list of include paths that are normally passed to the compiler
162
- # using the -I flag.
163
-
164
- STRIP_FROM_INC_PATH =
165
-
166
- # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
167
- # less readable) file names. This can be useful is your file systems doesn't
168
- # support long names like on DOS, Mac, or CD-ROM.
169
- # The default value is: NO.
170
-
171
- SHORT_NAMES = NO
172
-
173
- # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
174
- # first line (until the first dot) of a Javadoc-style comment as the brief
175
- # description. If set to NO, the Javadoc-style will behave just like regular Qt-
176
- # style comments (thus requiring an explicit @brief command for a brief
177
- # description.)
178
- # The default value is: NO.
179
-
180
- JAVADOC_AUTOBRIEF = YES
181
-
182
- # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
183
- # line (until the first dot) of a Qt-style comment as the brief description. If
184
- # set to NO, the Qt-style will behave just like regular Qt-style comments (thus
185
- # requiring an explicit \brief command for a brief description.)
186
- # The default value is: NO.
187
-
188
- QT_AUTOBRIEF = YES
189
-
190
- # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
191
- # multi-line C++ special comment block (i.e. a block of //! or /// comments) as
192
- # a brief description. This used to be the default behavior. The new default is
193
- # to treat a multi-line C++ comment block as a detailed description. Set this
194
- # tag to YES if you prefer the old behavior instead.
195
- #
196
- # Note that setting this tag to YES also means that rational rose comments are
197
- # not recognized any more.
198
- # The default value is: NO.
199
-
200
- MULTILINE_CPP_IS_BRIEF = YES
201
-
202
- # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
203
- # documentation from any documented member that it re-implements.
204
- # The default value is: YES.
205
-
206
- INHERIT_DOCS = YES
207
-
208
- # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
209
- # new page for each member. If set to NO, the documentation of a member will be
210
- # part of the file/class/namespace that contains it.
211
- # The default value is: NO.
212
-
213
- SEPARATE_MEMBER_PAGES = NO
214
-
215
- # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
216
- # uses this value to replace tabs by spaces in code fragments.
217
- # Minimum value: 1, maximum value: 16, default value: 4.
218
-
219
- TAB_SIZE = 2
220
-
221
- # This tag can be used to specify a number of aliases that act as commands in
222
- # the documentation. An alias has the form:
223
- # name=value
224
- # For example adding
225
- # "sideeffect=@par Side Effects:\n"
226
- # will allow you to put the command \sideeffect (or @sideeffect) in the
227
- # documentation, which will result in a user-defined paragraph with heading
228
- # "Side Effects:". You can put \n's in the value part of an alias to insert
229
- # newlines.
230
-
231
- ALIASES =
232
-
233
- # This tag can be used to specify a number of word-keyword mappings (TCL only).
234
- # A mapping has the form "name=value". For example adding "class=itcl::class"
235
- # will allow you to use the command class in the itcl::class meaning.
236
-
237
- TCL_SUBST =
238
-
239
- # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
240
- # only. Doxygen will then generate output that is more tailored for C. For
241
- # instance, some of the names that are used will be different. The list of all
242
- # members will be omitted, etc.
243
- # The default value is: NO.
244
-
245
- OPTIMIZE_OUTPUT_FOR_C = NO
246
-
247
- # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
248
- # Python sources only. Doxygen will then generate output that is more tailored
249
- # for that language. For instance, namespaces will be presented as packages,
250
- # qualified scopes will look different, etc.
251
- # The default value is: NO.
252
-
253
- OPTIMIZE_OUTPUT_JAVA = NO
254
-
255
- # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
256
- # sources. Doxygen will then generate output that is tailored for Fortran.
257
- # The default value is: NO.
258
-
259
- OPTIMIZE_FOR_FORTRAN = NO
260
-
261
- # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
262
- # sources. Doxygen will then generate output that is tailored for VHDL.
263
- # The default value is: NO.
264
-
265
- OPTIMIZE_OUTPUT_VHDL = NO
266
-
267
- # Doxygen selects the parser to use depending on the extension of the files it
268
- # parses. With this tag you can assign which parser to use for a given
269
- # extension. Doxygen has a built-in mapping, but you can override or extend it
270
- # using this tag. The format is ext=language, where ext is a file extension, and
271
- # language is one of the parsers supported by doxygen: IDL, Java, Javascript,
272
- # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
273
- # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
274
- # Fortran. In the later case the parser tries to guess whether the code is fixed
275
- # or free formatted code, this is the default for Fortran type files), VHDL. For
276
- # instance to make doxygen treat .inc files as Fortran files (default is PHP),
277
- # and .f files as C (default is Fortran), use: inc=Fortran f=C.
278
- #
279
- # Note For files without extension you can use no_extension as a placeholder.
280
- #
281
- # Note that for custom extensions you also need to set FILE_PATTERNS otherwise
282
- # the files are not read by doxygen.
283
-
284
- EXTENSION_MAPPING =
285
-
286
- # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
287
- # according to the Markdown format, which allows for more readable
288
- # documentation. See http://daringfireball.net/projects/markdown/ for details.
289
- # The output of markdown processing is further processed by doxygen, so you can
290
- # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
291
- # case of backward compatibilities issues.
292
- # The default value is: YES.
293
-
294
- MARKDOWN_SUPPORT = YES
295
-
296
- # When enabled doxygen tries to link words that correspond to documented
297
- # classes, or namespaces to their corresponding documentation. Such a link can
298
- # be prevented in individual cases by by putting a % sign in front of the word
299
- # or globally by setting AUTOLINK_SUPPORT to NO.
300
- # The default value is: YES.
301
-
302
- AUTOLINK_SUPPORT = YES
303
-
304
- # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
305
- # to include (a tag file for) the STL sources as input, then you should set this
306
- # tag to YES in order to let doxygen match functions declarations and
307
- # definitions whose arguments contain STL classes (e.g. func(std::string);
308
- # versus func(std::string) {}). This also make the inheritance and collaboration
309
- # diagrams that involve STL classes more complete and accurate.
310
- # The default value is: NO.
311
-
312
- BUILTIN_STL_SUPPORT = NO
313
-
314
- # If you use Microsoft's C++/CLI language, you should set this option to YES to
315
- # enable parsing support.
316
- # The default value is: NO.
317
-
318
- CPP_CLI_SUPPORT = NO
319
-
320
- # Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
321
- # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
322
- # will parse them like normal C++ but will assume all classes use public instead
323
- # of private inheritance when no explicit protection keyword is present.
324
- # The default value is: NO.
325
-
326
- SIP_SUPPORT = NO
327
-
328
- # For Microsoft's IDL there are propget and propput attributes to indicate
329
- # getter and setter methods for a property. Setting this option to YES will make
330
- # doxygen to replace the get and set methods by a property in the documentation.
331
- # This will only work if the methods are indeed getting or setting a simple
332
- # type. If this is not the case, or you want to show the methods anyway, you
333
- # should set this option to NO.
334
- # The default value is: YES.
335
-
336
- IDL_PROPERTY_SUPPORT = YES
337
-
338
- # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
339
- # tag is set to YES, then doxygen will reuse the documentation of the first
340
- # member in the group (if any) for the other members of the group. By default
341
- # all members of a group must be documented explicitly.
342
- # The default value is: NO.
343
-
344
- DISTRIBUTE_GROUP_DOC = NO
345
-
346
- # Set the SUBGROUPING tag to YES to allow class member groups of the same type
347
- # (for instance a group of public functions) to be put as a subgroup of that
348
- # type (e.g. under the Public Functions section). Set it to NO to prevent
349
- # subgrouping. Alternatively, this can be done per class using the
350
- # \nosubgrouping command.
351
- # The default value is: YES.
352
-
353
- SUBGROUPING = YES
354
-
355
- # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
356
- # are shown inside the group in which they are included (e.g. using \ingroup)
357
- # instead of on a separate page (for HTML and Man pages) or section (for LaTeX
358
- # and RTF).
359
- #
360
- # Note that this feature does not work in combination with
361
- # SEPARATE_MEMBER_PAGES.
362
- # The default value is: NO.
363
-
364
- INLINE_GROUPED_CLASSES = NO
365
-
366
- # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
367
- # with only public data fields or simple typedef fields will be shown inline in
368
- # the documentation of the scope in which they are defined (i.e. file,
369
- # namespace, or group documentation), provided this scope is documented. If set
370
- # to NO, structs, classes, and unions are shown on a separate page (for HTML and
371
- # Man pages) or section (for LaTeX and RTF).
372
- # The default value is: NO.
373
-
374
- INLINE_SIMPLE_STRUCTS = NO
375
-
376
- # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
377
- # enum is documented as struct, union, or enum with the name of the typedef. So
378
- # typedef struct TypeS {} TypeT, will appear in the documentation as a struct
379
- # with name TypeT. When disabled the typedef will appear as a member of a file,
380
- # namespace, or class. And the struct will be named TypeS. This can typically be
381
- # useful for C code in case the coding convention dictates that all compound
382
- # types are typedef'ed and only the typedef is referenced, never the tag name.
383
- # The default value is: NO.
384
-
385
- TYPEDEF_HIDES_STRUCT = NO
386
-
387
- # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
388
- # cache is used to resolve symbols given their name and scope. Since this can be
389
- # an expensive process and often the same symbol appears multiple times in the
390
- # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
391
- # doxygen will become slower. If the cache is too large, memory is wasted. The
392
- # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
393
- # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
394
- # symbols. At the end of a run doxygen will report the cache usage and suggest
395
- # the optimal cache size from a speed point of view.
396
- # Minimum value: 0, maximum value: 9, default value: 0.
397
-
398
- LOOKUP_CACHE_SIZE = 0
399
-
400
- #---------------------------------------------------------------------------
401
- # Build related configuration options
402
- #---------------------------------------------------------------------------
403
-
404
- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
405
- # documentation are documented, even if no documentation was available. Private
406
- # class members and static file members will be hidden unless the
407
- # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
408
- # Note: This will also disable the warnings about undocumented members that are
409
- # normally produced when WARNINGS is set to YES.
410
- # The default value is: NO.
411
-
412
- EXTRACT_ALL = NO
413
-
414
- # If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
415
- # be included in the documentation.
416
- # The default value is: NO.
417
-
418
- EXTRACT_PRIVATE = NO
419
-
420
- # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
421
- # scope will be included in the documentation.
422
- # The default value is: NO.
423
-
424
- EXTRACT_PACKAGE = NO
425
-
426
- # If the EXTRACT_STATIC tag is set to YES all static members of a file will be
427
- # included in the documentation.
428
- # The default value is: NO.
429
-
430
- EXTRACT_STATIC = NO
431
-
432
- # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
433
- # locally in source files will be included in the documentation. If set to NO
434
- # only classes defined in header files are included. Does not have any effect
435
- # for Java sources.
436
- # The default value is: YES.
437
-
438
- EXTRACT_LOCAL_CLASSES = YES
439
-
440
- # This flag is only useful for Objective-C code. When set to YES local methods,
441
- # which are defined in the implementation section but not in the interface are
442
- # included in the documentation. If set to NO only methods in the interface are
443
- # included.
444
- # The default value is: NO.
445
-
446
- EXTRACT_LOCAL_METHODS = NO
447
-
448
- # If this flag is set to YES, the members of anonymous namespaces will be
449
- # extracted and appear in the documentation as a namespace called
450
- # 'anonymous_namespace{file}', where file will be replaced with the base name of
451
- # the file that contains the anonymous namespace. By default anonymous namespace
452
- # are hidden.
453
- # The default value is: NO.
454
-
455
- EXTRACT_ANON_NSPACES = NO
456
-
457
- # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
458
- # undocumented members inside documented classes or files. If set to NO these
459
- # members will be included in the various overviews, but no documentation
460
- # section is generated. This option has no effect if EXTRACT_ALL is enabled.
461
- # The default value is: NO.
462
-
463
- HIDE_UNDOC_MEMBERS = NO
464
-
465
- # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
466
- # undocumented classes that are normally visible in the class hierarchy. If set
467
- # to NO these classes will be included in the various overviews. This option has
468
- # no effect if EXTRACT_ALL is enabled.
469
- # The default value is: NO.
470
-
471
- HIDE_UNDOC_CLASSES = NO
472
-
473
- # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
474
- # (class|struct|union) declarations. If set to NO these declarations will be
475
- # included in the documentation.
476
- # The default value is: NO.
477
-
478
- HIDE_FRIEND_COMPOUNDS = NO
479
-
480
- # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
481
- # documentation blocks found inside the body of a function. If set to NO these
482
- # blocks will be appended to the function's detailed documentation block.
483
- # The default value is: NO.
484
-
485
- HIDE_IN_BODY_DOCS = NO
486
-
487
- # The INTERNAL_DOCS tag determines if documentation that is typed after a
488
- # \internal command is included. If the tag is set to NO then the documentation
489
- # will be excluded. Set it to YES to include the internal documentation.
490
- # The default value is: NO.
491
-
492
- INTERNAL_DOCS = NO
493
-
494
- # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
495
- # names in lower-case letters. If set to YES upper-case letters are also
496
- # allowed. This is useful if you have classes or files whose names only differ
497
- # in case and if your file system supports case sensitive file names. Windows
498
- # and Mac users are advised to set this option to NO.
499
- # The default value is: system dependent.
500
-
501
- CASE_SENSE_NAMES = NO
502
-
503
- # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
504
- # their full class and namespace scopes in the documentation. If set to YES the
505
- # scope will be hidden.
506
- # The default value is: NO.
507
-
508
- HIDE_SCOPE_NAMES = YES
509
-
510
- # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
511
- # the files that are included by a file in the documentation of that file.
512
- # The default value is: YES.
513
-
514
- SHOW_INCLUDE_FILES = YES
515
-
516
- # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
517
- # grouped member an include statement to the documentation, telling the reader
518
- # which file to include in order to use the member.
519
- # The default value is: NO.
520
-
521
- SHOW_GROUPED_MEMB_INC = NO
522
-
523
- # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
524
- # files with double quotes in the documentation rather than with sharp brackets.
525
- # The default value is: NO.
526
-
527
- FORCE_LOCAL_INCLUDES = NO
528
-
529
- # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
530
- # documentation for inline members.
531
- # The default value is: YES.
532
-
533
- INLINE_INFO = YES
534
-
535
- # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
536
- # (detailed) documentation of file and class members alphabetically by member
537
- # name. If set to NO the members will appear in declaration order.
538
- # The default value is: YES.
539
-
540
- SORT_MEMBER_DOCS = YES
541
-
542
- # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
543
- # descriptions of file, namespace and class members alphabetically by member
544
- # name. If set to NO the members will appear in declaration order. Note that
545
- # this will also influence the order of the classes in the class list.
546
- # The default value is: NO.
547
-
548
- SORT_BRIEF_DOCS = NO
549
-
550
- # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
551
- # (brief and detailed) documentation of class members so that constructors and
552
- # destructors are listed first. If set to NO the constructors will appear in the
553
- # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
554
- # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
555
- # member documentation.
556
- # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
557
- # detailed member documentation.
558
- # The default value is: NO.
559
-
560
- SORT_MEMBERS_CTORS_1ST = NO
561
-
562
- # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
563
- # of group names into alphabetical order. If set to NO the group names will
564
- # appear in their defined order.
565
- # The default value is: NO.
566
-
567
- SORT_GROUP_NAMES = NO
568
-
569
- # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
570
- # fully-qualified names, including namespaces. If set to NO, the class list will
571
- # be sorted only by class name, not including the namespace part.
572
- # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
573
- # Note: This option applies only to the class list, not to the alphabetical
574
- # list.
575
- # The default value is: NO.
576
-
577
- SORT_BY_SCOPE_NAME = NO
578
-
579
- # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
580
- # type resolution of all parameters of a function it will reject a match between
581
- # the prototype and the implementation of a member function even if there is
582
- # only one candidate or it is obvious which candidate to choose by doing a
583
- # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
584
- # accept a match between prototype and implementation in such cases.
585
- # The default value is: NO.
586
-
587
- STRICT_PROTO_MATCHING = NO
588
-
589
- # The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
590
- # todo list. This list is created by putting \todo commands in the
591
- # documentation.
592
- # The default value is: YES.
593
-
594
- GENERATE_TODOLIST = YES
595
-
596
- # The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
597
- # test list. This list is created by putting \test commands in the
598
- # documentation.
599
- # The default value is: YES.
600
-
601
- GENERATE_TESTLIST = YES
602
-
603
- # The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
604
- # list. This list is created by putting \bug commands in the documentation.
605
- # The default value is: YES.
606
-
607
- GENERATE_BUGLIST = YES
608
-
609
- # The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
610
- # the deprecated list. This list is created by putting \deprecated commands in
611
- # the documentation.
612
- # The default value is: YES.
613
-
614
- GENERATE_DEPRECATEDLIST= YES
615
-
616
- # The ENABLED_SECTIONS tag can be used to enable conditional documentation
617
- # sections, marked by \if <section_label> ... \endif and \cond <section_label>
618
- # ... \endcond blocks.
619
-
620
- ENABLED_SECTIONS =
621
-
622
- # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
623
- # initial value of a variable or macro / define can have for it to appear in the
624
- # documentation. If the initializer consists of more lines than specified here
625
- # it will be hidden. Use a value of 0 to hide initializers completely. The
626
- # appearance of the value of individual variables and macros / defines can be
627
- # controlled using \showinitializer or \hideinitializer command in the
628
- # documentation regardless of this setting.
629
- # Minimum value: 0, maximum value: 10000, default value: 30.
630
-
631
- MAX_INITIALIZER_LINES = 30
632
-
633
- # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
634
- # the bottom of the documentation of classes and structs. If set to YES the list
635
- # will mention the files that were used to generate the documentation.
636
- # The default value is: YES.
637
-
638
- SHOW_USED_FILES = YES
639
-
640
- # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
641
- # will remove the Files entry from the Quick Index and from the Folder Tree View
642
- # (if specified).
643
- # The default value is: YES.
644
-
645
- SHOW_FILES = YES
646
-
647
- # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
648
- # page. This will remove the Namespaces entry from the Quick Index and from the
649
- # Folder Tree View (if specified).
650
- # The default value is: YES.
651
-
652
- SHOW_NAMESPACES = NO
653
-
654
- # The FILE_VERSION_FILTER tag can be used to specify a program or script that
655
- # doxygen should invoke to get the current version for each file (typically from
656
- # the version control system). Doxygen will invoke the program by executing (via
657
- # popen()) the command command input-file, where command is the value of the
658
- # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
659
- # by doxygen. Whatever the program writes to standard output is used as the file
660
- # version. For an example see the documentation.
661
-
662
- FILE_VERSION_FILTER =
663
-
664
- # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
665
- # by doxygen. The layout file controls the global structure of the generated
666
- # output files in an output format independent way. To create the layout file
667
- # that represents doxygen's defaults, run doxygen with the -l option. You can
668
- # optionally specify a file name after the option, if omitted DoxygenLayout.xml
669
- # will be used as the name of the layout file.
670
- #
671
- # Note that if you run doxygen from a directory containing a file called
672
- # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
673
- # tag is left empty.
674
-
675
- LAYOUT_FILE =
676
-
677
- # The CITE_BIB_FILES tag can be used to specify one or more bib files containing
678
- # the reference definitions. This must be a list of .bib files. The .bib
679
- # extension is automatically appended if omitted. This requires the bibtex tool
680
- # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
681
- # For LaTeX the style of the bibliography can be controlled using
682
- # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
683
- # search path. Do not use file names with spaces, bibtex cannot handle them. See
684
- # also \cite for info how to create references.
685
-
686
- CITE_BIB_FILES =
687
-
688
- #---------------------------------------------------------------------------
689
- # Configuration options related to warning and progress messages
690
- #---------------------------------------------------------------------------
691
-
692
- # The QUIET tag can be used to turn on/off the messages that are generated to
693
- # standard output by doxygen. If QUIET is set to YES this implies that the
694
- # messages are off.
695
- # The default value is: NO.
696
-
697
- QUIET = NO
698
-
699
- # The WARNINGS tag can be used to turn on/off the warning messages that are
700
- # generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
701
- # this implies that the warnings are on.
702
- #
703
- # Tip: Turn warnings on while writing the documentation.
704
- # The default value is: YES.
705
-
706
- WARNINGS = YES
707
-
708
- # If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
709
- # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
710
- # will automatically be disabled.
711
- # The default value is: YES.
712
-
713
- WARN_IF_UNDOCUMENTED = YES
714
-
715
- # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
716
- # potential errors in the documentation, such as not documenting some parameters
717
- # in a documented function, or documenting parameters that don't exist or using
718
- # markup commands wrongly.
719
- # The default value is: YES.
720
-
721
- WARN_IF_DOC_ERROR = YES
722
-
723
- # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
724
- # are documented, but have no documentation for their parameters or return
725
- # value. If set to NO doxygen will only warn about wrong or incomplete parameter
726
- # documentation, but not about the absence of documentation.
727
- # The default value is: NO.
728
-
729
- WARN_NO_PARAMDOC = NO
730
-
731
- # The WARN_FORMAT tag determines the format of the warning messages that doxygen
732
- # can produce. The string should contain the $file, $line, and $text tags, which
733
- # will be replaced by the file and line number from which the warning originated
734
- # and the warning text. Optionally the format may contain $version, which will
735
- # be replaced by the version of the file (if it could be obtained via
736
- # FILE_VERSION_FILTER)
737
- # The default value is: $file:$line: $text.
738
-
739
- WARN_FORMAT = "$file:$line: $text"
740
-
741
- # The WARN_LOGFILE tag can be used to specify a file to which warning and error
742
- # messages should be written. If left blank the output is written to standard
743
- # error (stderr).
744
-
745
- WARN_LOGFILE =
746
-
747
- #---------------------------------------------------------------------------
748
- # Configuration options related to the input files
749
- #---------------------------------------------------------------------------
750
-
751
- # The INPUT tag is used to specify the files and/or directories that contain
752
- # documented source files. You may enter file names like myfile.cpp or
753
- # directories like /usr/src/myproject. Separate the files or directories with
754
- # spaces.
755
- # Note: If this tag is empty the current directory is searched.
756
-
757
- INPUT =
758
-
759
- # This tag can be used to specify the character encoding of the source files
760
- # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
761
- # libiconv (or the iconv built into libc) for the transcoding. See the libiconv
762
- # documentation (see: http://www.gnu.org/software/libiconv) for the list of
763
- # possible encodings.
764
- # The default value is: UTF-8.
765
-
766
- INPUT_ENCODING = UTF-8
767
-
768
- # If the value of the INPUT tag contains directories, you can use the
769
- # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
770
- # *.h) to filter out the source-files in the directories. If left blank the
771
- # following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
772
- # *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
773
- # *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
774
- # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
775
- # *.qsf, *.as and *.js.
776
-
777
- FILE_PATTERNS =
778
-
779
- # The RECURSIVE tag can be used to specify whether or not subdirectories should
780
- # be searched for input files as well.
781
- # The default value is: NO.
782
-
783
- RECURSIVE = YES
784
-
785
- # The EXCLUDE tag can be used to specify files and/or directories that should be
786
- # excluded from the INPUT source files. This way you can easily exclude a
787
- # subdirectory from a directory tree whose root is specified with the INPUT tag.
788
- #
789
- # Note that relative paths are relative to the directory from which doxygen is
790
- # run.
791
-
792
- EXCLUDE = tests
793
-
794
- # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
795
- # directories that are symbolic links (a Unix file system feature) are excluded
796
- # from the input.
797
- # The default value is: NO.
798
-
799
- EXCLUDE_SYMLINKS = NO
800
-
801
- # If the value of the INPUT tag contains directories, you can use the
802
- # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
803
- # certain files from those directories.
804
- #
805
- # Note that the wildcards are matched against the file with absolute path, so to
806
- # exclude all test directories for example use the pattern */test/*
807
-
808
- EXCLUDE_PATTERNS =
809
-
810
- # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
811
- # (namespaces, classes, functions, etc.) that should be excluded from the
812
- # output. The symbol name can be a fully qualified name, a word, or if the
813
- # wildcard * is used, a substring. Examples: ANamespace, AClass,
814
- # AClass::ANamespace, ANamespace::*Test
815
- #
816
- # Note that the wildcards are matched against the file with absolute path, so to
817
- # exclude all test directories use the pattern */test/*
818
-
819
- EXCLUDE_SYMBOLS =
820
-
821
- # The EXAMPLE_PATH tag can be used to specify one or more files or directories
822
- # that contain example code fragments that are included (see the \include
823
- # command).
824
-
825
- EXAMPLE_PATH =
826
-
827
- # If the value of the EXAMPLE_PATH tag contains directories, you can use the
828
- # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
829
- # *.h) to filter out the source-files in the directories. If left blank all
830
- # files are included.
831
-
832
- EXAMPLE_PATTERNS =
833
-
834
- # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
835
- # searched for input files to be used with the \include or \dontinclude commands
836
- # irrespective of the value of the RECURSIVE tag.
837
- # The default value is: NO.
838
-
839
- EXAMPLE_RECURSIVE = NO
840
-
841
- # The IMAGE_PATH tag can be used to specify one or more files or directories
842
- # that contain images that are to be included in the documentation (see the
843
- # \image command).
844
-
845
- IMAGE_PATH =
846
-
847
- # The INPUT_FILTER tag can be used to specify a program that doxygen should
848
- # invoke to filter for each input file. Doxygen will invoke the filter program
849
- # by executing (via popen()) the command:
850
- #
851
- # <filter> <input-file>
852
- #
853
- # where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
854
- # name of an input file. Doxygen will then use the output that the filter
855
- # program writes to standard output. If FILTER_PATTERNS is specified, this tag
856
- # will be ignored.
857
- #
858
- # Note that the filter must not add or remove lines; it is applied before the
859
- # code is scanned, but not when the output code is generated. If lines are added
860
- # or removed, the anchors will not be placed correctly.
861
-
862
- INPUT_FILTER =
863
-
864
- # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
865
- # basis. Doxygen will compare the file name with each pattern and apply the
866
- # filter if there is a match. The filters are a list of the form: pattern=filter
867
- # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
868
- # filters are used. If the FILTER_PATTERNS tag is empty or if none of the
869
- # patterns match the file name, INPUT_FILTER is applied.
870
-
871
- FILTER_PATTERNS =
872
-
873
- # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
874
- # INPUT_FILTER ) will also be used to filter the input files that are used for
875
- # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
876
- # The default value is: NO.
877
-
878
- FILTER_SOURCE_FILES = NO
879
-
880
- # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
881
- # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
882
- # it is also possible to disable source filtering for a specific pattern using
883
- # *.ext= (so without naming a filter).
884
- # This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
885
-
886
- FILTER_SOURCE_PATTERNS =
887
-
888
- # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
889
- # is part of the input, its contents will be placed on the main page
890
- # (index.html). This can be useful if you have a project on for instance GitHub
891
- # and want to reuse the introduction page also for the doxygen output.
892
-
893
- USE_MDFILE_AS_MAINPAGE = README.md
894
-
895
- #---------------------------------------------------------------------------
896
- # Configuration options related to source browsing
897
- #---------------------------------------------------------------------------
898
-
899
- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be
900
- # generated. Documented entities will be cross-referenced with these sources.
901
- #
902
- # Note: To get rid of all source code in the generated output, make sure that
903
- # also VERBATIM_HEADERS is set to NO.
904
- # The default value is: NO.
905
-
906
- SOURCE_BROWSER = NO
907
-
908
- # Setting the INLINE_SOURCES tag to YES will include the body of functions,
909
- # classes and enums directly into the documentation.
910
- # The default value is: NO.
911
-
912
- INLINE_SOURCES = NO
913
-
914
- # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
915
- # special comment blocks from generated source code fragments. Normal C, C++ and
916
- # Fortran comments will always remain visible.
917
- # The default value is: YES.
918
-
919
- STRIP_CODE_COMMENTS = YES
920
-
921
- # If the REFERENCED_BY_RELATION tag is set to YES then for each documented
922
- # function all documented functions referencing it will be listed.
923
- # The default value is: NO.
924
-
925
- REFERENCED_BY_RELATION = NO
926
-
927
- # If the REFERENCES_RELATION tag is set to YES then for each documented function
928
- # all documented entities called/used by that function will be listed.
929
- # The default value is: NO.
930
-
931
- REFERENCES_RELATION = NO
932
-
933
- # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
934
- # to YES, then the hyperlinks from functions in REFERENCES_RELATION and
935
- # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
936
- # link to the documentation.
937
- # The default value is: YES.
938
-
939
- REFERENCES_LINK_SOURCE = YES
940
-
941
- # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
942
- # source code will show a tooltip with additional information such as prototype,
943
- # brief description and links to the definition and documentation. Since this
944
- # will make the HTML file larger and loading of large files a bit slower, you
945
- # can opt to disable this feature.
946
- # The default value is: YES.
947
- # This tag requires that the tag SOURCE_BROWSER is set to YES.
948
-
949
- SOURCE_TOOLTIPS = YES
950
-
951
- # If the USE_HTAGS tag is set to YES then the references to source code will
952
- # point to the HTML generated by the htags(1) tool instead of doxygen built-in
953
- # source browser. The htags tool is part of GNU's global source tagging system
954
- # (see http://www.gnu.org/software/global/global.html). You will need version
955
- # 4.8.6 or higher.
956
- #
957
- # To use it do the following:
958
- # - Install the latest version of global
959
- # - Enable SOURCE_BROWSER and USE_HTAGS in the config file
960
- # - Make sure the INPUT points to the root of the source tree
961
- # - Run doxygen as normal
962
- #
963
- # Doxygen will invoke htags (and that will in turn invoke gtags), so these
964
- # tools must be available from the command line (i.e. in the search path).
965
- #
966
- # The result: instead of the source browser generated by doxygen, the links to
967
- # source code will now point to the output of htags.
968
- # The default value is: NO.
969
- # This tag requires that the tag SOURCE_BROWSER is set to YES.
970
-
971
- USE_HTAGS = NO
972
-
973
- # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
974
- # verbatim copy of the header file for each class for which an include is
975
- # specified. Set to NO to disable this.
976
- # See also: Section \class.
977
- # The default value is: YES.
978
-
979
- VERBATIM_HEADERS = YES
980
-
981
- #---------------------------------------------------------------------------
982
- # Configuration options related to the alphabetical class index
983
- #---------------------------------------------------------------------------
984
-
985
- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
986
- # compounds will be generated. Enable this if the project contains a lot of
987
- # classes, structs, unions or interfaces.
988
- # The default value is: YES.
989
-
990
- ALPHABETICAL_INDEX = YES
991
-
992
- # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
993
- # which the alphabetical index list will be split.
994
- # Minimum value: 1, maximum value: 20, default value: 5.
995
- # This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
996
-
997
- COLS_IN_ALPHA_INDEX = 5
998
-
999
- # In case all classes in a project start with a common prefix, all classes will
1000
- # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
1001
- # can be used to specify a prefix (or a list of prefixes) that should be ignored
1002
- # while generating the index headers.
1003
- # This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
1004
-
1005
- IGNORE_PREFIX =
1006
-
1007
- #---------------------------------------------------------------------------
1008
- # Configuration options related to the HTML output
1009
- #---------------------------------------------------------------------------
1010
-
1011
- # If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
1012
- # The default value is: YES.
1013
-
1014
- GENERATE_HTML = YES
1015
-
1016
- # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
1017
- # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
1018
- # it.
1019
- # The default directory is: html.
1020
- # This tag requires that the tag GENERATE_HTML is set to YES.
1021
-
1022
- HTML_OUTPUT = .
1023
-
1024
- # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
1025
- # generated HTML page (for example: .htm, .php, .asp).
1026
- # The default value is: .html.
1027
- # This tag requires that the tag GENERATE_HTML is set to YES.
1028
-
1029
- HTML_FILE_EXTENSION = .html
1030
-
1031
- # The HTML_HEADER tag can be used to specify a user-defined HTML header file for
1032
- # each generated HTML page. If the tag is left blank doxygen will generate a
1033
- # standard header.
1034
- #
1035
- # To get valid HTML the header file that includes any scripts and style sheets
1036
- # that doxygen needs, which is dependent on the configuration options used (e.g.
1037
- # the setting GENERATE_TREEVIEW). It is highly recommended to start with a
1038
- # default header using
1039
- # doxygen -w html new_header.html new_footer.html new_stylesheet.css
1040
- # YourConfigFile
1041
- # and then modify the file new_header.html. See also section "Doxygen usage"
1042
- # for information on how to generate the default header that doxygen normally
1043
- # uses.
1044
- # Note: The header is subject to change so you typically have to regenerate the
1045
- # default header when upgrading to a newer version of doxygen. For a description
1046
- # of the possible markers and block names see the documentation.
1047
- # This tag requires that the tag GENERATE_HTML is set to YES.
1048
-
1049
- HTML_HEADER =
1050
-
1051
- # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
1052
- # generated HTML page. If the tag is left blank doxygen will generate a standard
1053
- # footer. See HTML_HEADER for more information on how to generate a default
1054
- # footer and what special commands can be used inside the footer. See also
1055
- # section "Doxygen usage" for information on how to generate the default footer
1056
- # that doxygen normally uses.
1057
- # This tag requires that the tag GENERATE_HTML is set to YES.
1058
-
1059
- HTML_FOOTER =
1060
-
1061
- # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
1062
- # sheet that is used by each HTML page. It can be used to fine-tune the look of
1063
- # the HTML output. If left blank doxygen will generate a default style sheet.
1064
- # See also section "Doxygen usage" for information on how to generate the style
1065
- # sheet that doxygen normally uses.
1066
- # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
1067
- # it is more robust and this tag (HTML_STYLESHEET) will in the future become
1068
- # obsolete.
1069
- # This tag requires that the tag GENERATE_HTML is set to YES.
1070
-
1071
- HTML_STYLESHEET =
1072
-
1073
- # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
1074
- # defined cascading style sheet that is included after the standard style sheets
1075
- # created by doxygen. Using this option one can overrule certain style aspects.
1076
- # This is preferred over using HTML_STYLESHEET since it does not replace the
1077
- # standard style sheet and is therefor more robust against future updates.
1078
- # Doxygen will copy the style sheet file to the output directory. For an example
1079
- # see the documentation.
1080
- # This tag requires that the tag GENERATE_HTML is set to YES.
1081
-
1082
- HTML_EXTRA_STYLESHEET =
1083
-
1084
- # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
1085
- # other source files which should be copied to the HTML output directory. Note
1086
- # that these files will be copied to the base HTML output directory. Use the
1087
- # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
1088
- # files. In the HTML_STYLESHEET file, use the file name only. Also note that the
1089
- # files will be copied as-is; there are no commands or markers available.
1090
- # This tag requires that the tag GENERATE_HTML is set to YES.
1091
-
1092
- HTML_EXTRA_FILES =
1093
-
1094
- # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
1095
- # will adjust the colors in the stylesheet and background images according to
1096
- # this color. Hue is specified as an angle on a colorwheel, see
1097
- # http://en.wikipedia.org/wiki/Hue for more information. For instance the value
1098
- # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
1099
- # purple, and 360 is red again.
1100
- # Minimum value: 0, maximum value: 359, default value: 220.
1101
- # This tag requires that the tag GENERATE_HTML is set to YES.
1102
-
1103
- HTML_COLORSTYLE_HUE = 220
1104
-
1105
- # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
1106
- # in the HTML output. For a value of 0 the output will use grayscales only. A
1107
- # value of 255 will produce the most vivid colors.
1108
- # Minimum value: 0, maximum value: 255, default value: 100.
1109
- # This tag requires that the tag GENERATE_HTML is set to YES.
1110
-
1111
- HTML_COLORSTYLE_SAT = 100
1112
-
1113
- # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
1114
- # luminance component of the colors in the HTML output. Values below 100
1115
- # gradually make the output lighter, whereas values above 100 make the output
1116
- # darker. The value divided by 100 is the actual gamma applied, so 80 represents
1117
- # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
1118
- # change the gamma.
1119
- # Minimum value: 40, maximum value: 240, default value: 80.
1120
- # This tag requires that the tag GENERATE_HTML is set to YES.
1121
-
1122
- HTML_COLORSTYLE_GAMMA = 80
1123
-
1124
- # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
1125
- # page will contain the date and time when the page was generated. Setting this
1126
- # to NO can help when comparing the output of multiple runs.
1127
- # The default value is: YES.
1128
- # This tag requires that the tag GENERATE_HTML is set to YES.
1129
-
1130
- HTML_TIMESTAMP = YES
1131
-
1132
- # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
1133
- # documentation will contain sections that can be hidden and shown after the
1134
- # page has loaded.
1135
- # The default value is: NO.
1136
- # This tag requires that the tag GENERATE_HTML is set to YES.
1137
-
1138
- HTML_DYNAMIC_SECTIONS = NO
1139
-
1140
- # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
1141
- # shown in the various tree structured indices initially; the user can expand
1142
- # and collapse entries dynamically later on. Doxygen will expand the tree to
1143
- # such a level that at most the specified number of entries are visible (unless
1144
- # a fully collapsed tree already exceeds this amount). So setting the number of
1145
- # entries 1 will produce a full collapsed tree by default. 0 is a special value
1146
- # representing an infinite number of entries and will result in a full expanded
1147
- # tree by default.
1148
- # Minimum value: 0, maximum value: 9999, default value: 100.
1149
- # This tag requires that the tag GENERATE_HTML is set to YES.
1150
-
1151
- HTML_INDEX_NUM_ENTRIES = 100
1152
-
1153
- # If the GENERATE_DOCSET tag is set to YES, additional index files will be
1154
- # generated that can be used as input for Apple's Xcode 3 integrated development
1155
- # environment (see: http://developer.apple.com/tools/xcode/), introduced with
1156
- # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
1157
- # Makefile in the HTML output directory. Running make will produce the docset in
1158
- # that directory and running make install will install the docset in
1159
- # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
1160
- # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
1161
- # for more information.
1162
- # The default value is: NO.
1163
- # This tag requires that the tag GENERATE_HTML is set to YES.
1164
-
1165
- GENERATE_DOCSET = NO
1166
-
1167
- # This tag determines the name of the docset feed. A documentation feed provides
1168
- # an umbrella under which multiple documentation sets from a single provider
1169
- # (such as a company or product suite) can be grouped.
1170
- # The default value is: Doxygen generated docs.
1171
- # This tag requires that the tag GENERATE_DOCSET is set to YES.
1172
-
1173
- DOCSET_FEEDNAME = "Doxygen generated docs"
1174
-
1175
- # This tag specifies a string that should uniquely identify the documentation
1176
- # set bundle. This should be a reverse domain-name style string, e.g.
1177
- # com.mycompany.MyDocSet. Doxygen will append .docset to the name.
1178
- # The default value is: org.doxygen.Project.
1179
- # This tag requires that the tag GENERATE_DOCSET is set to YES.
1180
-
1181
- DOCSET_BUNDLE_ID = org.doxygen.Project
1182
-
1183
- # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
1184
- # the documentation publisher. This should be a reverse domain-name style
1185
- # string, e.g. com.mycompany.MyDocSet.documentation.
1186
- # The default value is: org.doxygen.Publisher.
1187
- # This tag requires that the tag GENERATE_DOCSET is set to YES.
1188
-
1189
- DOCSET_PUBLISHER_ID = org.doxygen.Publisher
1190
-
1191
- # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
1192
- # The default value is: Publisher.
1193
- # This tag requires that the tag GENERATE_DOCSET is set to YES.
1194
-
1195
- DOCSET_PUBLISHER_NAME = Publisher
1196
-
1197
- # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
1198
- # additional HTML index files: index.hhp, index.hhc, and index.hhk. The
1199
- # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
1200
- # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
1201
- # Windows.
1202
- #
1203
- # The HTML Help Workshop contains a compiler that can convert all HTML output
1204
- # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
1205
- # files are now used as the Windows 98 help format, and will replace the old
1206
- # Windows help format (.hlp) on all Windows platforms in the future. Compressed
1207
- # HTML files also contain an index, a table of contents, and you can search for
1208
- # words in the documentation. The HTML workshop also contains a viewer for
1209
- # compressed HTML files.
1210
- # The default value is: NO.
1211
- # This tag requires that the tag GENERATE_HTML is set to YES.
1212
-
1213
- GENERATE_HTMLHELP = NO
1214
-
1215
- # The CHM_FILE tag can be used to specify the file name of the resulting .chm
1216
- # file. You can add a path in front of the file if the result should not be
1217
- # written to the html output directory.
1218
- # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1219
-
1220
- CHM_FILE =
1221
-
1222
- # The HHC_LOCATION tag can be used to specify the location (absolute path
1223
- # including file name) of the HTML help compiler ( hhc.exe). If non-empty
1224
- # doxygen will try to run the HTML help compiler on the generated index.hhp.
1225
- # The file has to be specified with full path.
1226
- # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1227
-
1228
- HHC_LOCATION =
1229
-
1230
- # The GENERATE_CHI flag controls if a separate .chi index file is generated (
1231
- # YES) or that it should be included in the master .chm file ( NO).
1232
- # The default value is: NO.
1233
- # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1234
-
1235
- GENERATE_CHI = NO
1236
-
1237
- # The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
1238
- # and project file content.
1239
- # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1240
-
1241
- CHM_INDEX_ENCODING =
1242
-
1243
- # The BINARY_TOC flag controls whether a binary table of contents is generated (
1244
- # YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
1245
- # enables the Previous and Next buttons.
1246
- # The default value is: NO.
1247
- # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1248
-
1249
- BINARY_TOC = NO
1250
-
1251
- # The TOC_EXPAND flag can be set to YES to add extra items for group members to
1252
- # the table of contents of the HTML help documentation and to the tree view.
1253
- # The default value is: NO.
1254
- # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
1255
-
1256
- TOC_EXPAND = NO
1257
-
1258
- # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
1259
- # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
1260
- # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
1261
- # (.qch) of the generated HTML documentation.
1262
- # The default value is: NO.
1263
- # This tag requires that the tag GENERATE_HTML is set to YES.
1264
-
1265
- GENERATE_QHP = NO
1266
-
1267
- # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
1268
- # the file name of the resulting .qch file. The path specified is relative to
1269
- # the HTML output folder.
1270
- # This tag requires that the tag GENERATE_QHP is set to YES.
1271
-
1272
- QCH_FILE =
1273
-
1274
- # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
1275
- # Project output. For more information please see Qt Help Project / Namespace
1276
- # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
1277
- # The default value is: org.doxygen.Project.
1278
- # This tag requires that the tag GENERATE_QHP is set to YES.
1279
-
1280
- QHP_NAMESPACE = org.doxygen.Project
1281
-
1282
- # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
1283
- # Help Project output. For more information please see Qt Help Project / Virtual
1284
- # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
1285
- # folders).
1286
- # The default value is: doc.
1287
- # This tag requires that the tag GENERATE_QHP is set to YES.
1288
-
1289
- QHP_VIRTUAL_FOLDER = doc
1290
-
1291
- # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
1292
- # filter to add. For more information please see Qt Help Project / Custom
1293
- # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
1294
- # filters).
1295
- # This tag requires that the tag GENERATE_QHP is set to YES.
1296
-
1297
- QHP_CUST_FILTER_NAME =
1298
-
1299
- # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
1300
- # custom filter to add. For more information please see Qt Help Project / Custom
1301
- # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
1302
- # filters).
1303
- # This tag requires that the tag GENERATE_QHP is set to YES.
1304
-
1305
- QHP_CUST_FILTER_ATTRS =
1306
-
1307
- # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
1308
- # project's filter section matches. Qt Help Project / Filter Attributes (see:
1309
- # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
1310
- # This tag requires that the tag GENERATE_QHP is set to YES.
1311
-
1312
- QHP_SECT_FILTER_ATTRS =
1313
-
1314
- # The QHG_LOCATION tag can be used to specify the location of Qt's
1315
- # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
1316
- # generated .qhp file.
1317
- # This tag requires that the tag GENERATE_QHP is set to YES.
1318
-
1319
- QHG_LOCATION =
1320
-
1321
- # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
1322
- # generated, together with the HTML files, they form an Eclipse help plugin. To
1323
- # install this plugin and make it available under the help contents menu in
1324
- # Eclipse, the contents of the directory containing the HTML and XML files needs
1325
- # to be copied into the plugins directory of eclipse. The name of the directory
1326
- # within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
1327
- # After copying Eclipse needs to be restarted before the help appears.
1328
- # The default value is: NO.
1329
- # This tag requires that the tag GENERATE_HTML is set to YES.
1330
-
1331
- GENERATE_ECLIPSEHELP = NO
1332
-
1333
- # A unique identifier for the Eclipse help plugin. When installing the plugin
1334
- # the directory name containing the HTML and XML files should also have this
1335
- # name. Each documentation set should have its own identifier.
1336
- # The default value is: org.doxygen.Project.
1337
- # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
1338
-
1339
- ECLIPSE_DOC_ID = org.doxygen.Project
1340
-
1341
- # If you want full control over the layout of the generated HTML pages it might
1342
- # be necessary to disable the index and replace it with your own. The
1343
- # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
1344
- # of each HTML page. A value of NO enables the index and the value YES disables
1345
- # it. Since the tabs in the index contain the same information as the navigation
1346
- # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
1347
- # The default value is: NO.
1348
- # This tag requires that the tag GENERATE_HTML is set to YES.
1349
-
1350
- DISABLE_INDEX = NO
1351
-
1352
- # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
1353
- # structure should be generated to display hierarchical information. If the tag
1354
- # value is set to YES, a side panel will be generated containing a tree-like
1355
- # index structure (just like the one that is generated for HTML Help). For this
1356
- # to work a browser that supports JavaScript, DHTML, CSS and frames is required
1357
- # (i.e. any modern browser). Windows users are probably better off using the
1358
- # HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
1359
- # further fine-tune the look of the index. As an example, the default style
1360
- # sheet generated by doxygen has an example that shows how to put an image at
1361
- # the root of the tree instead of the PROJECT_NAME. Since the tree basically has
1362
- # the same information as the tab index, you could consider setting
1363
- # DISABLE_INDEX to YES when enabling this option.
1364
- # The default value is: NO.
1365
- # This tag requires that the tag GENERATE_HTML is set to YES.
1366
-
1367
- GENERATE_TREEVIEW = NO
1368
-
1369
- # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
1370
- # doxygen will group on one line in the generated HTML documentation.
1371
- #
1372
- # Note that a value of 0 will completely suppress the enum values from appearing
1373
- # in the overview section.
1374
- # Minimum value: 0, maximum value: 20, default value: 4.
1375
- # This tag requires that the tag GENERATE_HTML is set to YES.
1376
-
1377
- ENUM_VALUES_PER_LINE = 4
1378
-
1379
- # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
1380
- # to set the initial width (in pixels) of the frame in which the tree is shown.
1381
- # Minimum value: 0, maximum value: 1500, default value: 250.
1382
- # This tag requires that the tag GENERATE_HTML is set to YES.
1383
-
1384
- TREEVIEW_WIDTH = 250
1385
-
1386
- # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
1387
- # external symbols imported via tag files in a separate window.
1388
- # The default value is: NO.
1389
- # This tag requires that the tag GENERATE_HTML is set to YES.
1390
-
1391
- EXT_LINKS_IN_WINDOW = NO
1392
-
1393
- # Use this tag to change the font size of LaTeX formulas included as images in
1394
- # the HTML documentation. When you change the font size after a successful
1395
- # doxygen run you need to manually remove any form_*.png images from the HTML
1396
- # output directory to force them to be regenerated.
1397
- # Minimum value: 8, maximum value: 50, default value: 10.
1398
- # This tag requires that the tag GENERATE_HTML is set to YES.
1399
-
1400
- FORMULA_FONTSIZE = 10
1401
-
1402
- # Use the FORMULA_TRANPARENT tag to determine whether or not the images
1403
- # generated for formulas are transparent PNGs. Transparent PNGs are not
1404
- # supported properly for IE 6.0, but are supported on all modern browsers.
1405
- #
1406
- # Note that when changing this option you need to delete any form_*.png files in
1407
- # the HTML output directory before the changes have effect.
1408
- # The default value is: YES.
1409
- # This tag requires that the tag GENERATE_HTML is set to YES.
1410
-
1411
- FORMULA_TRANSPARENT = YES
1412
-
1413
- # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
1414
- # http://www.mathjax.org) which uses client side Javascript for the rendering
1415
- # instead of using prerendered bitmaps. Use this if you do not have LaTeX
1416
- # installed or if you want to formulas look prettier in the HTML output. When
1417
- # enabled you may also need to install MathJax separately and configure the path
1418
- # to it using the MATHJAX_RELPATH option.
1419
- # The default value is: NO.
1420
- # This tag requires that the tag GENERATE_HTML is set to YES.
1421
-
1422
- USE_MATHJAX = NO
1423
-
1424
- # When MathJax is enabled you can set the default output format to be used for
1425
- # the MathJax output. See the MathJax site (see:
1426
- # http://docs.mathjax.org/en/latest/output.html) for more details.
1427
- # Possible values are: HTML-CSS (which is slower, but has the best
1428
- # compatibility), NativeMML (i.e. MathML) and SVG.
1429
- # The default value is: HTML-CSS.
1430
- # This tag requires that the tag USE_MATHJAX is set to YES.
1431
-
1432
- MATHJAX_FORMAT = HTML-CSS
1433
-
1434
- # When MathJax is enabled you need to specify the location relative to the HTML
1435
- # output directory using the MATHJAX_RELPATH option. The destination directory
1436
- # should contain the MathJax.js script. For instance, if the mathjax directory
1437
- # is located at the same level as the HTML output directory, then
1438
- # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
1439
- # Content Delivery Network so you can quickly see the result without installing
1440
- # MathJax. However, it is strongly recommended to install a local copy of
1441
- # MathJax from http://www.mathjax.org before deployment.
1442
- # The default value is: http://cdn.mathjax.org/mathjax/latest.
1443
- # This tag requires that the tag USE_MATHJAX is set to YES.
1444
-
1445
- MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
1446
-
1447
- # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
1448
- # extension names that should be enabled during MathJax rendering. For example
1449
- # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
1450
- # This tag requires that the tag USE_MATHJAX is set to YES.
1451
-
1452
- MATHJAX_EXTENSIONS =
1453
-
1454
- # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
1455
- # of code that will be used on startup of the MathJax code. See the MathJax site
1456
- # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
1457
- # example see the documentation.
1458
- # This tag requires that the tag USE_MATHJAX is set to YES.
1459
-
1460
- MATHJAX_CODEFILE =
1461
-
1462
- # When the SEARCHENGINE tag is enabled doxygen will generate a search box for
1463
- # the HTML output. The underlying search engine uses javascript and DHTML and
1464
- # should work on any modern browser. Note that when using HTML help
1465
- # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
1466
- # there is already a search function so this one should typically be disabled.
1467
- # For large projects the javascript based search engine can be slow, then
1468
- # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
1469
- # search using the keyboard; to jump to the search box use <access key> + S
1470
- # (what the <access key> is depends on the OS and browser, but it is typically
1471
- # <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
1472
- # key> to jump into the search results window, the results can be navigated
1473
- # using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
1474
- # the search. The filter options can be selected when the cursor is inside the
1475
- # search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
1476
- # to select a filter and <Enter> or <escape> to activate or cancel the filter
1477
- # option.
1478
- # The default value is: YES.
1479
- # This tag requires that the tag GENERATE_HTML is set to YES.
1480
-
1481
- SEARCHENGINE = YES
1482
-
1483
- # When the SERVER_BASED_SEARCH tag is enabled the search engine will be
1484
- # implemented using a web server instead of a web client using Javascript. There
1485
- # are two flavors of web server based searching depending on the EXTERNAL_SEARCH
1486
- # setting. When disabled, doxygen will generate a PHP script for searching and
1487
- # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
1488
- # and searching needs to be provided by external tools. See the section
1489
- # "External Indexing and Searching" for details.
1490
- # The default value is: NO.
1491
- # This tag requires that the tag SEARCHENGINE is set to YES.
1492
-
1493
- SERVER_BASED_SEARCH = NO
1494
-
1495
- # When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
1496
- # script for searching. Instead the search results are written to an XML file
1497
- # which needs to be processed by an external indexer. Doxygen will invoke an
1498
- # external search engine pointed to by the SEARCHENGINE_URL option to obtain the
1499
- # search results.
1500
- #
1501
- # Doxygen ships with an example indexer ( doxyindexer) and search engine
1502
- # (doxysearch.cgi) which are based on the open source search engine library
1503
- # Xapian (see: http://xapian.org/).
1504
- #
1505
- # See the section "External Indexing and Searching" for details.
1506
- # The default value is: NO.
1507
- # This tag requires that the tag SEARCHENGINE is set to YES.
1508
-
1509
- EXTERNAL_SEARCH = NO
1510
-
1511
- # The SEARCHENGINE_URL should point to a search engine hosted by a web server
1512
- # which will return the search results when EXTERNAL_SEARCH is enabled.
1513
- #
1514
- # Doxygen ships with an example indexer ( doxyindexer) and search engine
1515
- # (doxysearch.cgi) which are based on the open source search engine library
1516
- # Xapian (see: http://xapian.org/). See the section "External Indexing and
1517
- # Searching" for details.
1518
- # This tag requires that the tag SEARCHENGINE is set to YES.
1519
-
1520
- SEARCHENGINE_URL =
1521
-
1522
- # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
1523
- # search data is written to a file for indexing by an external tool. With the
1524
- # SEARCHDATA_FILE tag the name of this file can be specified.
1525
- # The default file is: searchdata.xml.
1526
- # This tag requires that the tag SEARCHENGINE is set to YES.
1527
-
1528
- SEARCHDATA_FILE = searchdata.xml
1529
-
1530
- # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
1531
- # EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
1532
- # useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
1533
- # projects and redirect the results back to the right project.
1534
- # This tag requires that the tag SEARCHENGINE is set to YES.
1535
-
1536
- EXTERNAL_SEARCH_ID =
1537
-
1538
- # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
1539
- # projects other than the one defined by this configuration file, but that are
1540
- # all added to the same external search index. Each project needs to have a
1541
- # unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
1542
- # to a relative location where the documentation can be found. The format is:
1543
- # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
1544
- # This tag requires that the tag SEARCHENGINE is set to YES.
1545
-
1546
- EXTRA_SEARCH_MAPPINGS =
1547
-
1548
- #---------------------------------------------------------------------------
1549
- # Configuration options related to the LaTeX output
1550
- #---------------------------------------------------------------------------
1551
-
1552
- # If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
1553
- # The default value is: YES.
1554
-
1555
- GENERATE_LATEX = NO
1556
-
1557
- # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
1558
- # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
1559
- # it.
1560
- # The default directory is: latex.
1561
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1562
-
1563
- LATEX_OUTPUT = latex
1564
-
1565
- # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
1566
- # invoked.
1567
- #
1568
- # Note that when enabling USE_PDFLATEX this option is only used for generating
1569
- # bitmaps for formulas in the HTML output, but not in the Makefile that is
1570
- # written to the output directory.
1571
- # The default file is: latex.
1572
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1573
-
1574
- LATEX_CMD_NAME = latex
1575
-
1576
- # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
1577
- # index for LaTeX.
1578
- # The default file is: makeindex.
1579
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1580
-
1581
- MAKEINDEX_CMD_NAME = makeindex
1582
-
1583
- # If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
1584
- # documents. This may be useful for small projects and may help to save some
1585
- # trees in general.
1586
- # The default value is: NO.
1587
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1588
-
1589
- COMPACT_LATEX = NO
1590
-
1591
- # The PAPER_TYPE tag can be used to set the paper type that is used by the
1592
- # printer.
1593
- # Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
1594
- # 14 inches) and executive (7.25 x 10.5 inches).
1595
- # The default value is: a4.
1596
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1597
-
1598
- PAPER_TYPE = a4
1599
-
1600
- # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
1601
- # that should be included in the LaTeX output. To get the times font for
1602
- # instance you can specify
1603
- # EXTRA_PACKAGES=times
1604
- # If left blank no extra packages will be included.
1605
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1606
-
1607
- EXTRA_PACKAGES =
1608
-
1609
- # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
1610
- # generated LaTeX document. The header should contain everything until the first
1611
- # chapter. If it is left blank doxygen will generate a standard header. See
1612
- # section "Doxygen usage" for information on how to let doxygen write the
1613
- # default header to a separate file.
1614
- #
1615
- # Note: Only use a user-defined header if you know what you are doing! The
1616
- # following commands have a special meaning inside the header: $title,
1617
- # $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
1618
- # replace them by respectively the title of the page, the current date and time,
1619
- # only the current date, the version number of doxygen, the project name (see
1620
- # PROJECT_NAME), or the project number (see PROJECT_NUMBER).
1621
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1622
-
1623
- LATEX_HEADER =
1624
-
1625
- # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
1626
- # generated LaTeX document. The footer should contain everything after the last
1627
- # chapter. If it is left blank doxygen will generate a standard footer.
1628
- #
1629
- # Note: Only use a user-defined footer if you know what you are doing!
1630
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1631
-
1632
- LATEX_FOOTER =
1633
-
1634
- # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
1635
- # other source files which should be copied to the LATEX_OUTPUT output
1636
- # directory. Note that the files will be copied as-is; there are no commands or
1637
- # markers available.
1638
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1639
-
1640
- LATEX_EXTRA_FILES =
1641
-
1642
- # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
1643
- # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
1644
- # contain links (just like the HTML output) instead of page references. This
1645
- # makes the output suitable for online browsing using a PDF viewer.
1646
- # The default value is: YES.
1647
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1648
-
1649
- PDF_HYPERLINKS = YES
1650
-
1651
- # If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
1652
- # the PDF file directly from the LaTeX files. Set this option to YES to get a
1653
- # higher quality PDF documentation.
1654
- # The default value is: YES.
1655
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1656
-
1657
- USE_PDFLATEX = YES
1658
-
1659
- # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
1660
- # command to the generated LaTeX files. This will instruct LaTeX to keep running
1661
- # if errors occur, instead of asking the user for help. This option is also used
1662
- # when generating formulas in HTML.
1663
- # The default value is: NO.
1664
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1665
-
1666
- LATEX_BATCHMODE = NO
1667
-
1668
- # If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
1669
- # index chapters (such as File Index, Compound Index, etc.) in the output.
1670
- # The default value is: NO.
1671
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1672
-
1673
- LATEX_HIDE_INDICES = NO
1674
-
1675
- # If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
1676
- # code with syntax highlighting in the LaTeX output.
1677
- #
1678
- # Note that which sources are shown also depends on other settings such as
1679
- # SOURCE_BROWSER.
1680
- # The default value is: NO.
1681
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1682
-
1683
- LATEX_SOURCE_CODE = NO
1684
-
1685
- # The LATEX_BIB_STYLE tag can be used to specify the style to use for the
1686
- # bibliography, e.g. plainnat, or ieeetr. See
1687
- # http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
1688
- # The default value is: plain.
1689
- # This tag requires that the tag GENERATE_LATEX is set to YES.
1690
-
1691
- LATEX_BIB_STYLE = plain
1692
-
1693
- #---------------------------------------------------------------------------
1694
- # Configuration options related to the RTF output
1695
- #---------------------------------------------------------------------------
1696
-
1697
- # If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
1698
- # RTF output is optimized for Word 97 and may not look too pretty with other RTF
1699
- # readers/editors.
1700
- # The default value is: NO.
1701
-
1702
- GENERATE_RTF = NO
1703
-
1704
- # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
1705
- # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
1706
- # it.
1707
- # The default directory is: rtf.
1708
- # This tag requires that the tag GENERATE_RTF is set to YES.
1709
-
1710
- RTF_OUTPUT = rtf
1711
-
1712
- # If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
1713
- # documents. This may be useful for small projects and may help to save some
1714
- # trees in general.
1715
- # The default value is: NO.
1716
- # This tag requires that the tag GENERATE_RTF is set to YES.
1717
-
1718
- COMPACT_RTF = NO
1719
-
1720
- # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
1721
- # contain hyperlink fields. The RTF file will contain links (just like the HTML
1722
- # output) instead of page references. This makes the output suitable for online
1723
- # browsing using Word or some other Word compatible readers that support those
1724
- # fields.
1725
- #
1726
- # Note: WordPad (write) and others do not support links.
1727
- # The default value is: NO.
1728
- # This tag requires that the tag GENERATE_RTF is set to YES.
1729
-
1730
- RTF_HYPERLINKS = NO
1731
-
1732
- # Load stylesheet definitions from file. Syntax is similar to doxygen's config
1733
- # file, i.e. a series of assignments. You only have to provide replacements,
1734
- # missing definitions are set to their default value.
1735
- #
1736
- # See also section "Doxygen usage" for information on how to generate the
1737
- # default style sheet that doxygen normally uses.
1738
- # This tag requires that the tag GENERATE_RTF is set to YES.
1739
-
1740
- RTF_STYLESHEET_FILE =
1741
-
1742
- # Set optional variables used in the generation of an RTF document. Syntax is
1743
- # similar to doxygen's config file. A template extensions file can be generated
1744
- # using doxygen -e rtf extensionFile.
1745
- # This tag requires that the tag GENERATE_RTF is set to YES.
1746
-
1747
- RTF_EXTENSIONS_FILE =
1748
-
1749
- #---------------------------------------------------------------------------
1750
- # Configuration options related to the man page output
1751
- #---------------------------------------------------------------------------
1752
-
1753
- # If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
1754
- # classes and files.
1755
- # The default value is: NO.
1756
-
1757
- GENERATE_MAN = NO
1758
-
1759
- # The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
1760
- # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
1761
- # it. A directory man3 will be created inside the directory specified by
1762
- # MAN_OUTPUT.
1763
- # The default directory is: man.
1764
- # This tag requires that the tag GENERATE_MAN is set to YES.
1765
-
1766
- MAN_OUTPUT = man
1767
-
1768
- # The MAN_EXTENSION tag determines the extension that is added to the generated
1769
- # man pages. In case the manual section does not start with a number, the number
1770
- # 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
1771
- # optional.
1772
- # The default value is: .3.
1773
- # This tag requires that the tag GENERATE_MAN is set to YES.
1774
-
1775
- MAN_EXTENSION = .3
1776
-
1777
- # The MAN_SUBDIR tag determines the name of the directory created within
1778
- # MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
1779
- # MAN_EXTENSION with the initial . removed.
1780
- # This tag requires that the tag GENERATE_MAN is set to YES.
1781
-
1782
- MAN_SUBDIR =
1783
-
1784
- # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
1785
- # will generate one additional man file for each entity documented in the real
1786
- # man page(s). These additional files only source the real man page, but without
1787
- # them the man command would be unable to find the correct page.
1788
- # The default value is: NO.
1789
- # This tag requires that the tag GENERATE_MAN is set to YES.
1790
-
1791
- MAN_LINKS = NO
1792
-
1793
- #---------------------------------------------------------------------------
1794
- # Configuration options related to the XML output
1795
- #---------------------------------------------------------------------------
1796
-
1797
- # If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
1798
- # captures the structure of the code including all documentation.
1799
- # The default value is: NO.
1800
-
1801
- GENERATE_XML = NO
1802
-
1803
- # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
1804
- # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
1805
- # it.
1806
- # The default directory is: xml.
1807
- # This tag requires that the tag GENERATE_XML is set to YES.
1808
-
1809
- XML_OUTPUT = xml
1810
-
1811
- # If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
1812
- # listings (including syntax highlighting and cross-referencing information) to
1813
- # the XML output. Note that enabling this will significantly increase the size
1814
- # of the XML output.
1815
- # The default value is: YES.
1816
- # This tag requires that the tag GENERATE_XML is set to YES.
1817
-
1818
- XML_PROGRAMLISTING = YES
1819
-
1820
- #---------------------------------------------------------------------------
1821
- # Configuration options related to the DOCBOOK output
1822
- #---------------------------------------------------------------------------
1823
-
1824
- # If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
1825
- # that can be used to generate PDF.
1826
- # The default value is: NO.
1827
-
1828
- GENERATE_DOCBOOK = NO
1829
-
1830
- # The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
1831
- # If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
1832
- # front of it.
1833
- # The default directory is: docbook.
1834
- # This tag requires that the tag GENERATE_DOCBOOK is set to YES.
1835
-
1836
- DOCBOOK_OUTPUT = docbook
1837
-
1838
- #---------------------------------------------------------------------------
1839
- # Configuration options for the AutoGen Definitions output
1840
- #---------------------------------------------------------------------------
1841
-
1842
- # If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
1843
- # Definitions (see http://autogen.sf.net) file that captures the structure of
1844
- # the code including all documentation. Note that this feature is still
1845
- # experimental and incomplete at the moment.
1846
- # The default value is: NO.
1847
-
1848
- GENERATE_AUTOGEN_DEF = NO
1849
-
1850
- #---------------------------------------------------------------------------
1851
- # Configuration options related to the Perl module output
1852
- #---------------------------------------------------------------------------
1853
-
1854
- # If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
1855
- # file that captures the structure of the code including all documentation.
1856
- #
1857
- # Note that this feature is still experimental and incomplete at the moment.
1858
- # The default value is: NO.
1859
-
1860
- GENERATE_PERLMOD = NO
1861
-
1862
- # If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
1863
- # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
1864
- # output from the Perl module output.
1865
- # The default value is: NO.
1866
- # This tag requires that the tag GENERATE_PERLMOD is set to YES.
1867
-
1868
- PERLMOD_LATEX = NO
1869
-
1870
- # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
1871
- # formatted so it can be parsed by a human reader. This is useful if you want to
1872
- # understand what is going on. On the other hand, if this tag is set to NO the
1873
- # size of the Perl module output will be much smaller and Perl will parse it
1874
- # just the same.
1875
- # The default value is: YES.
1876
- # This tag requires that the tag GENERATE_PERLMOD is set to YES.
1877
-
1878
- PERLMOD_PRETTY = YES
1879
-
1880
- # The names of the make variables in the generated doxyrules.make file are
1881
- # prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
1882
- # so different doxyrules.make files included by the same Makefile don't
1883
- # overwrite each other's variables.
1884
- # This tag requires that the tag GENERATE_PERLMOD is set to YES.
1885
-
1886
- PERLMOD_MAKEVAR_PREFIX =
1887
-
1888
- #---------------------------------------------------------------------------
1889
- # Configuration options related to the preprocessor
1890
- #---------------------------------------------------------------------------
1891
-
1892
- # If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
1893
- # C-preprocessor directives found in the sources and include files.
1894
- # The default value is: YES.
1895
-
1896
- ENABLE_PREPROCESSING = YES
1897
-
1898
- # If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
1899
- # in the source code. If set to NO only conditional compilation will be
1900
- # performed. Macro expansion can be done in a controlled way by setting
1901
- # EXPAND_ONLY_PREDEF to YES.
1902
- # The default value is: NO.
1903
- # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
1904
-
1905
- MACRO_EXPANSION = NO
1906
-
1907
- # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
1908
- # the macro expansion is limited to the macros specified with the PREDEFINED and
1909
- # EXPAND_AS_DEFINED tags.
1910
- # The default value is: NO.
1911
- # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
1912
-
1913
- EXPAND_ONLY_PREDEF = NO
1914
-
1915
- # If the SEARCH_INCLUDES tag is set to YES the includes files in the
1916
- # INCLUDE_PATH will be searched if a #include is found.
1917
- # The default value is: YES.
1918
- # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
1919
-
1920
- SEARCH_INCLUDES = YES
1921
-
1922
- # The INCLUDE_PATH tag can be used to specify one or more directories that
1923
- # contain include files that are not input files but should be processed by the
1924
- # preprocessor.
1925
- # This tag requires that the tag SEARCH_INCLUDES is set to YES.
1926
-
1927
- INCLUDE_PATH =
1928
-
1929
- # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
1930
- # patterns (like *.h and *.hpp) to filter out the header-files in the
1931
- # directories. If left blank, the patterns specified with FILE_PATTERNS will be
1932
- # used.
1933
- # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
1934
-
1935
- INCLUDE_FILE_PATTERNS =
1936
-
1937
- # The PREDEFINED tag can be used to specify one or more macro names that are
1938
- # defined before the preprocessor is started (similar to the -D option of e.g.
1939
- # gcc). The argument of the tag is a list of macros of the form: name or
1940
- # name=definition (no spaces). If the definition and the "=" are omitted, "=1"
1941
- # is assumed. To prevent a macro definition from being undefined via #undef or
1942
- # recursively expanded use the := operator instead of the = operator.
1943
- # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
1944
-
1945
- PREDEFINED =
1946
-
1947
- # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
1948
- # tag can be used to specify a list of macro names that should be expanded. The
1949
- # macro definition that is found in the sources will be used. Use the PREDEFINED
1950
- # tag if you want to use a different macro definition that overrules the
1951
- # definition found in the source code.
1952
- # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
1953
-
1954
- EXPAND_AS_DEFINED =
1955
-
1956
- # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
1957
- # remove all references to function-like macros that are alone on a line, have
1958
- # an all uppercase name, and do not end with a semicolon. Such function macros
1959
- # are typically used for boiler-plate code, and will confuse the parser if not
1960
- # removed.
1961
- # The default value is: YES.
1962
- # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
1963
-
1964
- SKIP_FUNCTION_MACROS = YES
1965
-
1966
- #---------------------------------------------------------------------------
1967
- # Configuration options related to external references
1968
- #---------------------------------------------------------------------------
1969
-
1970
- # The TAGFILES tag can be used to specify one or more tag files. For each tag
1971
- # file the location of the external documentation should be added. The format of
1972
- # a tag file without this location is as follows:
1973
- # TAGFILES = file1 file2 ...
1974
- # Adding location for the tag files is done as follows:
1975
- # TAGFILES = file1=loc1 "file2 = loc2" ...
1976
- # where loc1 and loc2 can be relative or absolute paths or URLs. See the
1977
- # section "Linking to external documentation" for more information about the use
1978
- # of tag files.
1979
- # Note: Each tag file must have a unique name (where the name does NOT include
1980
- # the path). If a tag file is not located in the directory in which doxygen is
1981
- # run, you must also specify the path to the tagfile here.
1982
-
1983
- TAGFILES =
1984
-
1985
- # When a file name is specified after GENERATE_TAGFILE, doxygen will create a
1986
- # tag file that is based on the input files it reads. See section "Linking to
1987
- # external documentation" for more information about the usage of tag files.
1988
-
1989
- GENERATE_TAGFILE =
1990
-
1991
- # If the ALLEXTERNALS tag is set to YES all external class will be listed in the
1992
- # class index. If set to NO only the inherited external classes will be listed.
1993
- # The default value is: NO.
1994
-
1995
- ALLEXTERNALS = NO
1996
-
1997
- # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
1998
- # the modules index. If set to NO, only the current project's groups will be
1999
- # listed.
2000
- # The default value is: YES.
2001
-
2002
- EXTERNAL_GROUPS = YES
2003
-
2004
- # If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
2005
- # the related pages index. If set to NO, only the current project's pages will
2006
- # be listed.
2007
- # The default value is: YES.
2008
-
2009
- EXTERNAL_PAGES = YES
2010
-
2011
- # The PERL_PATH should be the absolute path and name of the perl script
2012
- # interpreter (i.e. the result of 'which perl').
2013
- # The default file (with absolute path) is: /usr/bin/perl.
2014
-
2015
- PERL_PATH = /usr/bin/perl
2016
-
2017
- #---------------------------------------------------------------------------
2018
- # Configuration options related to the dot tool
2019
- #---------------------------------------------------------------------------
2020
-
2021
- # If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
2022
- # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
2023
- # NO turns the diagrams off. Note that this option also works with HAVE_DOT
2024
- # disabled, but it is recommended to install and use dot, since it yields more
2025
- # powerful graphs.
2026
- # The default value is: YES.
2027
-
2028
- CLASS_DIAGRAMS = YES
2029
-
2030
- # You can define message sequence charts within doxygen comments using the \msc
2031
- # command. Doxygen will then run the mscgen tool (see:
2032
- # http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
2033
- # documentation. The MSCGEN_PATH tag allows you to specify the directory where
2034
- # the mscgen tool resides. If left empty the tool is assumed to be found in the
2035
- # default search path.
2036
-
2037
- MSCGEN_PATH =
2038
-
2039
- # You can include diagrams made with dia in doxygen documentation. Doxygen will
2040
- # then run dia to produce the diagram and insert it in the documentation. The
2041
- # DIA_PATH tag allows you to specify the directory where the dia binary resides.
2042
- # If left empty dia is assumed to be found in the default search path.
2043
-
2044
- DIA_PATH =
2045
-
2046
- # If set to YES, the inheritance and collaboration graphs will hide inheritance
2047
- # and usage relations if the target is undocumented or is not a class.
2048
- # The default value is: YES.
2049
-
2050
- HIDE_UNDOC_RELATIONS = YES
2051
-
2052
- # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
2053
- # available from the path. This tool is part of Graphviz (see:
2054
- # http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
2055
- # Bell Labs. The other options in this section have no effect if this option is
2056
- # set to NO
2057
- # The default value is: NO.
2058
-
2059
- HAVE_DOT = YES
2060
-
2061
- # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
2062
- # to run in parallel. When set to 0 doxygen will base this on the number of
2063
- # processors available in the system. You can set it explicitly to a value
2064
- # larger than 0 to get control over the balance between CPU load and processing
2065
- # speed.
2066
- # Minimum value: 0, maximum value: 32, default value: 0.
2067
- # This tag requires that the tag HAVE_DOT is set to YES.
2068
-
2069
- DOT_NUM_THREADS = 0
2070
-
2071
- # When you want a differently looking font n the dot files that doxygen
2072
- # generates you can specify the font name using DOT_FONTNAME. You need to make
2073
- # sure dot is able to find the font, which can be done by putting it in a
2074
- # standard location or by setting the DOTFONTPATH environment variable or by
2075
- # setting DOT_FONTPATH to the directory containing the font.
2076
- # The default value is: Helvetica.
2077
- # This tag requires that the tag HAVE_DOT is set to YES.
2078
-
2079
- DOT_FONTNAME = Helvetica
2080
-
2081
- # The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
2082
- # dot graphs.
2083
- # Minimum value: 4, maximum value: 24, default value: 10.
2084
- # This tag requires that the tag HAVE_DOT is set to YES.
2085
-
2086
- DOT_FONTSIZE = 10
2087
-
2088
- # By default doxygen will tell dot to use the default font as specified with
2089
- # DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
2090
- # the path where dot can find it using this tag.
2091
- # This tag requires that the tag HAVE_DOT is set to YES.
2092
-
2093
- DOT_FONTPATH =
2094
-
2095
- # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
2096
- # each documented class showing the direct and indirect inheritance relations.
2097
- # Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
2098
- # The default value is: YES.
2099
- # This tag requires that the tag HAVE_DOT is set to YES.
2100
-
2101
- CLASS_GRAPH = YES
2102
-
2103
- # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
2104
- # graph for each documented class showing the direct and indirect implementation
2105
- # dependencies (inheritance, containment, and class references variables) of the
2106
- # class with other documented classes.
2107
- # The default value is: YES.
2108
- # This tag requires that the tag HAVE_DOT is set to YES.
2109
-
2110
- COLLABORATION_GRAPH = YES
2111
-
2112
- # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
2113
- # groups, showing the direct groups dependencies.
2114
- # The default value is: YES.
2115
- # This tag requires that the tag HAVE_DOT is set to YES.
2116
-
2117
- GROUP_GRAPHS = YES
2118
-
2119
- # If the UML_LOOK tag is set to YES doxygen will generate inheritance and
2120
- # collaboration diagrams in a style similar to the OMG's Unified Modeling
2121
- # Language.
2122
- # The default value is: NO.
2123
- # This tag requires that the tag HAVE_DOT is set to YES.
2124
-
2125
- UML_LOOK = NO
2126
-
2127
- # If the UML_LOOK tag is enabled, the fields and methods are shown inside the
2128
- # class node. If there are many fields or methods and many nodes the graph may
2129
- # become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
2130
- # number of items for each type to make the size more manageable. Set this to 0
2131
- # for no limit. Note that the threshold may be exceeded by 50% before the limit
2132
- # is enforced. So when you set the threshold to 10, up to 15 fields may appear,
2133
- # but if the number exceeds 15, the total amount of fields shown is limited to
2134
- # 10.
2135
- # Minimum value: 0, maximum value: 100, default value: 10.
2136
- # This tag requires that the tag HAVE_DOT is set to YES.
2137
-
2138
- UML_LIMIT_NUM_FIELDS = 10
2139
-
2140
- # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
2141
- # collaboration graphs will show the relations between templates and their
2142
- # instances.
2143
- # The default value is: NO.
2144
- # This tag requires that the tag HAVE_DOT is set to YES.
2145
-
2146
- TEMPLATE_RELATIONS = NO
2147
-
2148
- # If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
2149
- # YES then doxygen will generate a graph for each documented file showing the
2150
- # direct and indirect include dependencies of the file with other documented
2151
- # files.
2152
- # The default value is: YES.
2153
- # This tag requires that the tag HAVE_DOT is set to YES.
2154
-
2155
- INCLUDE_GRAPH = YES
2156
-
2157
- # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
2158
- # set to YES then doxygen will generate a graph for each documented file showing
2159
- # the direct and indirect include dependencies of the file with other documented
2160
- # files.
2161
- # The default value is: YES.
2162
- # This tag requires that the tag HAVE_DOT is set to YES.
2163
-
2164
- INCLUDED_BY_GRAPH = YES
2165
-
2166
- # If the CALL_GRAPH tag is set to YES then doxygen will generate a call
2167
- # dependency graph for every global function or class method.
2168
- #
2169
- # Note that enabling this option will significantly increase the time of a run.
2170
- # So in most cases it will be better to enable call graphs for selected
2171
- # functions only using the \callgraph command.
2172
- # The default value is: NO.
2173
- # This tag requires that the tag HAVE_DOT is set to YES.
2174
-
2175
- CALL_GRAPH = YES
2176
-
2177
- # If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
2178
- # dependency graph for every global function or class method.
2179
- #
2180
- # Note that enabling this option will significantly increase the time of a run.
2181
- # So in most cases it will be better to enable caller graphs for selected
2182
- # functions only using the \callergraph command.
2183
- # The default value is: NO.
2184
- # This tag requires that the tag HAVE_DOT is set to YES.
2185
-
2186
- CALLER_GRAPH = YES
2187
-
2188
- # If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
2189
- # hierarchy of all classes instead of a textual one.
2190
- # The default value is: YES.
2191
- # This tag requires that the tag HAVE_DOT is set to YES.
2192
-
2193
- GRAPHICAL_HIERARCHY = YES
2194
-
2195
- # If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
2196
- # dependencies a directory has on other directories in a graphical way. The
2197
- # dependency relations are determined by the #include relations between the
2198
- # files in the directories.
2199
- # The default value is: YES.
2200
- # This tag requires that the tag HAVE_DOT is set to YES.
2201
-
2202
- DIRECTORY_GRAPH = YES
2203
-
2204
- # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
2205
- # generated by dot.
2206
- # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
2207
- # to make the SVG files visible in IE 9+ (other browsers do not have this
2208
- # requirement).
2209
- # Possible values are: png, jpg, gif and svg.
2210
- # The default value is: png.
2211
- # This tag requires that the tag HAVE_DOT is set to YES.
2212
-
2213
- DOT_IMAGE_FORMAT = svg
2214
-
2215
- # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
2216
- # enable generation of interactive SVG images that allow zooming and panning.
2217
- #
2218
- # Note that this requires a modern browser other than Internet Explorer. Tested
2219
- # and working are Firefox, Chrome, Safari, and Opera.
2220
- # Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
2221
- # the SVG files visible. Older versions of IE do not have SVG support.
2222
- # The default value is: NO.
2223
- # This tag requires that the tag HAVE_DOT is set to YES.
2224
-
2225
- INTERACTIVE_SVG = YES
2226
-
2227
- # The DOT_PATH tag can be used to specify the path where the dot tool can be
2228
- # found. If left blank, it is assumed the dot tool can be found in the path.
2229
- # This tag requires that the tag HAVE_DOT is set to YES.
2230
-
2231
- DOT_PATH =
2232
-
2233
- # The DOTFILE_DIRS tag can be used to specify one or more directories that
2234
- # contain dot files that are included in the documentation (see the \dotfile
2235
- # command).
2236
- # This tag requires that the tag HAVE_DOT is set to YES.
2237
-
2238
- DOTFILE_DIRS =
2239
-
2240
- # The MSCFILE_DIRS tag can be used to specify one or more directories that
2241
- # contain msc files that are included in the documentation (see the \mscfile
2242
- # command).
2243
-
2244
- MSCFILE_DIRS =
2245
-
2246
- # The DIAFILE_DIRS tag can be used to specify one or more directories that
2247
- # contain dia files that are included in the documentation (see the \diafile
2248
- # command).
2249
-
2250
- DIAFILE_DIRS =
2251
-
2252
- # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
2253
- # that will be shown in the graph. If the number of nodes in a graph becomes
2254
- # larger than this value, doxygen will truncate the graph, which is visualized
2255
- # by representing a node as a red box. Note that doxygen if the number of direct
2256
- # children of the root node in a graph is already larger than
2257
- # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
2258
- # the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
2259
- # Minimum value: 0, maximum value: 10000, default value: 50.
2260
- # This tag requires that the tag HAVE_DOT is set to YES.
2261
-
2262
- DOT_GRAPH_MAX_NODES = 50
2263
-
2264
- # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
2265
- # generated by dot. A depth value of 3 means that only nodes reachable from the
2266
- # root by following a path via at most 3 edges will be shown. Nodes that lay
2267
- # further from the root node will be omitted. Note that setting this option to 1
2268
- # or 2 may greatly reduce the computation time needed for large code bases. Also
2269
- # note that the size of a graph can be further restricted by
2270
- # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
2271
- # Minimum value: 0, maximum value: 1000, default value: 0.
2272
- # This tag requires that the tag HAVE_DOT is set to YES.
2273
-
2274
- MAX_DOT_GRAPH_DEPTH = 0
2275
-
2276
- # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
2277
- # background. This is disabled by default, because dot on Windows does not seem
2278
- # to support this out of the box.
2279
- #
2280
- # Warning: Depending on the platform used, enabling this option may lead to
2281
- # badly anti-aliased labels on the edges of a graph (i.e. they become hard to
2282
- # read).
2283
- # The default value is: NO.
2284
- # This tag requires that the tag HAVE_DOT is set to YES.
2285
-
2286
- DOT_TRANSPARENT = NO
2287
-
2288
- # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
2289
- # files in one run (i.e. multiple -o and -T options on the command line). This
2290
- # makes dot run faster, but since only newer versions of dot (>1.8.10) support
2291
- # this, this feature is disabled by default.
2292
- # The default value is: NO.
2293
- # This tag requires that the tag HAVE_DOT is set to YES.
2294
-
2295
- DOT_MULTI_TARGETS = NO
2296
-
2297
- # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
2298
- # explaining the meaning of the various boxes and arrows in the dot generated
2299
- # graphs.
2300
- # The default value is: YES.
2301
- # This tag requires that the tag HAVE_DOT is set to YES.
2302
-
2303
- GENERATE_LEGEND = YES
2304
-
2305
- # If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
2306
- # files that are used to generate the various graphs.
2307
- # The default value is: YES.
2308
- # This tag requires that the tag HAVE_DOT is set to YES.
2309
-
2310
- DOT_CLEANUP = YES
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2011 Raphael Schweikert, https://www.sabberworm.com/
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
vendor/sabberworm/php-css-parser/README.html ADDED
@@ -0,0 +1,641 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ </head>
6
+ <body>
7
+
8
+ <h1 id="phpcssparser">PHP CSS Parser</h1>
9
+
10
+ <p><a href="https://github.com/sabberworm/PHP-CSS-Parser/actions/"><img src="https://github.com/sabberworm/PHP-CSS-Parser/workflows/CI/badge.svg?branch=master" alt="Build Status" /></a></p>
11
+
12
+ <p>A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS.</p>
13
+
14
+ <h2 id="usage">Usage</h2>
15
+
16
+ <h3 id="installationusingcomposer">Installation using Composer</h3>
17
+
18
+ <pre><code class="bash">composer require sabberworm/php-css-parser
19
+ </code></pre>
20
+
21
+ <h3 id="extraction">Extraction</h3>
22
+
23
+ <p>To use the CSS Parser, create a new instance. The constructor takes the following form:</p>
24
+
25
+ <pre><code class="php">new \Sabberworm\CSS\Parser($css);
26
+ </code></pre>
27
+
28
+ <p>To read a file, for example, you’d do the following:</p>
29
+
30
+ <pre><code class="php">$parser = new \Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
31
+ $cssDocument = $parser-&gt;parse();
32
+ </code></pre>
33
+
34
+ <p>The resulting CSS document structure can be manipulated prior to being output.</p>
35
+
36
+ <h3 id="options">Options</h3>
37
+
38
+ <h4 id="charset">Charset</h4>
39
+
40
+ <p>The charset option is used only if no <code>@charset</code> declaration is found in the CSS file. UTF-8 is the default, so you won’t have to create a settings object at all if you don’t intend to change that.</p>
41
+
42
+ <pre><code class="php">$settings = \Sabberworm\CSS\Settings::create()
43
+ -&gt;withDefaultCharset('windows-1252');
44
+ $parser = new \Sabberworm\CSS\Parser($css, $settings);
45
+ </code></pre>
46
+
47
+ <h4 id="strictparsing">Strict parsing</h4>
48
+
49
+ <p>To have the parser choke on invalid rules, supply a thusly configured <code>\Sabberworm\CSS\Settings</code> object:</p>
50
+
51
+ <pre><code class="php">$parser = new \Sabberworm\CSS\Parser(
52
+ file_get_contents('somefile.css'),
53
+ \Sabberworm\CSS\Settings::create()-&gt;beStrict()
54
+ );
55
+ </code></pre>
56
+
57
+ <h4 id="disablemultibytefunctions">Disable multibyte functions</h4>
58
+
59
+ <p>To achieve faster parsing, you can choose to have PHP-CSS-Parser use regular string functions instead of <code>mb_*</code> functions. This should work fine in most cases, even for UTF-8 files, as all the multibyte characters are in string literals. Still it’s not recommended using this with input you have no control over as it’s not thoroughly covered by test cases.</p>
60
+
61
+ <pre><code class="php">$settings = \Sabberworm\CSS\Settings::create()-&gt;withMultibyteSupport(false);
62
+ $parser = new \Sabberworm\CSS\Parser($css, $settings);
63
+ </code></pre>
64
+
65
+ <h3 id="manipulation">Manipulation</h3>
66
+
67
+ <p>The resulting data structure consists mainly of five basic types: <code>CSSList</code>, <code>RuleSet</code>, <code>Rule</code>, <code>Selector</code> and <code>Value</code>. There are two additional types used: <code>Import</code> and <code>Charset</code>, which you won’t use often.</p>
68
+
69
+ <h4 id="csslist">CSSList</h4>
70
+
71
+ <p><code>CSSList</code> represents a generic CSS container, most likely containing declaration blocks (rule sets with a selector), but it may also contain at-rules, charset declarations, etc. <code>CSSList</code> has the following concrete subtypes:</p>
72
+
73
+ <ul>
74
+ <li><code>Document</code> – representing the root of a CSS file.</li>
75
+ <li><code>MediaQuery</code> – represents a subsection of a <code>CSSList</code> that only applies to an output device matching the contained media query.</li>
76
+ </ul>
77
+
78
+ <p>To access the items stored in a <code>CSSList</code> – like the document you got back when calling <code>$parser-&gt;parse()</code> –, use <code>getContents()</code>, then iterate over that collection and use instanceof to check whether you’re dealing with another <code>CSSList</code>, a <code>RuleSet</code>, a <code>Import</code> or a <code>Charset</code>.</p>
79
+
80
+ <p>To append a new item (selector, media query, etc.) to an existing <code>CSSList</code>, construct it using the constructor for this class and use the <code>append($oItem)</code> method.</p>
81
+
82
+ <h4 id="ruleset">RuleSet</h4>
83
+
84
+ <p><code>RuleSet</code> is a container for individual rules. The most common form of a rule set is one constrained by a selector. The following concrete subtypes exist:</p>
85
+
86
+ <ul>
87
+ <li><code>AtRuleSet</code> – for generic at-rules which do not match the ones specifically mentioned like <code>@import</code>, <code>@charset</code> or <code>@media</code>. A common example for this is <code>@font-face</code>.</li>
88
+ <li><code>DeclarationBlock</code> – a <code>RuleSet</code> constrained by a <code>Selector</code>; contains an array of selector objects (comma-separated in the CSS) as well as the rules to be applied to the matching elements.</li>
89
+ </ul>
90
+
91
+ <p>Note: A <code>CSSList</code> can contain other <code>CSSList</code>s (and <code>Import</code>s as well as a <code>Charset</code>), while a <code>RuleSet</code> can only contain <code>Rule</code>s.</p>
92
+
93
+ <p>If you want to manipulate a <code>RuleSet</code>, use the methods <code>addRule(Rule $rule)</code>, <code>getRules()</code> and <code>removeRule($rule)</code> (which accepts either a <code>Rule</code> instance or a rule name; optionally suffixed by a dash to remove all related rules).</p>
94
+
95
+ <h4 id="rule">Rule</h4>
96
+
97
+ <p><code>Rule</code>s just have a key (the rule) and a value. These values are all instances of a <code>Value</code>.</p>
98
+
99
+ <h4 id="value">Value</h4>
100
+
101
+ <p><code>Value</code> is an abstract class that only defines the <code>render</code> method. The concrete subclasses for atomic value types are:</p>
102
+
103
+ <ul>
104
+ <li><code>Size</code> – consists of a numeric <code>size</code> value and a unit.</li>
105
+ <li><code>Color</code> – colors can be input in the form #rrggbb, #rgb or schema(val1, val2, …) but are always stored as an array of (&#8217;s' =&gt; val1, &#8216;c&#8217; =&gt; val2, &#8216;h&#8217; =&gt; val3, …) and output in the second form.</li>
106
+ <li><code>CSSString</code> – this is just a wrapper for quoted strings to distinguish them from keywords; always output with double quotes.</li>
107
+ <li><code>URL</code> – URLs in CSS; always output in URL(&#8220;&#8221;) notation.</li>
108
+ </ul>
109
+
110
+ <p>There is another abstract subclass of <code>Value</code>, <code>ValueList</code>. A <code>ValueList</code> represents a lists of <code>Value</code>s, separated by some separation character (mostly <code>,</code>, whitespace, or <code>/</code>). There are two types of <code>ValueList</code>s:</p>
111
+
112
+ <ul>
113
+ <li><code>RuleValueList</code> – The default type, used to represent all multi-valued rules like <code>font: bold 12px/3 Helvetica, Verdana, sans-serif;</code> (where the value would be a whitespace-separated list of the primitive value <code>bold</code>, a slash-separated list and a comma-separated list).</li>
114
+ <li><code>CSSFunction</code> – A special kind of value that also contains a function name and where the values are the function’s arguments. Also handles equals-sign-separated argument lists like <code>filter: alpha(opacity=90);</code>.</li>
115
+ </ul>
116
+
117
+ <h4 id="conveniencemethods">Convenience methods</h4>
118
+
119
+ <p>There are a few convenience methods on Document to ease finding, manipulating and deleting rules:</p>
120
+
121
+ <ul>
122
+ <li><code>getAllDeclarationBlocks()</code> – does what it says; no matter how deeply nested your selectors are. Aliased as <code>getAllSelectors()</code>.</li>
123
+ <li><code>getAllRuleSets()</code> – does what it says; no matter how deeply nested your rule sets are.</li>
124
+ <li><code>getAllValues()</code> – finds all <code>Value</code> objects inside <code>Rule</code>s.</li>
125
+ </ul>
126
+
127
+ <h2 id="to-do">To-Do</h2>
128
+
129
+ <ul>
130
+ <li>More convenience methods (like <code>selectorsWithElement($sId/Class/TagName)</code>, <code>attributesOfType($type)</code>, <code>removeAttributesOfType($type)</code>)</li>
131
+ <li>Real multibyte support. Currently, only multibyte charsets whose first 255 code points take up only one byte and are identical with ASCII are supported (yes, UTF-8 fits this description).</li>
132
+ <li>Named color support (using <code>Color</code> instead of an anonymous string literal)</li>
133
+ </ul>
134
+
135
+ <h2 id="usecases">Use cases</h2>
136
+
137
+ <h3 id="useparsertoprependanidtoallselectors">Use <code>Parser</code> to prepend an ID to all selectors</h3>
138
+
139
+ <pre><code class="php">$myId = &quot;#my_id&quot;;
140
+ $parser = new \Sabberworm\CSS\Parser($css);
141
+ $cssDocument = $parser-&gt;parse();
142
+ foreach ($cssDocument-&gt;getAllDeclarationBlocks() as $block) {
143
+ foreach ($block-&gt;getSelectors() as $selector) {
144
+ // Loop over all selector parts (the comma-separated strings in a
145
+ // selector) and prepend the ID.
146
+ $selector-&gt;setSelector($myId.' '.$selector-&gt;getSelector());
147
+ }
148
+ }
149
+ </code></pre>
150
+
151
+ <h3 id="shrinkallabsolutesizestohalf">Shrink all absolute sizes to half</h3>
152
+
153
+ <pre><code class="php">$parser = new \Sabberworm\CSS\Parser($css);
154
+ $cssDocument = $parser-&gt;parse();
155
+ foreach ($cssDocument-&gt;getAllValues() as $value) {
156
+ if ($value instanceof CSSSize &amp;&amp; !$value-&gt;isRelative()) {
157
+ $value-&gt;setSize($value-&gt;getSize() / 2);
158
+ }
159
+ }
160
+ </code></pre>
161
+
162
+ <h3 id="removeunwantedrules">Remove unwanted rules</h3>
163
+
164
+ <pre><code class="php">$parser = new \Sabberworm\CSS\Parser($css);
165
+ $cssDocument = $parser-&gt;parse();
166
+ foreach($cssDocument-&gt;getAllRuleSets() as $oRuleSet) {
167
+ // Note that the added dash will make this remove all rules starting with
168
+ // `font-` (like `font-size`, `font-weight`, etc.) as well as a potential
169
+ // `font-rule`.
170
+ $oRuleSet-&gt;removeRule('font-');
171
+ $oRuleSet-&gt;removeRule('cursor');
172
+ }
173
+ </code></pre>
174
+
175
+ <h3 id="output">Output</h3>
176
+
177
+ <p>To output the entire CSS document into a variable, just use <code>-&gt;render()</code>:</p>
178
+
179
+ <pre><code class="php">$parser = new \Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
180
+ $cssDocument = $parser-&gt;parse();
181
+ print $cssDocument-&gt;render();
182
+ </code></pre>
183
+
184
+ <p>If you want to format the output, pass an instance of type <code>\Sabberworm\CSS\OutputFormat</code>:</p>
185
+
186
+ <pre><code class="php">$format = \Sabberworm\CSS\OutputFormat::create()
187
+ -&gt;indentWithSpaces(4)-&gt;setSpaceBetweenRules(&quot;\n&quot;);
188
+ print $cssDocument-&gt;render($format);
189
+ </code></pre>
190
+
191
+ <p>Or use one of the predefined formats:</p>
192
+
193
+ <pre><code class="php">print $cssDocument-&gt;render(Sabberworm\CSS\OutputFormat::createPretty());
194
+ print $cssDocument-&gt;render(Sabberworm\CSS\OutputFormat::createCompact());
195
+ </code></pre>
196
+
197
+ <p>To see what you can do with output formatting, look at the tests in <code>tests/OutputFormatTest.php</code>.</p>
198
+
199
+ <h2 id="examples">Examples</h2>
200
+
201
+ <h3 id="example1at-rules">Example 1 (At-Rules)</h3>
202
+
203
+ <h4 id="input">Input</h4>
204
+
205
+ <pre><code class="css">@charset &quot;utf-8&quot;;
206
+
207
+ @font-face {
208
+ font-family: &quot;CrassRoots&quot;;
209
+ src: url(&quot;../media/cr.ttf&quot;);
210
+ }
211
+
212
+ html, body {
213
+ font-size: 1.6em;
214
+ }
215
+
216
+ @keyframes mymove {
217
+ from { top: 0px; }
218
+ to { top: 200px; }
219
+ }
220
+
221
+ </code></pre>
222
+
223
+ <h4 id="structurevar_dump">Structure (<code>var_dump()</code>)</h4>
224
+
225
+ <pre><code class="php">class Sabberworm\CSS\CSSList\Document#4 (2) {
226
+ protected $aContents =&gt;
227
+ array(4) {
228
+ [0] =&gt;
229
+ class Sabberworm\CSS\Property\Charset#6 (2) {
230
+ private $sCharset =&gt;
231
+ class Sabberworm\CSS\Value\CSSString#5 (2) {
232
+ private $sString =&gt;
233
+ string(5) &quot;utf-8&quot;
234
+ protected $iLineNo =&gt;
235
+ int(1)
236
+ }
237
+ protected $iLineNo =&gt;
238
+ int(1)
239
+ }
240
+ [1] =&gt;
241
+ class Sabberworm\CSS\RuleSet\AtRuleSet#7 (4) {
242
+ private $sType =&gt;
243
+ string(9) &quot;font-face&quot;
244
+ private $sArgs =&gt;
245
+ string(0) &quot;&quot;
246
+ private $aRules =&gt;
247
+ array(2) {
248
+ 'font-family' =&gt;
249
+ array(1) {
250
+ [0] =&gt;
251
+ class Sabberworm\CSS\Rule\Rule#8 (4) {
252
+ private $sRule =&gt;
253
+ string(11) &quot;font-family&quot;
254
+ private $mValue =&gt;
255
+ class Sabberworm\CSS\Value\CSSString#9 (2) {
256
+ private $sString =&gt;
257
+ string(10) &quot;CrassRoots&quot;
258
+ protected $iLineNo =&gt;
259
+ int(4)
260
+ }
261
+ private $bIsImportant =&gt;
262
+ bool(false)
263
+ protected $iLineNo =&gt;
264
+ int(4)
265
+ }
266
+ }
267
+ 'src' =&gt;
268
+ array(1) {
269
+ [0] =&gt;
270
+ class Sabberworm\CSS\Rule\Rule#10 (4) {
271
+ private $sRule =&gt;
272
+ string(3) &quot;src&quot;
273
+ private $mValue =&gt;
274
+ class Sabberworm\CSS\Value\URL#11 (2) {
275
+ private $oURL =&gt;
276
+ class Sabberworm\CSS\Value\CSSString#12 (2) {
277
+ private $sString =&gt;
278
+ string(15) &quot;../media/cr.ttf&quot;
279
+ protected $iLineNo =&gt;
280
+ int(5)
281
+ }
282
+ protected $iLineNo =&gt;
283
+ int(5)
284
+ }
285
+ private $bIsImportant =&gt;
286
+ bool(false)
287
+ protected $iLineNo =&gt;
288
+ int(5)
289
+ }
290
+ }
291
+ }
292
+ protected $iLineNo =&gt;
293
+ int(3)
294
+ }
295
+ [2] =&gt;
296
+ class Sabberworm\CSS\RuleSet\DeclarationBlock#13 (3) {
297
+ private $aSelectors =&gt;
298
+ array(2) {
299
+ [0] =&gt;
300
+ class Sabberworm\CSS\Property\Selector#14 (2) {
301
+ private $sSelector =&gt;
302
+ string(4) &quot;html&quot;
303
+ private $iSpecificity =&gt;
304
+ NULL
305
+ }
306
+ [1] =&gt;
307
+ class Sabberworm\CSS\Property\Selector#15 (2) {
308
+ private $sSelector =&gt;
309
+ string(4) &quot;body&quot;
310
+ private $iSpecificity =&gt;
311
+ NULL
312
+ }
313
+ }
314
+ private $aRules =&gt;
315
+ array(1) {
316
+ 'font-size' =&gt;
317
+ array(1) {
318
+ [0] =&gt;
319
+ class Sabberworm\CSS\Rule\Rule#16 (4) {
320
+ private $sRule =&gt;
321
+ string(9) &quot;font-size&quot;
322
+ private $mValue =&gt;
323
+ class Sabberworm\CSS\Value\Size#17 (4) {
324
+ private $fSize =&gt;
325
+ double(1.6)
326
+ private $sUnit =&gt;
327
+ string(2) &quot;em&quot;
328
+ private $bIsColorComponent =&gt;
329
+ bool(false)
330
+ protected $iLineNo =&gt;
331
+ int(9)
332
+ }
333
+ private $bIsImportant =&gt;
334
+ bool(false)
335
+ protected $iLineNo =&gt;
336
+ int(9)
337
+ }
338
+ }
339
+ }
340
+ protected $iLineNo =&gt;
341
+ int(8)
342
+ }
343
+ [3] =&gt;
344
+ class Sabberworm\CSS\CSSList\KeyFrame#18 (4) {
345
+ private $vendorKeyFrame =&gt;
346
+ string(9) &quot;keyframes&quot;
347
+ private $animationName =&gt;
348
+ string(6) &quot;mymove&quot;
349
+ protected $aContents =&gt;
350
+ array(2) {
351
+ [0] =&gt;
352
+ class Sabberworm\CSS\RuleSet\DeclarationBlock#19 (3) {
353
+ private $aSelectors =&gt;
354
+ array(1) {
355
+ [0] =&gt;
356
+ class Sabberworm\CSS\Property\Selector#20 (2) {
357
+ private $sSelector =&gt;
358
+ string(4) &quot;from&quot;
359
+ private $iSpecificity =&gt;
360
+ NULL
361
+ }
362
+ }
363
+ private $aRules =&gt;
364
+ array(1) {
365
+ 'top' =&gt;
366
+ array(1) {
367
+ [0] =&gt;
368
+ class Sabberworm\CSS\Rule\Rule#21 (4) {
369
+ private $sRule =&gt;
370
+ string(3) &quot;top&quot;
371
+ private $mValue =&gt;
372
+ class Sabberworm\CSS\Value\Size#22 (4) {
373
+ private $fSize =&gt;
374
+ double(0)
375
+ private $sUnit =&gt;
376
+ string(2) &quot;px&quot;
377
+ private $bIsColorComponent =&gt;
378
+ bool(false)
379
+ protected $iLineNo =&gt;
380
+ int(13)
381
+ }
382
+ private $bIsImportant =&gt;
383
+ bool(false)
384
+ protected $iLineNo =&gt;
385
+ int(13)
386
+ }
387
+ }
388
+ }
389
+ protected $iLineNo =&gt;
390
+ int(13)
391
+ }
392
+ [1] =&gt;
393
+ class Sabberworm\CSS\RuleSet\DeclarationBlock#23 (3) {
394
+ private $aSelectors =&gt;
395
+ array(1) {
396
+ [0] =&gt;
397
+ class Sabberworm\CSS\Property\Selector#24 (2) {
398
+ private $sSelector =&gt;
399
+ string(2) &quot;to&quot;
400
+ private $iSpecificity =&gt;
401
+ NULL
402
+ }
403
+ }
404
+ private $aRules =&gt;
405
+ array(1) {
406
+ 'top' =&gt;
407
+ array(1) {
408
+ [0] =&gt;
409
+ class Sabberworm\CSS\Rule\Rule#25 (4) {
410
+ private $sRule =&gt;
411
+ string(3) &quot;top&quot;
412
+ private $mValue =&gt;
413
+ class Sabberworm\CSS\Value\Size#26 (4) {
414
+ private $fSize =&gt;
415
+ double(200)
416
+ private $sUnit =&gt;
417
+ string(2) &quot;px&quot;
418
+ private $bIsColorComponent =&gt;
419
+ bool(false)
420
+ protected $iLineNo =&gt;
421
+ int(14)
422
+ }
423
+ private $bIsImportant =&gt;
424
+ bool(false)
425
+ protected $iLineNo =&gt;
426
+ int(14)
427
+ }
428
+ }
429
+ }
430
+ protected $iLineNo =&gt;
431
+ int(14)
432
+ }
433
+ }
434
+ protected $iLineNo =&gt;
435
+ int(12)
436
+ }
437
+ }
438
+ protected $iLineNo =&gt;
439
+ int(1)
440
+ }
441
+
442
+ </code></pre>
443
+
444
+ <h4 id="outputrender">Output (<code>render()</code>)</h4>
445
+
446
+ <pre><code class="css">@charset &quot;utf-8&quot;;
447
+ @font-face {font-family: &quot;CrassRoots&quot;;src: url(&quot;../media/cr.ttf&quot;);}
448
+ html, body {font-size: 1.6em;}
449
+ @keyframes mymove {from {top: 0px;} to {top: 200px;}}
450
+ </code></pre>
451
+
452
+ <h3 id="example2values">Example 2 (Values)</h3>
453
+
454
+ <h4 id="input">Input</h4>
455
+
456
+ <pre><code class="css">#header {
457
+ margin: 10px 2em 1cm 2%;
458
+ font-family: Verdana, Helvetica, &quot;Gill Sans&quot;, sans-serif;
459
+ color: red !important;
460
+ }
461
+
462
+ </code></pre>
463
+
464
+ <h4 id="structurevar_dump">Structure (<code>var_dump()</code>)</h4>
465
+
466
+ <pre><code class="php">class Sabberworm\CSS\CSSList\Document#4 (2) {
467
+ protected $aContents =&gt;
468
+ array(1) {
469
+ [0] =&gt;
470
+ class Sabberworm\CSS\RuleSet\DeclarationBlock#5 (3) {
471
+ private $aSelectors =&gt;
472
+ array(1) {
473
+ [0] =&gt;
474
+ class Sabberworm\CSS\Property\Selector#6 (2) {
475
+ private $sSelector =&gt;
476
+ string(7) &quot;#header&quot;
477
+ private $iSpecificity =&gt;
478
+ NULL
479
+ }
480
+ }
481
+ private $aRules =&gt;
482
+ array(3) {
483
+ 'margin' =&gt;
484
+ array(1) {
485
+ [0] =&gt;
486
+ class Sabberworm\CSS\Rule\Rule#7 (4) {
487
+ private $sRule =&gt;
488
+ string(6) &quot;margin&quot;
489
+ private $mValue =&gt;
490
+ class Sabberworm\CSS\Value\RuleValueList#12 (3) {
491
+ protected $aComponents =&gt;
492
+ array(4) {
493
+ [0] =&gt;
494
+ class Sabberworm\CSS\Value\Size#8 (4) {
495
+ private $fSize =&gt;
496
+ double(10)
497
+ private $sUnit =&gt;
498
+ string(2) &quot;px&quot;
499
+ private $bIsColorComponent =&gt;
500
+ bool(false)
501
+ protected $iLineNo =&gt;
502
+ int(2)
503
+ }
504
+ [1] =&gt;
505
+ class Sabberworm\CSS\Value\Size#9 (4) {
506
+ private $fSize =&gt;
507
+ double(2)
508
+ private $sUnit =&gt;
509
+ string(2) &quot;em&quot;
510
+ private $bIsColorComponent =&gt;
511
+ bool(false)
512
+ protected $iLineNo =&gt;
513
+ int(2)
514
+ }
515
+ [2] =&gt;
516
+ class Sabberworm\CSS\Value\Size#10 (4) {
517
+ private $fSize =&gt;
518
+ double(1)
519
+ private $sUnit =&gt;
520
+ string(2) &quot;cm&quot;
521
+ private $bIsColorComponent =&gt;
522
+ bool(false)
523
+ protected $iLineNo =&gt;
524
+ int(2)
525
+ }
526
+ [3] =&gt;
527
+ class Sabberworm\CSS\Value\Size#11 (4) {
528
+ private $fSize =&gt;
529
+ double(2)
530
+ private $sUnit =&gt;
531
+ string(1) &quot;%&quot;
532
+ private $bIsColorComponent =&gt;
533
+ bool(false)
534
+ protected $iLineNo =&gt;
535
+ int(2)
536
+ }
537
+ }
538
+ protected $sSeparator =&gt;
539
+ string(1) &quot; &quot;
540
+ protected $iLineNo =&gt;
541
+ int(2)
542
+ }
543
+ private $bIsImportant =&gt;
544
+ bool(false)
545
+ protected $iLineNo =&gt;
546
+ int(2)
547
+ }
548
+ }
549
+ 'font-family' =&gt;
550
+ array(1) {
551
+ [0] =&gt;
552
+ class Sabberworm\CSS\Rule\Rule#13 (4) {
553
+ private $sRule =&gt;
554
+ string(11) &quot;font-family&quot;
555
+ private $mValue =&gt;
556
+ class Sabberworm\CSS\Value\RuleValueList#15 (3) {
557
+ protected $aComponents =&gt;
558
+ array(4) {
559
+ [0] =&gt;
560
+ string(7) &quot;Verdana&quot;
561
+ [1] =&gt;
562
+ string(9) &quot;Helvetica&quot;
563
+ [2] =&gt;
564
+ class Sabberworm\CSS\Value\CSSString#14 (2) {
565
+ private $sString =&gt;
566
+ string(9) &quot;Gill Sans&quot;
567
+ protected $iLineNo =&gt;
568
+ int(3)
569
+ }
570
+ [3] =&gt;
571
+ string(10) &quot;sans-serif&quot;
572
+ }
573
+ protected $sSeparator =&gt;
574
+ string(1) &quot;,&quot;
575
+ protected $iLineNo =&gt;
576
+ int(3)
577
+ }
578
+ private $bIsImportant =&gt;
579
+ bool(false)
580
+ protected $iLineNo =&gt;
581
+ int(3)
582
+ }
583
+ }
584
+ 'color' =&gt;
585
+ array(1) {
586
+ [0] =&gt;
587
+ class Sabberworm\CSS\Rule\Rule#16 (4) {
588
+ private $sRule =&gt;
589
+ string(5) &quot;color&quot;
590
+ private $mValue =&gt;
591
+ string(3) &quot;red&quot;
592
+ private $bIsImportant =&gt;
593
+ bool(true)
594
+ protected $iLineNo =&gt;
595
+ int(4)
596
+ }
597
+ }
598
+ }
599
+ protected $iLineNo =&gt;
600
+ int(1)
601
+ }
602
+ }
603
+ protected $iLineNo =&gt;
604
+ int(1)
605
+ }
606
+
607
+ </code></pre>
608
+
609
+ <h4 id="outputrender">Output (<code>render()</code>)</h4>
610
+
611
+ <pre><code class="css">#header {margin: 10px 2em 1cm 2%;font-family: Verdana,Helvetica,&quot;Gill Sans&quot;,sans-serif;color: red !important;}
612
+ </code></pre>
613
+
614
+ <h2 id="contributorsthanksto">Contributors/Thanks to</h2>
615
+
616
+ <ul>
617
+ <li><a href="https://github.com/oliverklee">oliverklee</a> for lots of refactorings, code modernizations and CI integrations</li>
618
+ <li><a href="https://github.com/raxbg">raxbg</a> for contributions to parse <code>calc</code>, grid lines, and various bugfixes.</li>
619
+ <li><a href="https://github.com/westonruter">westonruter</a> for bugfixes and improvements.</li>
620
+ <li><a href="https://github.com/FMCorz">FMCorz</a> for many patches and suggestions, for being able to parse comments and IE hacks (in lenient mode).</li>
621
+ <li><a href="https://github.com/Lullabot">Lullabot</a> for a patch that allows to know the line number for each parsed token.</li>
622
+ <li><a href="https://github.com/ju1ius">ju1ius</a> for the specificity parsing code and the ability to expand/compact shorthand properties.</li>
623
+ <li><a href="https://github.com/ossinkine">ossinkine</a> for a 150 time performance boost.</li>
624
+ <li><a href="https://github.com/GaryJones">GaryJones</a> for lots of input and <a href="https://css-specificity.info/">https://css-specificity.info/</a>.</li>
625
+ <li><a href="https://github.com/docteurklein">docteurklein</a> for output formatting and <code>CSSList-&gt;remove()</code> inspiration.</li>
626
+ <li><a href="https://github.com/nicolopignatelli">nicolopignatelli</a> for PSR-0 compatibility.</li>
627
+ <li><a href="https://github.com/diegoembarcadero">diegoembarcadero</a> for keyframe at-rule parsing.</li>
628
+ <li><a href="https://github.com/goetas">goetas</a> for @namespace at-rule support.</li>
629
+ <li><a href="https://github.com/sabberworm/PHP-CSS-Parser/contributors">View full list</a></li>
630
+ </ul>
631
+
632
+ <h2 id="misc">Misc</h2>
633
+
634
+ <ul>
635
+ <li>Legacy Support: The latest pre-PSR-0 version of this project can be checked with the <code>0.9.0</code> tag.</li>
636
+ <li>Running Tests: To run all unit tests for this project, run <code>composer install</code> to install phpunit and use <code>./vendor/bin/phpunit</code>.</li>
637
+ </ul>
638
+
639
+ </body>
640
+ </html>
641
+
vendor/sabberworm/php-css-parser/README.md CHANGED
@@ -1,22 +1,15 @@
1
- PHP CSS Parser
2
- --------------
3
 
4
- [![build status](https://api.travis-ci.org/sabberworm/PHP-CSS-Parser.svg)](https://travis-ci.org/sabberworm/PHP-CSS-Parser) [![HHVM Status](http://hhvm.h4cc.de/badge/sabberworm/php-css-parser.svg)](http://hhvm.h4cc.de/package/sabberworm/php-css-parser)
5
 
6
  A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS.
7
 
8
  ## Usage
9
 
10
- ### Installation using composer
11
 
12
- Add php-css-parser to your composer.json
13
-
14
- ```json
15
- {
16
- "require": {
17
- "sabberworm/php-css-parser": "*"
18
- }
19
- }
20
  ```
21
 
22
  ### Extraction
@@ -24,14 +17,14 @@ Add php-css-parser to your composer.json
24
  To use the CSS Parser, create a new instance. The constructor takes the following form:
25
 
26
  ```php
27
- new Sabberworm\CSS\Parser($sText);
28
  ```
29
 
30
  To read a file, for example, you’d do the following:
31
 
32
  ```php
33
- $oCssParser = new Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
34
- $oCssDocument = $oCssParser->parse();
35
  ```
36
 
37
  The resulting CSS document structure can be manipulated prior to being output.
@@ -40,42 +33,46 @@ The resulting CSS document structure can be manipulated prior to being output.
40
 
41
  #### Charset
42
 
43
- The charset option is used only if no @charset declaration is found in the CSS file. UTF-8 is the default, so you won’t have to create a settings object at all if you don’t intend to change that.
44
 
45
  ```php
46
- $oSettings = Sabberworm\CSS\Settings::create()->withDefaultCharset('windows-1252');
47
- new Sabberworm\CSS\Parser($sText, $oSettings);
 
48
  ```
49
 
50
  #### Strict parsing
51
 
52
- To have the parser choke on invalid rules, supply a thusly configured Sabberworm\CSS\Settings object:
53
 
54
  ```php
55
- $oCssParser = new Sabberworm\CSS\Parser(file_get_contents('somefile.css'), Sabberworm\CSS\Settings::create()->beStrict());
 
 
 
56
  ```
57
 
58
  #### Disable multibyte functions
59
 
60
- To achieve faster parsing, you can choose to have PHP-CSS-Parser use regular string functions instead of `mb_*` functions. This should work fine in most cases, even for UTF-8 files, as all the multibyte characters are in string literals. Still it’s not recommended to use this with input you have no control over as it’s not thoroughly covered by test cases.
61
 
62
  ```php
63
- $oSettings = Sabberworm\CSS\Settings::create()->withMultibyteSupport(false);
64
- new Sabberworm\CSS\Parser($sText, $oSettings);
65
  ```
66
 
67
  ### Manipulation
68
 
69
- The resulting data structure consists mainly of five basic types: `CSSList`, `RuleSet`, `Rule`, `Selector` and `Value`. There are two additional types used: `Import` and `Charset` which you won’t use often.
70
 
71
  #### CSSList
72
 
73
- `CSSList` represents a generic CSS container, most likely containing declaration blocks (rule sets with a selector) but it may also contain at-rules, charset declarations, etc. `CSSList` has the following concrete subtypes:
74
 
75
  * `Document` – representing the root of a CSS file.
76
- * `MediaQuery` – represents a subsection of a CSSList that only applies to a output device matching the contained media query.
77
 
78
- To access the items stored in a `CSSList` – like the document you got back when calling `$oCssParser->parse()` –, use `getContents()`, then iterate over that collection and use instanceof to check whether you’re dealing with another `CSSList`, a `RuleSet`, a `Import` or a `Charset`.
79
 
80
  To append a new item (selector, media query, etc.) to an existing `CSSList`, construct it using the constructor for this class and use the `append($oItem)` method.
81
 
@@ -83,12 +80,12 @@ To append a new item (selector, media query, etc.) to an existing `CSSList`, con
83
 
84
  `RuleSet` is a container for individual rules. The most common form of a rule set is one constrained by a selector. The following concrete subtypes exist:
85
 
86
- * `AtRuleSet` – for generic at-rules which do not match the ones specifically mentioned like @import, @charset or @media. A common example for this is @font-face.
87
- * `DeclarationBlock` – a RuleSet constrained by a `Selector`; contains an array of selector objects (comma-separated in the CSS) as well as the rules to be applied to the matching elements.
88
 
89
- Note: A `CSSList` can contain other `CSSList`s (and `Import`s as well as a `Charset`) while a `RuleSet` can only contain `Rule`s.
90
 
91
- If you want to manipulate a `RuleSet`, use the methods `addRule(Rule $oRule)`, `getRules()` and `removeRule($mRule)` (which accepts either a Rule instance or a rule name; optionally suffixed by a dash to remove all related rules).
92
 
93
  #### Rule
94
 
@@ -118,46 +115,50 @@ There are a few convenience methods on Document to ease finding, manipulating an
118
 
119
  ## To-Do
120
 
121
- * More convenience methods [like `selectorsWithElement($sId/Class/TagName)`, `attributesOfType($sType)`, `removeAttributesOfType($sType)`]
122
- * Real multibyte support. Currently only multibyte charsets whose first 255 code points take up only one byte and are identical with ASCII are supported (yes, UTF-8 fits this description).
123
  * Named color support (using `Color` instead of an anonymous string literal)
124
 
125
  ## Use cases
126
 
127
- ### Use `Parser` to prepend an id to all selectors
128
 
129
  ```php
130
- $sMyId = "#my_id";
131
- $oParser = new Sabberworm\CSS\Parser($sText);
132
- $oCss = $oParser->parse();
133
- foreach($oCss->getAllDeclarationBlocks() as $oBlock) {
134
- foreach($oBlock->getSelectors() as $oSelector) {
135
- //Loop over all selector parts (the comma-separated strings in a selector) and prepend the id
136
- $oSelector->setSelector($sMyId.' '.$oSelector->getSelector());
137
- }
 
138
  }
139
  ```
140
 
141
  ### Shrink all absolute sizes to half
142
 
143
  ```php
144
- $oParser = new Sabberworm\CSS\Parser($sText);
145
- $oCss = $oParser->parse();
146
- foreach($oCss->getAllValues() as $mValue) {
147
- if($mValue instanceof CSSSize && !$mValue->isRelative()) {
148
- $mValue->setSize($mValue->getSize()/2);
149
- }
150
  }
151
  ```
152
 
153
  ### Remove unwanted rules
154
 
155
  ```php
156
- $oParser = new Sabberworm\CSS\Parser($sText);
157
- $oCss = $oParser->parse();
158
- foreach($oCss->getAllRuleSets() as $oRuleSet) {
159
- $oRuleSet->removeRule('font-'); //Note that the added dash will make this remove all rules starting with font- (like font-size, font-weight, etc.) as well as a potential font-rule
160
- $oRuleSet->removeRule('cursor');
 
 
 
161
  }
162
  ```
163
 
@@ -166,26 +167,27 @@ foreach($oCss->getAllRuleSets() as $oRuleSet) {
166
  To output the entire CSS document into a variable, just use `->render()`:
167
 
168
  ```php
169
- $oCssParser = new Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
170
- $oCssDocument = $oCssParser->parse();
171
- print $oCssDocument->render();
172
  ```
173
 
174
- If you want to format the output, pass an instance of type `Sabberworm\CSS\OutputFormat`:
175
 
176
  ```php
177
- $oFormat = Sabberworm\CSS\OutputFormat::create()->indentWithSpaces(4)->setSpaceBetweenRules("\n");
178
- print $oCssDocument->render($oFormat);
 
179
  ```
180
 
181
  Or use one of the predefined formats:
182
 
183
  ```php
184
- print $oCssDocument->render(Sabberworm\CSS\OutputFormat::createPretty());
185
- print $oCssDocument->render(Sabberworm\CSS\OutputFormat::createCompact());
186
  ```
187
 
188
- To see what you can do with output formatting, look at the tests in `tests/Sabberworm/CSS/OutputFormatTest.php`.
189
 
190
  ## Examples
191
 
@@ -198,16 +200,16 @@ To see what you can do with output formatting, look at the tests in `tests/Sabbe
198
 
199
  @font-face {
200
  font-family: "CrassRoots";
201
- src: url("../media/cr.ttf")
202
  }
203
 
204
  html, body {
205
- font-size: 1.6em
206
  }
207
 
208
  @keyframes mymove {
209
- from { top: 0px; }
210
- to { top: 200px; }
211
  }
212
 
213
  ```
@@ -440,8 +442,7 @@ class Sabberworm\CSS\CSSList\Document#4 (2) {
440
  @charset "utf-8";
441
  @font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}
442
  html, body {font-size: 1.6em;}
443
- @keyframes mymove {from {top: 0px;}
444
- to {top: 200px;}}
445
  ```
446
 
447
  ### Example 2 (Values)
@@ -450,9 +451,9 @@ html, body {font-size: 1.6em;}
450
 
451
  ```css
452
  #header {
453
- margin: 10px 2em 1cm 2%;
454
- font-family: Verdana, Helvetica, "Gill Sans", sans-serif;
455
- color: red !important;
456
  }
457
 
458
  ```
@@ -611,13 +612,14 @@ class Sabberworm\CSS\CSSList\Document#4 (2) {
611
 
612
  ## Contributors/Thanks to
613
 
 
614
  * [raxbg](https://github.com/raxbg) for contributions to parse `calc`, grid lines, and various bugfixes.
615
  * [westonruter](https://github.com/westonruter) for bugfixes and improvements.
616
  * [FMCorz](https://github.com/FMCorz) for many patches and suggestions, for being able to parse comments and IE hacks (in lenient mode).
617
  * [Lullabot](https://github.com/Lullabot) for a patch that allows to know the line number for each parsed token.
618
  * [ju1ius](https://github.com/ju1ius) for the specificity parsing code and the ability to expand/compact shorthand properties.
619
  * [ossinkine](https://github.com/ossinkine) for a 150 time performance boost.
620
- * [GaryJones](https://github.com/GaryJones) for lots of input and [http://css-specificity.info/](http://css-specificity.info/).
621
  * [docteurklein](https://github.com/docteurklein) for output formatting and `CSSList->remove()` inspiration.
622
  * [nicolopignatelli](https://github.com/nicolopignatelli) for PSR-0 compatibility.
623
  * [diegoembarcadero](https://github.com/diegoembarcadero) for keyframe at-rule parsing.
@@ -627,16 +629,4 @@ class Sabberworm\CSS\CSSList\Document#4 (2) {
627
  ## Misc
628
 
629
  * Legacy Support: The latest pre-PSR-0 version of this project can be checked with the `0.9.0` tag.
630
- * Running Tests: To run all unit tests for this project, run `composer install` to install phpunit and use `./vendor/phpunit/phpunit/phpunit`.
631
-
632
- ## License
633
-
634
- PHP-CSS-Parser is freely distributable under the terms of an MIT-style license.
635
-
636
- Copyright (c) 2011 Raphael Schweikert, http://sabberworm.com/
637
-
638
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
639
-
640
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
641
-
642
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ # PHP CSS Parser
 
2
 
3
+ [![Build Status](https://github.com/sabberworm/PHP-CSS-Parser/workflows/CI/badge.svg?branch=master)](https://github.com/sabberworm/PHP-CSS-Parser/actions/)
4
 
5
  A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS.
6
 
7
  ## Usage
8
 
9
+ ### Installation using Composer
10
 
11
+ ```bash
12
+ composer require sabberworm/php-css-parser
 
 
 
 
 
 
13
  ```
14
 
15
  ### Extraction
17
  To use the CSS Parser, create a new instance. The constructor takes the following form:
18
 
19
  ```php
20
+ new \Sabberworm\CSS\Parser($css);
21
  ```
22
 
23
  To read a file, for example, you’d do the following:
24
 
25
  ```php
26
+ $parser = new \Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
27
+ $cssDocument = $parser->parse();
28
  ```
29
 
30
  The resulting CSS document structure can be manipulated prior to being output.
33
 
34
  #### Charset
35
 
36
+ The charset option is used only if no `@charset` declaration is found in the CSS file. UTF-8 is the default, so you won’t have to create a settings object at all if you don’t intend to change that.
37
 
38
  ```php
39
+ $settings = \Sabberworm\CSS\Settings::create()
40
+ ->withDefaultCharset('windows-1252');
41
+ $parser = new \Sabberworm\CSS\Parser($css, $settings);
42
  ```
43
 
44
  #### Strict parsing
45
 
46
+ To have the parser choke on invalid rules, supply a thusly configured `\Sabberworm\CSS\Settings` object:
47
 
48
  ```php
49
+ $parser = new \Sabberworm\CSS\Parser(
50
+ file_get_contents('somefile.css'),
51
+ \Sabberworm\CSS\Settings::create()->beStrict()
52
+ );
53
  ```
54
 
55
  #### Disable multibyte functions
56
 
57
+ To achieve faster parsing, you can choose to have PHP-CSS-Parser use regular string functions instead of `mb_*` functions. This should work fine in most cases, even for UTF-8 files, as all the multibyte characters are in string literals. Still it’s not recommended using this with input you have no control over as it’s not thoroughly covered by test cases.
58
 
59
  ```php
60
+ $settings = \Sabberworm\CSS\Settings::create()->withMultibyteSupport(false);
61
+ $parser = new \Sabberworm\CSS\Parser($css, $settings);
62
  ```
63
 
64
  ### Manipulation
65
 
66
+ The resulting data structure consists mainly of five basic types: `CSSList`, `RuleSet`, `Rule`, `Selector` and `Value`. There are two additional types used: `Import` and `Charset`, which you won’t use often.
67
 
68
  #### CSSList
69
 
70
+ `CSSList` represents a generic CSS container, most likely containing declaration blocks (rule sets with a selector), but it may also contain at-rules, charset declarations, etc. `CSSList` has the following concrete subtypes:
71
 
72
  * `Document` – representing the root of a CSS file.
73
+ * `MediaQuery` – represents a subsection of a `CSSList` that only applies to an output device matching the contained media query.
74
 
75
+ To access the items stored in a `CSSList` – like the document you got back when calling `$parser->parse()` –, use `getContents()`, then iterate over that collection and use instanceof to check whether you’re dealing with another `CSSList`, a `RuleSet`, a `Import` or a `Charset`.
76
 
77
  To append a new item (selector, media query, etc.) to an existing `CSSList`, construct it using the constructor for this class and use the `append($oItem)` method.
78
 
80
 
81
  `RuleSet` is a container for individual rules. The most common form of a rule set is one constrained by a selector. The following concrete subtypes exist:
82
 
83
+ * `AtRuleSet` – for generic at-rules which do not match the ones specifically mentioned like `@import`, `@charset` or `@media`. A common example for this is `@font-face`.
84
+ * `DeclarationBlock` – a `RuleSet` constrained by a `Selector`; contains an array of selector objects (comma-separated in the CSS) as well as the rules to be applied to the matching elements.
85
 
86
+ Note: A `CSSList` can contain other `CSSList`s (and `Import`s as well as a `Charset`), while a `RuleSet` can only contain `Rule`s.
87
 
88
+ If you want to manipulate a `RuleSet`, use the methods `addRule(Rule $rule)`, `getRules()` and `removeRule($rule)` (which accepts either a `Rule` instance or a rule name; optionally suffixed by a dash to remove all related rules).
89
 
90
  #### Rule
91
 
115
 
116
  ## To-Do
117
 
118
+ * More convenience methods (like `selectorsWithElement($sId/Class/TagName)`, `attributesOfType($type)`, `removeAttributesOfType($type)`)
119
+ * Real multibyte support. Currently, only multibyte charsets whose first 255 code points take up only one byte and are identical with ASCII are supported (yes, UTF-8 fits this description).
120
  * Named color support (using `Color` instead of an anonymous string literal)
121
 
122
  ## Use cases
123
 
124
+ ### Use `Parser` to prepend an ID to all selectors
125
 
126
  ```php
127
+ $myId = "#my_id";
128
+ $parser = new \Sabberworm\CSS\Parser($css);
129
+ $cssDocument = $parser->parse();
130
+ foreach ($cssDocument->getAllDeclarationBlocks() as $block) {
131
+ foreach ($block->getSelectors() as $selector) {
132
+ // Loop over all selector parts (the comma-separated strings in a
133
+ // selector) and prepend the ID.
134
+ $selector->setSelector($myId.' '.$selector->getSelector());
135
+ }
136
  }
137
  ```
138
 
139
  ### Shrink all absolute sizes to half
140
 
141
  ```php
142
+ $parser = new \Sabberworm\CSS\Parser($css);
143
+ $cssDocument = $parser->parse();
144
+ foreach ($cssDocument->getAllValues() as $value) {
145
+ if ($value instanceof CSSSize && !$value->isRelative()) {
146
+ $value->setSize($value->getSize() / 2);
147
+ }
148
  }
149
  ```
150
 
151
  ### Remove unwanted rules
152
 
153
  ```php
154
+ $parser = new \Sabberworm\CSS\Parser($css);
155
+ $cssDocument = $parser->parse();
156
+ foreach($cssDocument->getAllRuleSets() as $oRuleSet) {
157
+ // Note that the added dash will make this remove all rules starting with
158
+ // `font-` (like `font-size`, `font-weight`, etc.) as well as a potential
159
+ // `font-rule`.
160
+ $oRuleSet->removeRule('font-');
161
+ $oRuleSet->removeRule('cursor');
162
  }
163
  ```
164
 
167
  To output the entire CSS document into a variable, just use `->render()`:
168
 
169
  ```php
170
+ $parser = new \Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
171
+ $cssDocument = $parser->parse();
172
+ print $cssDocument->render();
173
  ```
174
 
175
+ If you want to format the output, pass an instance of type `\Sabberworm\CSS\OutputFormat`:
176
 
177
  ```php
178
+ $format = \Sabberworm\CSS\OutputFormat::create()
179
+ ->indentWithSpaces(4)->setSpaceBetweenRules("\n");
180
+ print $cssDocument->render($format);
181
  ```
182
 
183
  Or use one of the predefined formats:
184
 
185
  ```php
186
+ print $cssDocument->render(Sabberworm\CSS\OutputFormat::createPretty());
187
+ print $cssDocument->render(Sabberworm\CSS\OutputFormat::createCompact());
188
  ```
189
 
190
+ To see what you can do with output formatting, look at the tests in `tests/OutputFormatTest.php`.
191
 
192
  ## Examples
193
 
200
 
201
  @font-face {
202
  font-family: "CrassRoots";
203
+ src: url("../media/cr.ttf");
204
  }
205
 
206
  html, body {
207
+ font-size: 1.6em;
208
  }
209
 
210
  @keyframes mymove {
211
+ from { top: 0px; }
212
+ to { top: 200px; }
213
  }
214
 
215
  ```
442
  @charset "utf-8";
443
  @font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}
444
  html, body {font-size: 1.6em;}
445
+ @keyframes mymove {from {top: 0px;} to {top: 200px;}}
 
446
  ```
447
 
448
  ### Example 2 (Values)
451
 
452
  ```css
453
  #header {
454
+ margin: 10px 2em 1cm 2%;
455
+ font-family: Verdana, Helvetica, "Gill Sans", sans-serif;
456
+ color: red !important;
457
  }
458
 
459
  ```
612
 
613
  ## Contributors/Thanks to
614
 
615
+ * [oliverklee](https://github.com/oliverklee) for lots of refactorings, code modernizations and CI integrations
616
  * [raxbg](https://github.com/raxbg) for contributions to parse `calc`, grid lines, and various bugfixes.
617
  * [westonruter](https://github.com/westonruter) for bugfixes and improvements.
618
  * [FMCorz](https://github.com/FMCorz) for many patches and suggestions, for being able to parse comments and IE hacks (in lenient mode).
619
  * [Lullabot](https://github.com/Lullabot) for a patch that allows to know the line number for each parsed token.
620
  * [ju1ius](https://github.com/ju1ius) for the specificity parsing code and the ability to expand/compact shorthand properties.
621
  * [ossinkine](https://github.com/ossinkine) for a 150 time performance boost.
622
+ * [GaryJones](https://github.com/GaryJones) for lots of input and [https://css-specificity.info/](https://css-specificity.info/).
623
  * [docteurklein](https://github.com/docteurklein) for output formatting and `CSSList->remove()` inspiration.
624
  * [nicolopignatelli](https://github.com/nicolopignatelli) for PSR-0 compatibility.
625
  * [diegoembarcadero](https://github.com/diegoembarcadero) for keyframe at-rule parsing.
629
  ## Misc
630
 
631
  * Legacy Support: The latest pre-PSR-0 version of this project can be checked with the `0.9.0` tag.
632
+ * Running Tests: To run all unit tests for this project, run `composer install` to install phpunit and use `./vendor/bin/phpunit`.
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/composer.json CHANGED
@@ -2,20 +2,68 @@
2
  "name": "sabberworm/php-css-parser",
3
  "type": "library",
4
  "description": "Parser for CSS Files written in PHP",
5
- "keywords": ["parser", "css", "stylesheet"],
6
- "homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser",
 
 
 
 
7
  "license": "MIT",
8
  "authors": [
9
- {"name": "Raphael Schweikert"}
 
 
10
  ],
11
  "require": {
12
- "php": ">=5.3.2"
 
13
  },
14
  "require-dev": {
15
- "phpunit/phpunit": "~4.8",
16
  "codacy/coverage": "^1.4"
17
  },
 
 
 
18
  "autoload": {
19
- "psr-0": { "Sabberworm\\CSS": "lib/" }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
21
  }
2
  "name": "sabberworm/php-css-parser",
3
  "type": "library",
4
  "description": "Parser for CSS Files written in PHP",
5
+ "keywords": [
6
+ "parser",
7
+ "css",
8
+ "stylesheet"
9
+ ],
10
+ "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser",
11
  "license": "MIT",
12
  "authors": [
13
+ {
14
+ "name": "Raphael Schweikert"
15
+ }
16
  ],
17
  "require": {
18
+ "php": ">=5.6.20",
19
+ "ext-iconv": "*"
20
  },
21
  "require-dev": {
22
+ "phpunit/phpunit": "^4.8.36",
23
  "codacy/coverage": "^1.4"
24
  },
25
+ "suggest": {
26
+ "ext-mbstring": "for parsing UTF-8 CSS"
27
+ },
28
  "autoload": {
29
+ "psr-4": {
30
+ "Sabberworm\\CSS\\": "src/"
31
+ }
32
+ },
33
+ "autoload-dev": {
34
+ "psr-4": {
35
+ "Sabberworm\\CSS\\Tests\\": "tests/"
36
+ }
37
+ },
38
+ "scripts": {
39
+ "ci": [
40
+ "@ci:static"
41
+ ],
42
+ "ci:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots bin src tests",
43
+ "ci:php:sniffer": "@php ./.phive/phpcs.phar --standard=config/phpcs.xml bin src tests",
44
+ "ci:php:stan": "@php ./.phive/phpstan.phar --configuration=config/phpstan.neon",
45
+ "ci:static": [
46
+ "@ci:php:fixer",
47
+ "@ci:php:sniffer",
48
+ "@ci:php:stan"
49
+ ],
50
+ "fix:php": [
51
+ "@fix:php:fixer",
52
+ "@fix:php:sniffer"
53
+ ],
54
+ "fix:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix bin src tests",
55
+ "fix:php:sniffer": "@php ./.phive/phpcbf.phar --standard=config/phpcs.xml bin src tests",
56
+ "phpstan:baseline": "@php ./.phive/phpstan.phar --configuration=config/phpstan.neon --generate-baseline=config/phpstan-baseline.neon"
57
+ },
58
+ "scripts-descriptions": {
59
+ "ci": "Runs all dynamic and static code checks (i.e. currently, only the static checks).",
60
+ "ci:php:fixer": "Checks the code style with PHP CS Fixer.",
61
+ "ci:php:sniffer": "Checks the code style with PHP_CodeSniffer.",
62
+ "ci:php:stan": "Checks the types with PHPStan.",
63
+ "ci:static": "Runs all static code analysis checks for the code.",
64
+ "fix:php": "Autofixes all autofixable issues in the PHP code.",
65
+ "fix:php:fixer": "Fixes autofixable issues found by PHP CS Fixer.",
66
+ "fix:php:sniffer": "Fixes autofixable issues found by PHP_CodeSniffer.",
67
+ "phpstand:baseline": "Updates the PHPStan baseline file to match the code."
68
  }
69
  }
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\CSSList;
4
-
5
- use Sabberworm\CSS\Property\AtRule;
6
-
7
- /**
8
- * A BlockList constructed by an unknown @-rule. @media rules are rendered into AtRuleBlockList objects.
9
- */
10
- class AtRuleBlockList extends CSSBlockList implements AtRule {
11
-
12
- private $sType;
13
- private $sArgs;
14
-
15
- public function __construct($sType, $sArgs = '', $iLineNo = 0) {
16
- parent::__construct($iLineNo);
17
- $this->sType = $sType;
18
- $this->sArgs = $sArgs;
19
- }
20
-
21
- public function atRuleName() {
22
- return $this->sType;
23
- }
24
-
25
- public function atRuleArgs() {
26
- return $this->sArgs;
27
- }
28
-
29
- public function __toString() {
30
- return $this->render(new \Sabberworm\CSS\OutputFormat());
31
- }
32
-
33
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
34
- $sArgs = $this->sArgs;
35
- if($sArgs) {
36
- $sArgs = ' ' . $sArgs;
37
- }
38
- $sResult = $oOutputFormat->sBeforeAtRuleBlock;
39
- $sResult .= "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
40
- $sResult .= parent::render($oOutputFormat);
41
- $sResult .= '}';
42
- $sResult .= $oOutputFormat->sAfterAtRuleBlock;
43
- return $sResult;
44
- }
45
-
46
- public function isRootList() {
47
- return false;
48
- }
49
-
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php DELETED
@@ -1,107 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\CSSList;
4
-
5
- use Sabberworm\CSS\RuleSet\DeclarationBlock;
6
- use Sabberworm\CSS\RuleSet\RuleSet;
7
- use Sabberworm\CSS\Property\Selector;
8
- use Sabberworm\CSS\Rule\Rule;
9
- use Sabberworm\CSS\Value\ValueList;
10
- use Sabberworm\CSS\Value\CSSFunction;
11
-
12
- /**
13
- * A CSSBlockList is a CSSList whose DeclarationBlocks are guaranteed to contain valid declaration blocks or at-rules.
14
- * Most CSSLists conform to this category but some at-rules (such as @keyframes) do not.
15
- */
16
- abstract class CSSBlockList extends CSSList {
17
- public function __construct($iLineNo = 0) {
18
- parent::__construct($iLineNo);
19
- }
20
-
21
- protected function allDeclarationBlocks(&$aResult) {
22
- foreach ($this->aContents as $mContent) {
23
- if ($mContent instanceof DeclarationBlock) {
24
- $aResult[] = $mContent;
25
- } else if ($mContent instanceof CSSBlockList) {
26
- $mContent->allDeclarationBlocks($aResult);
27
- }
28
- }
29
- }
30
-
31
- protected function allRuleSets(&$aResult) {
32
- foreach ($this->aContents as $mContent) {
33
- if ($mContent instanceof RuleSet) {
34
- $aResult[] = $mContent;
35
- } else if ($mContent instanceof CSSBlockList) {
36
- $mContent->allRuleSets($aResult);
37
- }
38
- }
39
- }
40
-
41
- protected function allValues($oElement, &$aResult, $sSearchString = null, $bSearchInFunctionArguments = false) {
42
- if ($oElement instanceof CSSBlockList) {
43
- foreach ($oElement->getContents() as $oContent) {
44
- $this->allValues($oContent, $aResult, $sSearchString, $bSearchInFunctionArguments);
45
- }
46
- } else if ($oElement instanceof RuleSet) {
47
- foreach ($oElement->getRules($sSearchString) as $oRule) {
48
- $this->allValues($oRule, $aResult, $sSearchString, $bSearchInFunctionArguments);
49
- }
50
- } else if ($oElement instanceof Rule) {
51
- $this->allValues($oElement->getValue(), $aResult, $sSearchString, $bSearchInFunctionArguments);
52
- } else if ($oElement instanceof ValueList) {
53
- if ($bSearchInFunctionArguments || !($oElement instanceof CSSFunction)) {
54
- foreach ($oElement->getListComponents() as $mComponent) {
55
- $this->allValues($mComponent, $aResult, $sSearchString, $bSearchInFunctionArguments);
56
- }
57
- }
58
- } else {
59
- //Non-List Value or CSSString (CSS identifier)
60
- $aResult[] = $oElement;
61
- }
62
- }
63
-
64
- protected function allSelectors(&$aResult, $sSpecificitySearch = null) {
65
- $aDeclarationBlocks = array();
66
- $this->allDeclarationBlocks($aDeclarationBlocks);
67
- foreach ($aDeclarationBlocks as $oBlock) {
68
- foreach ($oBlock->getSelectors() as $oSelector) {
69
- if ($sSpecificitySearch === null) {
70
- $aResult[] = $oSelector;
71
- } else {
72
- $sComparator = '===';
73
- $aSpecificitySearch = explode(' ', $sSpecificitySearch);
74
- $iTargetSpecificity = $aSpecificitySearch[0];
75
- if(count($aSpecificitySearch) > 1) {
76
- $sComparator = $aSpecificitySearch[0];
77
- $iTargetSpecificity = $aSpecificitySearch[1];
78
- }
79
- $iTargetSpecificity = (int)$iTargetSpecificity;
80
- $iSelectorSpecificity = $oSelector->getSpecificity();
81
- $bMatches = false;
82
- switch($sComparator) {
83
- case '<=':
84
- $bMatches = $iSelectorSpecificity <= $iTargetSpecificity;
85
- break;
86
- case '<':
87
- $bMatches = $iSelectorSpecificity < $iTargetSpecificity;
88
- break;
89
- case '>=':
90
- $bMatches = $iSelectorSpecificity >= $iTargetSpecificity;
91
- break;
92
- case '>':
93
- $bMatches = $iSelectorSpecificity > $iTargetSpecificity;
94
- break;
95
- default:
96
- $bMatches = $iSelectorSpecificity === $iTargetSpecificity;
97
- break;
98
- }
99
- if ($bMatches) {
100
- $aResult[] = $oSelector;
101
- }
102
- }
103
- }
104
- }
105
- }
106
-
107
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSList.php DELETED
@@ -1,348 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\CSSList;
4
-
5
- use Sabberworm\CSS\Comment\Commentable;
6
- use Sabberworm\CSS\Parsing\ParserState;
7
- use Sabberworm\CSS\Parsing\SourceException;
8
- use Sabberworm\CSS\Parsing\UnexpectedTokenException;
9
- use Sabberworm\CSS\Property\AtRule;
10
- use Sabberworm\CSS\Property\Charset;
11
- use Sabberworm\CSS\Property\CSSNamespace;
12
- use Sabberworm\CSS\Property\Import;
13
- use Sabberworm\CSS\Property\Selector;
14
- use Sabberworm\CSS\Renderable;
15
- use Sabberworm\CSS\RuleSet\AtRuleSet;
16
- use Sabberworm\CSS\RuleSet\DeclarationBlock;
17
- use Sabberworm\CSS\RuleSet\RuleSet;
18
- use Sabberworm\CSS\Value\CSSString;
19
- use Sabberworm\CSS\Value\URL;
20
- use Sabberworm\CSS\Value\Value;
21
-
22
- /**
23
- * A CSSList is the most generic container available. Its contents include RuleSet as well as other CSSList objects.
24
- * Also, it may contain Import and Charset objects stemming from @-rules.
25
- */
26
- abstract class CSSList implements Renderable, Commentable {
27
-
28
- protected $aComments;
29
- protected $aContents;
30
- protected $iLineNo;
31
-
32
- public function __construct($iLineNo = 0) {
33
- $this->aComments = array();
34
- $this->aContents = array();
35
- $this->iLineNo = $iLineNo;
36
- }
37
-
38
- public static function parseList(ParserState $oParserState, CSSList $oList) {
39
- $bIsRoot = $oList instanceof Document;
40
- if(is_string($oParserState)) {
41
- $oParserState = new ParserState($oParserState);
42
- }
43
- $bLenientParsing = $oParserState->getSettings()->bLenientParsing;
44
- while(!$oParserState->isEnd()) {
45
- $comments = $oParserState->consumeWhiteSpace();
46
- $oListItem = null;
47
- if($bLenientParsing) {
48
- try {
49
- $oListItem = self::parseListItem($oParserState, $oList);
50
- } catch (UnexpectedTokenException $e) {
51
- $oListItem = false;
52
- }
53
- } else {
54
- $oListItem = self::parseListItem($oParserState, $oList);
55
- }
56
- if($oListItem === null) {
57
- // List parsing finished
58
- return;
59
- }
60
- if($oListItem) {
61
- $oListItem->setComments($comments);
62
- $oList->append($oListItem);
63
- }
64
- $oParserState->consumeWhiteSpace();
65
- }
66
- if(!$bIsRoot && !$bLenientParsing) {
67
- throw new SourceException("Unexpected end of document", $oParserState->currentLine());
68
- }
69
- }
70
-
71
- private static function parseListItem(ParserState $oParserState, CSSList $oList) {
72
- $bIsRoot = $oList instanceof Document;
73
- if ($oParserState->comes('@')) {
74
- $oAtRule = self::parseAtRule($oParserState);
75
- if($oAtRule instanceof Charset) {
76
- if(!$bIsRoot) {
77
- throw new UnexpectedTokenException('@charset may only occur in root document', '', 'custom', $oParserState->currentLine());
78
- }
79
- if(count($oList->getContents()) > 0) {
80
- throw new UnexpectedTokenException('@charset must be the first parseable token in a document', '', 'custom', $oParserState->currentLine());
81
- }
82
- $oParserState->setCharset($oAtRule->getCharset()->getString());
83
- }
84
- return $oAtRule;
85
- } else if ($oParserState->comes('}')) {
86
- $oParserState->consume('}');
87
- if ($bIsRoot) {
88
- if ($oParserState->getSettings()->bLenientParsing) {
89
- while ($oParserState->comes('}')) $oParserState->consume('}');
90
- return DeclarationBlock::parse($oParserState);
91
- } else {
92
- throw new SourceException("Unopened {", $oParserState->currentLine());
93
- }
94
- } else {
95
- return null;
96
- }
97
- } else {
98
- return DeclarationBlock::parse($oParserState);
99
- }
100
- }
101
-
102
- private static function parseAtRule(ParserState $oParserState) {
103
- $oParserState->consume('@');
104
- $sIdentifier = $oParserState->parseIdentifier();
105
- $iIdentifierLineNum = $oParserState->currentLine();
106
- $oParserState->consumeWhiteSpace();
107
- if ($sIdentifier === 'import') {
108
- $oLocation = URL::parse($oParserState);
109
- $oParserState->consumeWhiteSpace();
110
- $sMediaQuery = null;
111
- if (!$oParserState->comes(';')) {
112
- $sMediaQuery = $oParserState->consumeUntil(';');
113
- }
114
- $oParserState->consume(';');
115
- return new Import($oLocation, $sMediaQuery, $iIdentifierLineNum);
116
- } else if ($sIdentifier === 'charset') {
117
- $sCharset = CSSString::parse($oParserState);
118
- $oParserState->consumeWhiteSpace();
119
- $oParserState->consume(';');
120
- return new Charset($sCharset, $iIdentifierLineNum);
121
- } else if (self::identifierIs($sIdentifier, 'keyframes')) {
122
- $oResult = new KeyFrame($iIdentifierLineNum);
123
- $oResult->setVendorKeyFrame($sIdentifier);
124
- $oResult->setAnimationName(trim($oParserState->consumeUntil('{', false, true)));
125
- CSSList::parseList($oParserState, $oResult);
126
- return $oResult;
127
- } else if ($sIdentifier === 'namespace') {
128
- $sPrefix = null;
129
- $mUrl = Value::parsePrimitiveValue($oParserState);
130
- if (!$oParserState->comes(';')) {
131
- $sPrefix = $mUrl;
132
- $mUrl = Value::parsePrimitiveValue($oParserState);
133
- }
134
- $oParserState->consume(';');
135
- if ($sPrefix !== null && !is_string($sPrefix)) {
136
- throw new UnexpectedTokenException('Wrong namespace prefix', $sPrefix, 'custom', $iIdentifierLineNum);
137
- }
138
- if (!($mUrl instanceof CSSString || $mUrl instanceof URL)) {
139
- throw new UnexpectedTokenException('Wrong namespace url of invalid type', $mUrl, 'custom', $iIdentifierLineNum);
140
- }
141
- return new CSSNamespace($mUrl, $sPrefix, $iIdentifierLineNum);
142
- } else {
143
- //Unknown other at rule (font-face or such)
144
- $sArgs = trim($oParserState->consumeUntil('{', false, true));
145
- if (substr_count($sArgs, "(") != substr_count($sArgs, ")")) {
146
- if($oParserState->getSettings()->bLenientParsing) {
147
- return NULL;
148
- } else {
149
- throw new SourceException("Unmatched brace count in media query", $oParserState->currentLine());
150
- }
151
- }
152
- $bUseRuleSet = true;
153
- foreach(explode('/', AtRule::BLOCK_RULES) as $sBlockRuleName) {
154
- if(self::identifierIs($sIdentifier, $sBlockRuleName)) {
155
- $bUseRuleSet = false;
156
- break;
157
- }
158
- }
159
- if($bUseRuleSet) {
160
- $oAtRule = new AtRuleSet($sIdentifier, $sArgs, $iIdentifierLineNum);
161
- RuleSet::parseRuleSet($oParserState, $oAtRule);
162
- } else {
163
- $oAtRule = new AtRuleBlockList($sIdentifier, $sArgs, $iIdentifierLineNum);
164
- CSSList::parseList($oParserState, $oAtRule);
165
- }
166
- return $oAtRule;
167
- }
168
- }
169
-
170
- /**
171
- * Tests an identifier for a given value. Since identifiers are all keywords, they can be vendor-prefixed. We need to check for these versions too.
172
- */
173
- private static function identifierIs($sIdentifier, $sMatch) {
174
- return (strcasecmp($sIdentifier, $sMatch) === 0)
175
- ?: preg_match("/^(-\\w+-)?$sMatch$/i", $sIdentifier) === 1;
176
- }
177
-
178
-
179
- /**
180
- * @return int
181
- */
182
- public function getLineNo() {
183
- return $this->iLineNo;
184
- }
185
-
186
- /**
187
- * Prepend item to list of contents.
188
- *
189
- * @param object $oItem Item.
190
- */
191
- public function prepend($oItem) {
192
- array_unshift($this->aContents, $oItem);
193
- }
194
-
195
- /**
196
- * Append item to list of contents.
197
- *
198
- * @param object $oItem Item.
199
- */
200
- public function append($oItem) {
201
- $this->aContents[] = $oItem;
202
- }
203
-
204
- /**
205
- * Splice the list of contents.
206
- *
207
- * @param int $iOffset Offset.
208
- * @param int $iLength Length. Optional.
209
- * @param RuleSet[] $mReplacement Replacement. Optional.
210
- */
211
- public function splice($iOffset, $iLength = null, $mReplacement = null) {
212
- array_splice($this->aContents, $iOffset, $iLength, $mReplacement);
213
- }
214
-
215
- /**
216
- * Removes an item from the CSS list.
217
- * @param RuleSet|Import|Charset|CSSList $oItemToRemove May be a RuleSet (most likely a DeclarationBlock), a Import, a Charset or another CSSList (most likely a MediaQuery)
218
- * @return bool Whether the item was removed.
219
- */
220
- public function remove($oItemToRemove) {
221
- $iKey = array_search($oItemToRemove, $this->aContents, true);
222
- if ($iKey !== false) {
223
- unset($this->aContents[$iKey]);
224
- return true;
225
- }
226
- return false;
227
- }
228
-
229
- /**
230
- * Replaces an item from the CSS list.
231
- * @param RuleSet|Import|Charset|CSSList $oItemToRemove May be a RuleSet (most likely a DeclarationBlock), a Import, a Charset or another CSSList (most likely a MediaQuery)
232
- */
233
- public function replace($oOldItem, $oNewItem) {
234
- $iKey = array_search($oOldItem, $this->aContents, true);
235
- if ($iKey !== false) {
236
- array_splice($this->aContents, $iKey, 1, $oNewItem);
237
- return true;
238
- }
239
- return false;
240
- }
241
-
242
- /**
243
- * Set the contents.
244
- * @param array $aContents Objects to set as content.
245
- */
246
- public function setContents(array $aContents) {
247
- $this->aContents = array();
248
- foreach ($aContents as $content) {
249
- $this->append($content);
250
- }
251
- }
252
-
253
- /**
254
- * Removes a declaration block from the CSS list if it matches all given selectors.
255
- * @param array|string $mSelector The selectors to match.
256
- * @param boolean $bRemoveAll Whether to stop at the first declaration block found or remove all blocks
257
- */
258
- public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false) {
259
- if ($mSelector instanceof DeclarationBlock) {
260
- $mSelector = $mSelector->getSelectors();
261
- }
262
- if (!is_array($mSelector)) {
263
- $mSelector = explode(',', $mSelector);
264
- }
265
- foreach ($mSelector as $iKey => &$mSel) {
266
- if (!($mSel instanceof Selector)) {
267
- $mSel = new Selector($mSel);
268
- }
269
- }
270
- foreach ($this->aContents as $iKey => $mItem) {
271
- if (!($mItem instanceof DeclarationBlock)) {
272
- continue;
273
- }
274
- if ($mItem->getSelectors() == $mSelector) {
275
- unset($this->aContents[$iKey]);
276
- if (!$bRemoveAll) {
277
- return;
278
- }
279
- }
280
- }
281
- }
282
-
283
- public function __toString() {
284
- return $this->render(new \Sabberworm\CSS\OutputFormat());
285
- }
286
-
287
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
288
- $sResult = '';
289
- $bIsFirst = true;
290
- $oNextLevel = $oOutputFormat;
291
- if(!$this->isRootList()) {
292
- $oNextLevel = $oOutputFormat->nextLevel();
293
- }
294
- foreach ($this->aContents as $oContent) {
295
- $sRendered = $oOutputFormat->safely(function() use ($oNextLevel, $oContent) {
296
- return $oContent->render($oNextLevel);
297
- });
298
- if($sRendered === null) {
299
- continue;
300
- }
301
- if($bIsFirst) {
302
- $bIsFirst = false;
303
- $sResult .= $oNextLevel->spaceBeforeBlocks();
304
- } else {
305
- $sResult .= $oNextLevel->spaceBetweenBlocks();
306
- }
307
- $sResult .= $sRendered;
308
- }
309
-
310
- if(!$bIsFirst) {
311
- // Had some output
312
- $sResult .= $oOutputFormat->spaceAfterBlocks();
313
- }
314
-
315
- return $sResult;
316
- }
317
-
318
- /**
319
- * Return true if the list can not be further outdented. Only important when rendering.
320
- */
321
- public abstract function isRootList();
322
-
323
- public function getContents() {
324
- return $this->aContents;
325
- }
326
-
327
- /**
328
- * @param array $aComments Array of comments.
329
- */
330
- public function addComments(array $aComments) {
331
- $this->aComments = array_merge($this->aComments, $aComments);
332
- }
333
-
334
- /**
335
- * @return array
336
- */
337
- public function getComments() {
338
- return $this->aComments;
339
- }
340
-
341
- /**
342
- * @param array $aComments Array containing Comment objects.
343
- */
344
- public function setComments(array $aComments) {
345
- $this->aComments = $aComments;
346
- }
347
-
348
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/Document.php DELETED
@@ -1,110 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\CSSList;
4
-
5
- use Sabberworm\CSS\Parsing\ParserState;
6
-
7
- /**
8
- * The root CSSList of a parsed file. Contains all top-level css contents, mostly declaration blocks, but also any @-rules encountered.
9
- */
10
- class Document extends CSSBlockList {
11
- /**
12
- * Document constructor.
13
- * @param int $iLineNo
14
- */
15
- public function __construct($iLineNo = 0) {
16
- parent::__construct($iLineNo);
17
- }
18
-
19
- public static function parse(ParserState $oParserState) {
20
- $oDocument = new Document($oParserState->currentLine());
21
- CSSList::parseList($oParserState, $oDocument);
22
- return $oDocument;
23
- }
24
-
25
- /**
26
- * Gets all DeclarationBlock objects recursively.
27
- */
28
- public function getAllDeclarationBlocks() {
29
- $aResult = array();
30
- $this->allDeclarationBlocks($aResult);
31
- return $aResult;
32
- }
33
-
34
- /**
35
- * @deprecated use getAllDeclarationBlocks()
36
- */
37
- public function getAllSelectors() {
38
- return $this->getAllDeclarationBlocks();
39
- }
40
-
41
- /**
42
- * Returns all RuleSet objects found recursively in the tree.
43
- */
44
- public function getAllRuleSets() {
45
- $aResult = array();
46
- $this->allRuleSets($aResult);
47
- return $aResult;
48
- }
49
-
50
- /**
51
- * Returns all Value objects found recursively in the tree.
52
- * @param (object|string) $mElement the CSSList or RuleSet to start the search from (defaults to the whole document). If a string is given, it is used as rule name filter (@see{RuleSet->getRules()}).
53
- * @param (bool) $bSearchInFunctionArguments whether to also return Value objects used as Function arguments.
54
- */
55
- public function getAllValues($mElement = null, $bSearchInFunctionArguments = false) {
56
- $sSearchString = null;
57
- if ($mElement === null) {
58
- $mElement = $this;
59
- } else if (is_string($mElement)) {
60
- $sSearchString = $mElement;
61
- $mElement = $this;
62
- }
63
- $aResult = array();
64
- $this->allValues($mElement, $aResult, $sSearchString, $bSearchInFunctionArguments);
65
- return $aResult;
66
- }
67
-
68
- /**
69
- * Returns all Selector objects found recursively in the tree.
70
- * Note that this does not yield the full DeclarationBlock that the selector belongs to (and, currently, there is no way to get to that).
71
- * @param $sSpecificitySearch An optional filter by specificity. May contain a comparison operator and a number or just a number (defaults to "==").
72
- * @example getSelectorsBySpecificity('>= 100')
73
- */
74
- public function getSelectorsBySpecificity($sSpecificitySearch = null) {
75
- $aResult = array();
76
- $this->allSelectors($aResult, $sSpecificitySearch);
77
- return $aResult;
78
- }
79
-
80
- /**
81
- * Expands all shorthand properties to their long value
82
- */
83
- public function expandShorthands() {
84
- foreach ($this->getAllDeclarationBlocks() as $oDeclaration) {
85
- $oDeclaration->expandShorthands();
86
- }
87
- }
88
-
89
- /**
90
- * Create shorthands properties whenever possible
91
- */
92
- public function createShorthands() {
93
- foreach ($this->getAllDeclarationBlocks() as $oDeclaration) {
94
- $oDeclaration->createShorthands();
95
- }
96
- }
97
-
98
- // Override render() to make format argument optional
99
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat = null) {
100
- if($oOutputFormat === null) {
101
- $oOutputFormat = new \Sabberworm\CSS\OutputFormat();
102
- }
103
- return parent::render($oOutputFormat);
104
- }
105
-
106
- public function isRootList() {
107
- return true;
108
- }
109
-
110
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/KeyFrame.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\CSSList;
4
-
5
- use Sabberworm\CSS\Property\AtRule;
6
-
7
- class KeyFrame extends CSSList implements AtRule {
8
-
9
- private $vendorKeyFrame;
10
- private $animationName;
11
-
12
- public function __construct($iLineNo = 0) {
13
- parent::__construct($iLineNo);
14
- $this->vendorKeyFrame = null;
15
- $this->animationName = null;
16
- }
17
-
18
- public function setVendorKeyFrame($vendorKeyFrame) {
19
- $this->vendorKeyFrame = $vendorKeyFrame;
20
- }
21
-
22
- public function getVendorKeyFrame() {
23
- return $this->vendorKeyFrame;
24
- }
25
-
26
- public function setAnimationName($animationName) {
27
- $this->animationName = $animationName;
28
- }
29
-
30
- public function getAnimationName() {
31
- return $this->animationName;
32
- }
33
-
34
- public function __toString() {
35
- return $this->render(new \Sabberworm\CSS\OutputFormat());
36
- }
37
-
38
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
39
- $sResult = "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{";
40
- $sResult .= parent::render($oOutputFormat);
41
- $sResult .= '}';
42
- return $sResult;
43
- }
44
-
45
- public function isRootList() {
46
- return false;
47
- }
48
-
49
- public function atRuleName() {
50
- return $this->vendorKeyFrame;
51
- }
52
-
53
- public function atRuleArgs() {
54
- return $this->animationName;
55
- }
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Comment.php DELETED
@@ -1,51 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Comment;
4
-
5
- use Sabberworm\CSS\Renderable;
6
-
7
- class Comment implements Renderable {
8
- protected $iLineNo;
9
- protected $sComment;
10
-
11
- public function __construct($sComment = '', $iLineNo = 0) {
12
- $this->sComment = $sComment;
13
- $this->iLineNo = $iLineNo;
14
- }
15
-
16
- /**
17
- * @return string
18
- */
19
- public function getComment() {
20
- return $this->sComment;
21
- }
22
-
23
- /**
24
- * @return int
25
- */
26
- public function getLineNo() {
27
- return $this->iLineNo;
28
- }
29
-
30
- /**
31
- * @return string
32
- */
33
- public function setComment($sComment) {
34
- $this->sComment = $sComment;
35
- }
36
-
37
- /**
38
- * @return string
39
- */
40
- public function __toString() {
41
- return $this->render(new \Sabberworm\CSS\OutputFormat());
42
- }
43
-
44
- /**
45
- * @return string
46
- */
47
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
48
- return '/*' . $this->sComment . '*/';
49
- }
50
-
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Commentable.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Comment;
4
-
5
- interface Commentable {
6
-
7
- /**
8
- * @param array $aComments Array of comments.
9
- */
10
- public function addComments(array $aComments);
11
-
12
- /**
13
- * @return array
14
- */
15
- public function getComments();
16
-
17
- /**
18
- * @param array $aComments Array containing Comment objects.
19
- */
20
- public function setComments(array $aComments);
21
-
22
-
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/OutputFormat.php DELETED
@@ -1,322 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS;
4
-
5
- use Sabberworm\CSS\Parsing\OutputException;
6
-
7
- /**
8
- * Class OutputFormat
9
- *
10
- * @method OutputFormat setSemicolonAfterLastRule( bool $bSemicolonAfterLastRule ) Set whether semicolons are added after last rule.
11
- */
12
- class OutputFormat {
13
- /**
14
- * Value format
15
- */
16
- // " means double-quote, ' means single-quote
17
- public $sStringQuotingType = '"';
18
- // Output RGB colors in hash notation if possible
19
- public $bRGBHashNotation = true;
20
-
21
- /**
22
- * Declaration format
23
- */
24
- // Semicolon after the last rule of a declaration block can be omitted. To do that, set this false.
25
- public $bSemicolonAfterLastRule = true;
26
-
27
- /**
28
- * Spacing
29
- * Note that these strings are not sanity-checked: the value should only consist of whitespace
30
- * Any newline character will be indented according to the current level.
31
- * The triples (After, Before, Between) can be set using a wildcard (e.g. `$oFormat->set('Space*Rules', "\n");`)
32
- */
33
- public $sSpaceAfterRuleName = ' ';
34
-
35
- public $sSpaceBeforeRules = '';
36
- public $sSpaceAfterRules = '';
37
- public $sSpaceBetweenRules = '';
38
-
39
- public $sSpaceBeforeBlocks = '';
40
- public $sSpaceAfterBlocks = '';
41
- public $sSpaceBetweenBlocks = "\n";
42
-
43
- // Content injected in and around @-rule blocks.
44
- public $sBeforeAtRuleBlock = '';
45
- public $sAfterAtRuleBlock = '';
46
-
47
- // This is what’s printed before and after the comma if a declaration block contains multiple selectors.
48
- public $sSpaceBeforeSelectorSeparator = '';
49
- public $sSpaceAfterSelectorSeparator = ' ';
50
- // This is what’s printed after the comma of value lists
51
- public $sSpaceBeforeListArgumentSeparator = '';
52
- public $sSpaceAfterListArgumentSeparator = '';
53
-
54
- public $sSpaceBeforeOpeningBrace = ' ';
55
-
56
- // Content injected in and around declaration blocks.
57
- public $sBeforeDeclarationBlock = '';
58
- public $sAfterDeclarationBlockSelectors = '';
59
- public $sAfterDeclarationBlock = '';
60
-
61
- /**
62
- * Indentation
63
- */
64
- // Indentation character(s) per level. Only applicable if newlines are used in any of the spacing settings.
65
- public $sIndentation = "\t";
66
-
67
- /**
68
- * Output exceptions.
69
- */
70
- public $bIgnoreExceptions = false;
71
-
72
-
73
- private $oFormatter = null;
74
- private $oNextLevelFormat = null;
75
- private $iIndentationLevel = 0;
76
-
77
- public function __construct() {
78
- }
79
-
80
- public function get($sName) {
81
- $aVarPrefixes = array('a', 's', 'm', 'b', 'f', 'o', 'c', 'i');
82
- foreach($aVarPrefixes as $sPrefix) {
83
- $sFieldName = $sPrefix.ucfirst($sName);
84
- if(isset($this->$sFieldName)) {
85
- return $this->$sFieldName;
86
- }
87
- }
88
- return null;
89
- }
90
-
91
- public function set($aNames, $mValue) {
92
- $aVarPrefixes = array('a', 's', 'm', 'b', 'f', 'o', 'c', 'i');
93
- if(is_string($aNames) && strpos($aNames, '*') !== false) {
94
- $aNames = array(str_replace('*', 'Before', $aNames), str_replace('*', 'Between', $aNames), str_replace('*', 'After', $aNames));
95
- } else if(!is_array($aNames)) {
96
- $aNames = array($aNames);
97
- }
98
- foreach($aVarPrefixes as $sPrefix) {
99
- $bDidReplace = false;
100
- foreach($aNames as $sName) {
101
- $sFieldName = $sPrefix.ucfirst($sName);
102
- if(isset($this->$sFieldName)) {
103
- $this->$sFieldName = $mValue;
104
- $bDidReplace = true;
105
- }
106
- }
107
- if($bDidReplace) {
108
- return $this;
109
- }
110
- }
111
- // Break the chain so the user knows this option is invalid
112
- return false;
113
- }
114
-
115
- public function __call($sMethodName, $aArguments) {
116
- if(strpos($sMethodName, 'set') === 0) {
117
- return $this->set(substr($sMethodName, 3), $aArguments[0]);
118
- } else if(strpos($sMethodName, 'get') === 0) {
119
- return $this->get(substr($sMethodName, 3));
120
- } else if(method_exists('\\Sabberworm\\CSS\\OutputFormatter', $sMethodName)) {
121
- return call_user_func_array(array($this->getFormatter(), $sMethodName), $aArguments);
122
- } else {
123
- throw new \Exception('Unknown OutputFormat method called: '.$sMethodName);
124
- }
125
- }
126
-
127
- public function indentWithTabs($iNumber = 1) {
128
- return $this->setIndentation(str_repeat("\t", $iNumber));
129
- }
130
-
131
- public function indentWithSpaces($iNumber = 2) {
132
- return $this->setIndentation(str_repeat(" ", $iNumber));
133
- }
134
-
135
- public function nextLevel() {
136
- if($this->oNextLevelFormat === null) {
137
- $this->oNextLevelFormat = clone $this;
138
- $this->oNextLevelFormat->iIndentationLevel++;
139
- $this->oNextLevelFormat->oFormatter = null;
140
- }
141
- return $this->oNextLevelFormat;
142
- }
143
-
144
- public function beLenient() {
145
- $this->bIgnoreExceptions = true;
146
- }
147
-
148
- public function getFormatter() {
149
- if($this->oFormatter === null) {
150
- $this->oFormatter = new OutputFormatter($this);
151
- }
152
- return $this->oFormatter;
153
- }
154
-
155
- public function level() {
156
- return $this->iIndentationLevel;
157
- }
158
-
159
- /**
160
- * Create format.
161
- *
162
- * @return OutputFormat Format.
163
- */
164
- public static function create() {
165
- return new OutputFormat();
166
- }
167
-
168
- /**
169
- * Create compact format.
170
- *
171
- * @return OutputFormat Format.
172
- */
173
- public static function createCompact() {
174
- $format = self::create();
175
- $format->set('Space*Rules', "")->set('Space*Blocks', "")->setSpaceAfterRuleName('')->setSpaceBeforeOpeningBrace('')->setSpaceAfterSelectorSeparator('');
176
- return $format;
177
- }
178
-
179
- /**
180
- * Create pretty format.
181
- *
182
- * @return OutputFormat Format.
183
- */
184
- public static function createPretty() {
185
- $format = self::create();
186
- $format->set('Space*Rules', "\n")->set('Space*Blocks', "\n")->setSpaceBetweenBlocks("\n\n")->set('SpaceAfterListArgumentSeparator', array('default' => '', ',' => ' '));
187
- return $format;
188
- }
189
- }
190
-
191
- class OutputFormatter {
192
- private $oFormat;
193
-
194
- public function __construct(OutputFormat $oFormat) {
195
- $this->oFormat = $oFormat;
196
- }
197
-
198
- public function space($sName, $sType = null) {
199
- $sSpaceString = $this->oFormat->get("Space$sName");
200
- // If $sSpaceString is an array, we have multple values configured depending on the type of object the space applies to
201
- if(is_array($sSpaceString)) {
202
- if($sType !== null && isset($sSpaceString[$sType])) {
203
- $sSpaceString = $sSpaceString[$sType];
204
- } else {
205
- $sSpaceString = reset($sSpaceString);
206
- }
207
- }
208
- return $this->prepareSpace($sSpaceString);
209
- }
210
-
211
- public function spaceAfterRuleName() {
212
- return $this->space('AfterRuleName');
213
- }
214
-
215
- public function spaceBeforeRules() {
216
- return $this->space('BeforeRules');
217
- }
218
-
219
- public function spaceAfterRules() {
220
- return $this->space('AfterRules');
221
- }
222
-
223
- public function spaceBetweenRules() {
224
- return $this->space('BetweenRules');
225
- }
226
-
227
- public function spaceBeforeBlocks() {
228
- return $this->space('BeforeBlocks');
229
- }
230
-
231
- public function spaceAfterBlocks() {
232
- return $this->space('AfterBlocks');
233
- }
234
-
235
- public function spaceBetweenBlocks() {
236
- return $this->space('BetweenBlocks');
237
- }
238
-
239
- public function spaceBeforeSelectorSeparator() {
240
- return $this->space('BeforeSelectorSeparator');
241
- }
242
-
243
- public function spaceAfterSelectorSeparator() {
244
- return $this->space('AfterSelectorSeparator');
245
- }
246
-
247
- public function spaceBeforeListArgumentSeparator($sSeparator) {
248
- return $this->space('BeforeListArgumentSeparator', $sSeparator);
249
- }
250
-
251
- public function spaceAfterListArgumentSeparator($sSeparator) {
252
- return $this->space('AfterListArgumentSeparator', $sSeparator);
253
- }
254
-
255
- public function spaceBeforeOpeningBrace() {
256
- return $this->space('BeforeOpeningBrace');
257
- }
258
-
259
- /**
260
- * Runs the given code, either swallowing or passing exceptions, depending on the bIgnoreExceptions setting.
261
- */
262
- public function safely($cCode) {
263
- if($this->oFormat->get('IgnoreExceptions')) {
264
- // If output exceptions are ignored, run the code with exception guards
265
- try {
266
- return $cCode();
267
- } catch (OutputException $e) {
268
- return null;
269
- } //Do nothing
270
- } else {
271
- // Run the code as-is
272
- return $cCode();
273
- }
274
- }
275
-
276
- /**
277
- * Clone of the implode function but calls ->render with the current output format instead of __toString()
278
- */
279
- public function implode($sSeparator, $aValues, $bIncreaseLevel = false) {
280
- $sResult = '';
281
- $oFormat = $this->oFormat;
282
- if($bIncreaseLevel) {
283
- $oFormat = $oFormat->nextLevel();
284
- }
285
- $bIsFirst = true;
286
- foreach($aValues as $mValue) {
287
- if($bIsFirst) {
288
- $bIsFirst = false;
289
- } else {
290
- $sResult .= $sSeparator;
291
- }
292
- if($mValue instanceof \Sabberworm\CSS\Renderable) {
293
- $sResult .= $mValue->render($oFormat);
294
- } else {
295
- $sResult .= $mValue;
296
- }
297
- }
298
- return $sResult;
299
- }
300
-
301
- public function removeLastSemicolon($sString) {
302
- if($this->oFormat->get('SemicolonAfterLastRule')) {
303
- return $sString;
304
- }
305
- $sString = explode(';', $sString);
306
- if(count($sString) < 2) {
307
- return $sString[0];
308
- }
309
- $sLast = array_pop($sString);
310
- $sNextToLast = array_pop($sString);
311
- array_push($sString, $sNextToLast.$sLast);
312
- return implode(';', $sString);
313
- }
314
-
315
- private function prepareSpace($sSpaceString) {
316
- return str_replace("\n", "\n".$this->indent(), $sSpaceString);
317
- }
318
-
319
- private function indent() {
320
- return str_repeat($this->oFormat->sIndentation, $this->oFormat->level());
321
- }
322
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parser.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS;
4
-
5
- use Sabberworm\CSS\CSSList\Document;
6
- use Sabberworm\CSS\Parsing\ParserState;
7
-
8
- /**
9
- * Parser class parses CSS from text into a data structure.
10
- */
11
- class Parser {
12
- private $oParserState;
13
-
14
- /**
15
- * Parser constructor.
16
- * Note that that iLineNo starts from 1 and not 0
17
- *
18
- * @param $sText
19
- * @param Settings|null $oParserSettings
20
- * @param int $iLineNo
21
- */
22
- public function __construct($sText, Settings $oParserSettings = null, $iLineNo = 1) {
23
- if ($oParserSettings === null) {
24
- $oParserSettings = Settings::create();
25
- }
26
- $this->oParserState = new ParserState($sText, $oParserSettings, $iLineNo);
27
- }
28
-
29
- public function setCharset($sCharset) {
30
- $this->oParserState->setCharset($sCharset);
31
- }
32
-
33
- public function getCharset() {
34
- $this->oParserState->getCharset();
35
- }
36
-
37
- public function parse() {
38
- return Document::parse($this->oParserState);
39
- }
40
-
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/OutputException.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Parsing;
4
-
5
- /**
6
- * Thrown if the CSS parsers attempts to print something invalid
7
- */
8
- class OutputException extends SourceException {
9
- public function __construct($sMessage, $iLineNo = 0) {
10
- parent::__construct($sMessage, $iLineNo);
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/ParserState.php DELETED
@@ -1,310 +0,0 @@
1
- <?php
2
- namespace Sabberworm\CSS\Parsing;
3
-
4
- use Sabberworm\CSS\Comment\Comment;
5
- use Sabberworm\CSS\Parsing\UnexpectedTokenException;
6
- use Sabberworm\CSS\Settings;
7
-
8
- class ParserState {
9
- private $oParserSettings;
10
-
11
- private $sText;
12
-
13
- private $aText;
14
- private $iCurrentPosition;
15
- private $sCharset;
16
- private $iLength;
17
- private $iLineNo;
18
-
19
- public function __construct($sText, Settings $oParserSettings, $iLineNo = 1) {
20
- $this->oParserSettings = $oParserSettings;
21
- $this->sText = $sText;
22
- $this->iCurrentPosition = 0;
23
- $this->iLineNo = $iLineNo;
24
- $this->setCharset($this->oParserSettings->sDefaultCharset);
25
- }
26
-
27
- public function setCharset($sCharset) {
28
- $this->sCharset = $sCharset;
29
- $this->aText = $this->strsplit($this->sText);
30
- $this->iLength = count($this->aText);
31
- }
32
-
33
- public function getCharset() {
34
- $this->oParserHelper->getCharset();
35
- return $this->sCharset;
36
- }
37
-
38
- public function currentLine() {
39
- return $this->iLineNo;
40
- }
41
-
42
- public function getSettings() {
43
- return $this->oParserSettings;
44
- }
45
-
46
- public function parseIdentifier($bIgnoreCase = true) {
47
- $sResult = $this->parseCharacter(true);
48
- if ($sResult === null) {
49
- throw new UnexpectedTokenException($sResult, $this->peek(5), 'identifier', $this->iLineNo);
50
- }
51
- $sCharacter = null;
52
- while (($sCharacter = $this->parseCharacter(true)) !== null) {
53
- $sResult .= $sCharacter;
54
- }
55
- if ($bIgnoreCase) {
56
- $sResult = $this->strtolower($sResult);
57
- }
58
- return $sResult;
59
- }
60
-
61
- public function parseCharacter($bIsForIdentifier) {
62
- if ($this->peek() === '\\') {
63
- if ($bIsForIdentifier && $this->oParserSettings->bLenientParsing && ($this->comes('\0') || $this->comes('\9'))) {
64
- // Non-strings can contain \0 or \9 which is an IE hack supported in lenient parsing.
65
- return null;
66
- }
67
- $this->consume('\\');
68
- if ($this->comes('\n') || $this->comes('\r')) {
69
- return '';
70
- }
71
- if (preg_match('/[0-9a-fA-F]/Su', $this->peek()) === 0) {
72
- return $this->consume(1);
73
- }
74
- $sUnicode = $this->consumeExpression('/^[0-9a-fA-F]{1,6}/u', 6);
75
- if ($this->strlen($sUnicode) < 6) {
76
- //Consume whitespace after incomplete unicode escape
77
- if (preg_match('/\\s/isSu', $this->peek())) {
78
- if ($this->comes('\r\n')) {
79
- $this->consume(2);
80
- } else {
81
- $this->consume(1);
82
- }
83
- }
84
- }
85
- $iUnicode = intval($sUnicode, 16);
86
- $sUtf32 = "";
87
- for ($i = 0; $i < 4; ++$i) {
88
- $sUtf32 .= chr($iUnicode & 0xff);
89
- $iUnicode = $iUnicode >> 8;
90
- }
91
- return iconv('utf-32le', $this->sCharset, $sUtf32);
92
- }
93
- if ($bIsForIdentifier) {
94
- $peek = ord($this->peek());
95
- // Ranges: a-z A-Z 0-9 - _
96
- if (($peek >= 97 && $peek <= 122) ||
97
- ($peek >= 65 && $peek <= 90) ||
98
- ($peek >= 48 && $peek <= 57) ||
99
- ($peek === 45) ||
100
- ($peek === 95) ||
101
- ($peek > 0xa1)) {
102
- return $this->consume(1);
103
- }
104
- } else {
105
- return $this->consume(1);
106
- }
107
- return null;
108
- }
109
-
110
- public function consumeWhiteSpace() {
111
- $comments = array();
112
- do {
113
- while (preg_match('/\\s/isSu', $this->peek()) === 1) {
114
- $this->consume(1);
115
- }
116
- if($this->oParserSettings->bLenientParsing) {
117
- try {
118
- $oComment = $this->consumeComment();
119
- } catch(UnexpectedTokenException $e) {
120
- // When we can’t find the end of a comment, we assume the document is finished.
121
- $this->iCurrentPosition = $this->iLength;
122
- return;
123
- }
124
- } else {
125
- $oComment = $this->consumeComment();
126
- }
127
- if ($oComment !== false) {
128
- $comments[] = $oComment;
129
- }
130
- } while($oComment !== false);
131
- return $comments;
132
- }
133
-
134
- public function comes($sString, $bCaseInsensitive = false) {
135
- $sPeek = $this->peek(strlen($sString));
136
- return ($sPeek == '')
137
- ? false
138
- : $this->streql($sPeek, $sString, $bCaseInsensitive);
139
- }
140
-
141
- public function peek($iLength = 1, $iOffset = 0) {
142
- $iOffset += $this->iCurrentPosition;
143
- if ($iOffset >= $this->iLength) {
144
- return '';
145
- }
146
- return $this->substr($iOffset, $iLength);
147
- }
148
-
149
- public function consume($mValue = 1) {
150
- if (is_string($mValue)) {
151
- $iLineCount = substr_count($mValue, "\n");
152
- $iLength = $this->strlen($mValue);
153
- if (!$this->streql($this->substr($this->iCurrentPosition, $iLength), $mValue)) {
154
- throw new UnexpectedTokenException($mValue, $this->peek(max($iLength, 5)), $this->iLineNo);
155
- }
156
- $this->iLineNo += $iLineCount;
157
- $this->iCurrentPosition += $this->strlen($mValue);
158
- return $mValue;
159
- } else {
160
- if ($this->iCurrentPosition + $mValue > $this->iLength) {
161
- throw new UnexpectedTokenException($mValue, $this->peek(5), 'count', $this->iLineNo);
162
- }
163
- $sResult = $this->substr($this->iCurrentPosition, $mValue);
164
- $iLineCount = substr_count($sResult, "\n");
165
- $this->iLineNo += $iLineCount;
166
- $this->iCurrentPosition += $mValue;
167
- return $sResult;
168
- }
169
- }
170
-
171
- public function consumeExpression($mExpression, $iMaxLength = null) {
172
- $aMatches = null;
173
- $sInput = $iMaxLength !== null ? $this->peek($iMaxLength) : $this->inputLeft();
174
- if (preg_match($mExpression, $sInput, $aMatches, PREG_OFFSET_CAPTURE) === 1) {
175
- return $this->consume($aMatches[0][0]);
176
- }
177
- throw new UnexpectedTokenException($mExpression, $this->peek(5), 'expression', $this->iLineNo);
178
- }
179
-
180
- /**
181
- * @return false|Comment
182
- */
183
- public function consumeComment() {
184
- $mComment = false;
185
- if ($this->comes('/*')) {
186
- $iLineNo = $this->iLineNo;
187
- $this->consume(1);
188
- $mComment = '';
189
- while (($char = $this->consume(1)) !== '') {
190
- $mComment .= $char;
191
- if ($this->comes('*/')) {
192
- $this->consume(2);
193
- break;
194
- }
195
- }
196
- }
197
-
198
- if ($mComment !== false) {
199
- // We skip the * which was included in the comment.
200
- return new Comment(substr($mComment, 1), $iLineNo);
201
- }
202
-
203
- return $mComment;
204
- }
205
-
206
- public function isEnd() {
207
- return $this->iCurrentPosition >= $this->iLength;
208
- }
209
-
210
- public function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false, array &$comments = array()) {
211
- $aEnd = is_array($aEnd) ? $aEnd : array($aEnd);
212
- $out = '';
213
- $start = $this->iCurrentPosition;
214
-
215
- while (($char = $this->consume(1)) !== '') {
216
- if (in_array($char, $aEnd)) {
217
- if ($bIncludeEnd) {
218
- $out .= $char;
219
- } elseif (!$consumeEnd) {
220
- $this->iCurrentPosition -= $this->strlen($char);
221
- }
222
- return $out;
223
- }
224
- $out .= $char;
225
- if ($comment = $this->consumeComment()) {
226
- $comments[] = $comment;
227
- }
228
- }
229
-
230
- $this->iCurrentPosition = $start;
231
- throw new UnexpectedTokenException('One of ("'.implode('","', $aEnd).'")', $this->peek(5), 'search', $this->iLineNo);
232
- }
233
-
234
- private function inputLeft() {
235
- return $this->substr($this->iCurrentPosition, -1);
236
- }
237
-
238
- public function streql($sString1, $sString2, $bCaseInsensitive = true) {
239
- if($bCaseInsensitive) {
240
- return $this->strtolower($sString1) === $this->strtolower($sString2);
241
- } else {
242
- return $sString1 === $sString2;
243
- }
244
- }
245
-
246
- public function backtrack($iAmount) {
247
- $this->iCurrentPosition -= $iAmount;
248
- }
249
-
250
- public function strlen($sString) {
251
- if ($this->oParserSettings->bMultibyteSupport) {
252
- return mb_strlen($sString, $this->sCharset);
253
- } else {
254
- return strlen($sString);
255
- }
256
- }
257
-
258
- private function substr($iStart, $iLength) {
259
- if ($iLength < 0) {
260
- $iLength = $this->iLength - $iStart + $iLength;
261
- }
262
- if ($iStart + $iLength > $this->iLength) {
263
- $iLength = $this->iLength - $iStart;
264
- }
265
- $sResult = '';
266
- while ($iLength > 0) {
267
- $sResult .= $this->aText[$iStart];
268
- $iStart++;
269
- $iLength--;
270
- }
271
- return $sResult;
272
- }
273
-
274
- private function strtolower($sString) {
275
- if ($this->oParserSettings->bMultibyteSupport) {
276
- return mb_strtolower($sString, $this->sCharset);
277
- } else {
278
- return strtolower($sString);
279
- }
280
- }
281
-
282
- private function strsplit($sString) {
283
- if ($this->oParserSettings->bMultibyteSupport) {
284
- if ($this->streql($this->sCharset, 'utf-8')) {
285
- return preg_split('//u', $sString, null, PREG_SPLIT_NO_EMPTY);
286
- } else {
287
- $iLength = mb_strlen($sString, $this->sCharset);
288
- $aResult = array();
289
- for ($i = 0; $i < $iLength; ++$i) {
290
- $aResult[] = mb_substr($sString, $i, 1, $this->sCharset);
291
- }
292
- return $aResult;
293
- }
294
- } else {
295
- if($sString === '') {
296
- return array();
297
- } else {
298
- return str_split($sString);
299
- }
300
- }
301
- }
302
-
303
- private function strpos($sString, $sNeedle, $iOffset) {
304
- if ($this->oParserSettings->bMultibyteSupport) {
305
- return mb_strpos($sString, $sNeedle, $iOffset, $this->sCharset);
306
- } else {
307
- return strpos($sString, $sNeedle, $iOffset);
308
- }
309
- }
310
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/SourceException.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Parsing;
4
-
5
- class SourceException extends \Exception {
6
- private $iLineNo;
7
- public function __construct($sMessage, $iLineNo = 0) {
8
- $this->iLineNo = $iLineNo;
9
- if (!empty($iLineNo)) {
10
- $sMessage .= " [line no: $iLineNo]";
11
- }
12
- parent::__construct($sMessage);
13
- }
14
-
15
- public function getLineNo() {
16
- return $this->iLineNo;
17
- }
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/UnexpectedTokenException.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Parsing;
4
-
5
- /**
6
- * Thrown if the CSS parsers encounters a token it did not expect
7
- */
8
- class UnexpectedTokenException extends SourceException {
9
- private $sExpected;
10
- private $sFound;
11
- // Possible values: literal, identifier, count, expression, search
12
- private $sMatchType;
13
-
14
- public function __construct($sExpected, $sFound, $sMatchType = 'literal', $iLineNo = 0) {
15
- $this->sExpected = $sExpected;
16
- $this->sFound = $sFound;
17
- $this->sMatchType = $sMatchType;
18
- $sMessage = "Token “{$sExpected}” ({$sMatchType}) not found. Got “{$sFound}”.";
19
- if($this->sMatchType === 'search') {
20
- $sMessage = "Search for “{$sExpected}” returned no results. Context: “{$sFound}”.";
21
- } else if($this->sMatchType === 'count') {
22
- $sMessage = "Next token was expected to have {$sExpected} chars. Context: “{$sFound}”.";
23
- } else if($this->sMatchType === 'identifier') {
24
- $sMessage = "Identifier expected. Got “{$sFound}”";
25
- } else if($this->sMatchType === 'custom') {
26
- $sMessage = trim("$sExpected $sFound");
27
- }
28
-
29
- parent::__construct($sMessage, $iLineNo);
30
- }
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/AtRule.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Property;
4
-
5
- use Sabberworm\CSS\Renderable;
6
- use Sabberworm\CSS\Comment\Commentable;
7
-
8
- interface AtRule extends Renderable, Commentable {
9
- // Since there are more set rules than block rules, we’re whitelisting the block rules and have anything else be treated as a set rule.
10
- const BLOCK_RULES = 'media/document/supports/region-style/font-feature-values';
11
- // …and more font-specific ones (to be used inside font-feature-values)
12
- const SET_RULES = 'font-face/counter-style/page/swash/styleset/annotation';
13
-
14
- public function atRuleName();
15
- public function atRuleArgs();
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/CSSNamespace.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Property;
4
-
5
- /**
6
- * CSSNamespace represents an @namespace rule.
7
- */
8
- class CSSNamespace implements AtRule {
9
- private $mUrl;
10
- private $sPrefix;
11
- private $iLineNo;
12
- protected $aComments;
13
-
14
- public function __construct($mUrl, $sPrefix = null, $iLineNo = 0) {
15
- $this->mUrl = $mUrl;
16
- $this->sPrefix = $sPrefix;
17
- $this->iLineNo = $iLineNo;
18
- $this->aComments = array();
19
- }
20
-
21
- /**
22
- * @return int
23
- */
24
- public function getLineNo() {
25
- return $this->iLineNo;
26
- }
27
-
28
- public function __toString() {
29
- return $this->render(new \Sabberworm\CSS\OutputFormat());
30
- }
31
-
32
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
33
- return '@namespace '.($this->sPrefix === null ? '' : $this->sPrefix.' ').$this->mUrl->render($oOutputFormat).';';
34
- }
35
-
36
- public function getUrl() {
37
- return $this->mUrl;
38
- }
39
-
40
- public function getPrefix() {
41
- return $this->sPrefix;
42
- }
43
-
44
- public function setUrl($mUrl) {
45
- $this->mUrl = $mUrl;
46
- }
47
-
48
- public function setPrefix($sPrefix) {
49
- $this->sPrefix = $sPrefix;
50
- }
51
-
52
- public function atRuleName() {
53
- return 'namespace';
54
- }
55
-
56
- public function atRuleArgs() {
57
- $aResult = array($this->mUrl);
58
- if($this->sPrefix) {
59
- array_unshift($aResult, $this->sPrefix);
60
- }
61
- return $aResult;
62
- }
63
-
64
- public function addComments(array $aComments) {
65
- $this->aComments = array_merge($this->aComments, $aComments);
66
- }
67
-
68
- public function getComments() {
69
- return $this->aComments;
70
- }
71
-
72
- public function setComments(array $aComments) {
73
- $this->aComments = $aComments;
74
- }
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Charset.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Property;
4
-
5
- /**
6
- * Class representing an @charset rule.
7
- * The following restrictions apply:
8
- * • May not be found in any CSSList other than the Document.
9
- * • May only appear at the very top of a Document’s contents.
10
- * • Must not appear more than once.
11
- */
12
- class Charset implements AtRule {
13
-
14
- private $sCharset;
15
- protected $iLineNo;
16
- protected $aComment;
17
-
18
- public function __construct($sCharset, $iLineNo = 0) {
19
- $this->sCharset = $sCharset;
20
- $this->iLineNo = $iLineNo;
21
- $this->aComments = array();
22
- }
23
-
24
- /**
25
- * @return int
26
- */
27
- public function getLineNo() {
28
- return $this->iLineNo;
29
- }
30
-
31
- public function setCharset($sCharset) {
32
- $this->sCharset = $sCharset;
33
- }
34
-
35
- public function getCharset() {
36
- return $this->sCharset;
37
- }
38
-
39
- public function __toString() {
40
- return $this->render(new \Sabberworm\CSS\OutputFormat());
41
- }
42
-
43
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
44
- return "@charset {$this->sCharset->render($oOutputFormat)};";
45
- }
46
-
47
- public function atRuleName() {
48
- return 'charset';
49
- }
50
-
51
- public function atRuleArgs() {
52
- return $this->sCharset;
53
- }
54
-
55
- public function addComments(array $aComments) {
56
- $this->aComments = array_merge($this->aComments, $aComments);
57
- }
58
-
59
- public function getComments() {
60
- return $this->aComments;
61
- }
62
-
63
- public function setComments(array $aComments) {
64
- $this->aComments = $aComments;
65
- }
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Import.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Property;
4
-
5
- use Sabberworm\CSS\Value\URL;
6
-
7
- /**
8
- * Class representing an @import rule.
9
- */
10
- class Import implements AtRule {
11
- private $oLocation;
12
- private $sMediaQuery;
13
- protected $iLineNo;
14
- protected $aComments;
15
-
16
- public function __construct(URL $oLocation, $sMediaQuery, $iLineNo = 0) {
17
- $this->oLocation = $oLocation;
18
- $this->sMediaQuery = $sMediaQuery;
19
- $this->iLineNo = $iLineNo;
20
- $this->aComments = array();
21
- }
22
-
23
- /**
24
- * @return int
25
- */
26
- public function getLineNo() {
27
- return $this->iLineNo;
28
- }
29
-
30
- public function setLocation($oLocation) {
31
- $this->oLocation = $oLocation;
32
- }
33
-
34
- public function getLocation() {
35
- return $this->oLocation;
36
- }
37
-
38
- public function __toString() {
39
- return $this->render(new \Sabberworm\CSS\OutputFormat());
40
- }
41
-
42
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
43
- return "@import ".$this->oLocation->render($oOutputFormat).($this->sMediaQuery === null ? '' : ' '.$this->sMediaQuery).';';
44
- }
45
-
46
- public function atRuleName() {
47
- return 'import';
48
- }
49
-
50
- public function atRuleArgs() {
51
- $aResult = array($this->oLocation);
52
- if($this->sMediaQuery) {
53
- array_push($aResult, $this->sMediaQuery);
54
- }
55
- return $aResult;
56
- }
57
-
58
- public function addComments(array $aComments) {
59
- $this->aComments = array_merge($this->aComments, $aComments);
60
- }
61
-
62
- public function getComments() {
63
- return $this->aComments;
64
- }
65
-
66
- public function setComments(array $aComments) {
67
- $this->aComments = $aComments;
68
- }
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Selector.php DELETED
@@ -1,74 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Property;
4
-
5
- /**
6
- * Class representing a single CSS selector. Selectors have to be split by the comma prior to being passed into this class.
7
- */
8
- class Selector {
9
-
10
- //Regexes for specificity calculations
11
- const NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX = '/
12
- (\.[\w]+) # classes
13
- |
14
- \[(\w+) # attributes
15
- |
16
- (\:( # pseudo classes
17
- link|visited|active
18
- |hover|focus
19
- |lang
20
- |target
21
- |enabled|disabled|checked|indeterminate
22
- |root
23
- |nth-child|nth-last-child|nth-of-type|nth-last-of-type
24
- |first-child|last-child|first-of-type|last-of-type
25
- |only-child|only-of-type
26
- |empty|contains
27
- ))
28
- /ix';
29
-
30
- const ELEMENTS_AND_PSEUDO_ELEMENTS_RX = '/
31
- ((^|[\s\+\>\~]+)[\w]+ # elements
32
- |
33
- \:{1,2}( # pseudo-elements
34
- after|before|first-letter|first-line|selection
35
- ))
36
- /ix';
37
-
38
- private $sSelector;
39
- private $iSpecificity;
40
-
41
- public function __construct($sSelector, $bCalculateSpecificity = false) {
42
- $this->setSelector($sSelector);
43
- if ($bCalculateSpecificity) {
44
- $this->getSpecificity();
45
- }
46
- }
47
-
48
- public function getSelector() {
49
- return $this->sSelector;
50
- }
51
-
52
- public function setSelector($sSelector) {
53
- $this->sSelector = trim($sSelector);
54
- $this->iSpecificity = null;
55
- }
56
-
57
- public function __toString() {
58
- return $this->getSelector();
59
- }
60
-
61
- public function getSpecificity() {
62
- if ($this->iSpecificity === null) {
63
- $a = 0;
64
- /// @todo should exclude \# as well as "#"
65
- $aMatches = null;
66
- $b = substr_count($this->sSelector, '#');
67
- $c = preg_match_all(self::NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX, $this->sSelector, $aMatches);
68
- $d = preg_match_all(self::ELEMENTS_AND_PSEUDO_ELEMENTS_RX, $this->sSelector, $aMatches);
69
- $this->iSpecificity = ($a * 1000) + ($b * 100) + ($c * 10) + $d;
70
- }
71
- return $this->iSpecificity;
72
- }
73
-
74
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Renderable.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS;
4
-
5
- interface Renderable {
6
- public function __toString();
7
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat);
8
- public function getLineNo();
9
- }
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Rule/Rule.php DELETED
@@ -1,236 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Rule;
4
-
5
- use Sabberworm\CSS\Comment\Commentable;
6
- use Sabberworm\CSS\Parsing\ParserState;
7
- use Sabberworm\CSS\Renderable;
8
- use Sabberworm\CSS\Value\RuleValueList;
9
- use Sabberworm\CSS\Value\Value;
10
-
11
- /**
12
- * RuleSets contains Rule objects which always have a key and a value.
13
- * In CSS, Rules are expressed as follows: “key: value[0][0] value[0][1], value[1][0] value[1][1];”
14
- */
15
- class Rule implements Renderable, Commentable {
16
-
17
- private $sRule;
18
- private $mValue;
19
- private $bIsImportant;
20
- private $aIeHack;
21
- protected $iLineNo;
22
- protected $aComments;
23
-
24
- public function __construct($sRule, $iLineNo = 0) {
25
- $this->sRule = $sRule;
26
- $this->mValue = null;
27
- $this->bIsImportant = false;
28
- $this->aIeHack = array();
29
- $this->iLineNo = $iLineNo;
30
- $this->aComments = array();
31
- }
32
-
33
- public static function parse(ParserState $oParserState) {
34
- $aComments = $oParserState->consumeWhiteSpace();
35
- $oRule = new Rule($oParserState->parseIdentifier(), $oParserState->currentLine());
36
- $oRule->setComments($aComments);
37
- $oRule->addComments($oParserState->consumeWhiteSpace());
38
- $oParserState->consume(':');
39
- $oValue = Value::parseValue($oParserState, self::listDelimiterForRule($oRule->getRule()));
40
- $oRule->setValue($oValue);
41
- if ($oParserState->getSettings()->bLenientParsing) {
42
- while ($oParserState->comes('\\')) {
43
- $oParserState->consume('\\');
44
- $oRule->addIeHack($oParserState->consume());
45
- $oParserState->consumeWhiteSpace();
46
- }
47
- }
48
- $oParserState->consumeWhiteSpace();
49
- if ($oParserState->comes('!')) {
50
- $oParserState->consume('!');
51
- $oParserState->consumeWhiteSpace();
52
- $oParserState->consume('important');
53
- $oRule->setIsImportant(true);
54
- }
55
- $oParserState->consumeWhiteSpace();
56
- while ($oParserState->comes(';')) {
57
- $oParserState->consume(';');
58
- }
59
- $oParserState->consumeWhiteSpace();
60
-
61
- return $oRule;
62
- }
63
-
64
- private static function listDelimiterForRule($sRule) {
65
- if (preg_match('/^font($|-)/', $sRule)) {
66
- return array(',', '/', ' ');
67
- }
68
- return array(',', ' ', '/');
69
- }
70
-
71
- /**
72
- * @return int
73
- */
74
- public function getLineNo() {
75
- return $this->iLineNo;
76
- }
77
-
78
- public function setRule($sRule) {
79
- $this->sRule = $sRule;
80
- }
81
-
82
- public function getRule() {
83
- return $this->sRule;
84
- }
85
-
86
- public function getValue() {
87
- return $this->mValue;
88
- }
89
-
90
- public function setValue($mValue) {
91
- $this->mValue = $mValue;
92
- }
93
-
94
- /**
95
- * @deprecated Old-Style 2-dimensional array given. Retained for (some) backwards-compatibility. Use setValue() instead and wrapp the value inside a RuleValueList if necessary.
96
- */
97
- public function setValues($aSpaceSeparatedValues) {
98
- $oSpaceSeparatedList = null;
99
- if (count($aSpaceSeparatedValues) > 1) {
100
- $oSpaceSeparatedList = new RuleValueList(' ', $this->iLineNo);
101
- }
102
- foreach ($aSpaceSeparatedValues as $aCommaSeparatedValues) {
103
- $oCommaSeparatedList = null;
104
- if (count($aCommaSeparatedValues) > 1) {
105
- $oCommaSeparatedList = new RuleValueList(',', $this->iLineNo);
106
- }
107
- foreach ($aCommaSeparatedValues as $mValue) {
108
- if (!$oSpaceSeparatedList && !$oCommaSeparatedList) {
109
- $this->mValue = $mValue;
110
- return $mValue;
111
- }
112
- if ($oCommaSeparatedList) {
113
- $oCommaSeparatedList->addListComponent($mValue);
114
- } else {
115
- $oSpaceSeparatedList->addListComponent($mValue);
116
- }
117
- }
118
- if (!$oSpaceSeparatedList) {
119
- $this->mValue = $oCommaSeparatedList;
120
- return $oCommaSeparatedList;
121
- } else {
122
- $oSpaceSeparatedList->addListComponent($oCommaSeparatedList);
123
- }
124
- }
125
- $this->mValue = $oSpaceSeparatedList;
126
- return $oSpaceSeparatedList;
127
- }
128
-
129
- /**
130
- * @deprecated Old-Style 2-dimensional array returned. Retained for (some) backwards-compatibility. Use getValue() instead and check for the existance of a (nested set of) ValueList object(s).
131
- */
132
- public function getValues() {
133
- if (!$this->mValue instanceof RuleValueList) {
134
- return array(array($this->mValue));
135
- }
136
- if ($this->mValue->getListSeparator() === ',') {
137
- return array($this->mValue->getListComponents());
138
- }
139
- $aResult = array();
140
- foreach ($this->mValue->getListComponents() as $mValue) {
141
- if (!$mValue instanceof RuleValueList || $mValue->getListSeparator() !== ',') {
142
- $aResult[] = array($mValue);
143
- continue;
144
- }
145
- if ($this->mValue->getListSeparator() === ' ' || count($aResult) === 0) {
146
- $aResult[] = array();
147
- }
148
- foreach ($mValue->getListComponents() as $mValue) {
149
- $aResult[count($aResult) - 1][] = $mValue;
150
- }
151
- }
152
- return $aResult;
153
- }
154
-
155
- /**
156
- * Adds a value to the existing value. Value will be appended if a RuleValueList exists of the given type. Otherwise, the existing value will be wrapped by one.
157
- */
158
- public function addValue($mValue, $sType = ' ') {
159
- if (!is_array($mValue)) {
160
- $mValue = array($mValue);
161
- }
162
- if (!$this->mValue instanceof RuleValueList || $this->mValue->getListSeparator() !== $sType) {
163
- $mCurrentValue = $this->mValue;
164
- $this->mValue = new RuleValueList($sType, $this->iLineNo);
165
- if ($mCurrentValue) {
166
- $this->mValue->addListComponent($mCurrentValue);
167
- }
168
- }
169
- foreach ($mValue as $mValueItem) {
170
- $this->mValue->addListComponent($mValueItem);
171
- }
172
- }
173
-
174
- public function addIeHack($iModifier) {
175
- $this->aIeHack[] = $iModifier;
176
- }
177
-
178
- public function setIeHack(array $aModifiers) {
179
- $this->aIeHack = $aModifiers;
180
- }
181
-
182
- public function getIeHack() {
183
- return $this->aIeHack;
184
- }
185
-
186
- public function setIsImportant($bIsImportant) {
187
- $this->bIsImportant = $bIsImportant;
188
- }
189
-
190
- public function getIsImportant() {
191
- return $this->bIsImportant;
192
- }
193
-
194
- public function __toString() {
195
- return $this->render(new \Sabberworm\CSS\OutputFormat());
196
- }
197
-
198
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
199
- $sResult = "{$this->sRule}:{$oOutputFormat->spaceAfterRuleName()}";
200
- if ($this->mValue instanceof Value) { //Can also be a ValueList
201
- $sResult .= $this->mValue->render($oOutputFormat);
202
- } else {
203
- $sResult .= $this->mValue;
204
- }
205
- if (!empty($this->aIeHack)) {
206
- $sResult .= ' \\' . implode('\\', $this->aIeHack);
207
- }
208
- if ($this->bIsImportant) {
209
- $sResult .= ' !important';
210
- }
211
- $sResult .= ';';
212
- return $sResult;
213
- }
214
-
215
- /**
216
- * @param array $aComments Array of comments.
217
- */
218
- public function addComments(array $aComments) {
219
- $this->aComments = array_merge($this->aComments, $aComments);
220
- }
221
-
222
- /**
223
- * @return array
224
- */
225
- public function getComments() {
226
- return $this->aComments;
227
- }
228
-
229
- /**
230
- * @param array $aComments Array containing Comment objects.
231
- */
232
- public function setComments(array $aComments) {
233
- $this->aComments = $aComments;
234
- }
235
-
236
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/AtRuleSet.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\RuleSet;
4
-
5
- use Sabberworm\CSS\Property\AtRule;
6
-
7
- /**
8
- * A RuleSet constructed by an unknown @-rule. @font-face rules are rendered into AtRuleSet objects.
9
- */
10
- class AtRuleSet extends RuleSet implements AtRule {
11
-
12
- private $sType;
13
- private $sArgs;
14
-
15
- public function __construct($sType, $sArgs = '', $iLineNo = 0) {
16
- parent::__construct($iLineNo);
17
- $this->sType = $sType;
18
- $this->sArgs = $sArgs;
19
- }
20
-
21
- public function atRuleName() {
22
- return $this->sType;
23
- }
24
-
25
- public function atRuleArgs() {
26
- return $this->sArgs;
27
- }
28
-
29
- public function __toString() {
30
- return $this->render(new \Sabberworm\CSS\OutputFormat());
31
- }
32
-
33
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
34
- $sArgs = $this->sArgs;
35
- if($sArgs) {
36
- $sArgs = ' ' . $sArgs;
37
- }
38
- $sResult = "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
39
- $sResult .= parent::render($oOutputFormat);
40
- $sResult .= '}';
41
- return $sResult;
42
- }
43
-
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php DELETED
@@ -1,628 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\RuleSet;
4
-
5
- use Sabberworm\CSS\Parsing\ParserState;
6
- use Sabberworm\CSS\Parsing\OutputException;
7
- use Sabberworm\CSS\Property\Selector;
8
- use Sabberworm\CSS\Rule\Rule;
9
- use Sabberworm\CSS\Value\RuleValueList;
10
- use Sabberworm\CSS\Value\Value;
11
- use Sabberworm\CSS\Value\Size;
12
- use Sabberworm\CSS\Value\Color;
13
- use Sabberworm\CSS\Value\URL;
14
-
15
- /**
16
- * Declaration blocks are the parts of a css file which denote the rules belonging to a selector.
17
- * Declaration blocks usually appear directly inside a Document or another CSSList (mostly a MediaQuery).
18
- */
19
- class DeclarationBlock extends RuleSet {
20
-
21
- private $aSelectors;
22
-
23
- public function __construct($iLineNo = 0) {
24
- parent::__construct($iLineNo);
25
- $this->aSelectors = array();
26
- }
27
-
28
- public static function parse(ParserState $oParserState) {
29
- $aComments = array();
30
- $oResult = new DeclarationBlock($oParserState->currentLine());
31
- $oResult->setSelector($oParserState->consumeUntil('{', false, true, $aComments));
32
- $oResult->setComments($aComments);
33
- RuleSet::parseRuleSet($oParserState, $oResult);
34
- return $oResult;
35
- }
36
-
37
-
38
- public function setSelectors($mSelector) {
39
- if (is_array($mSelector)) {
40
- $this->aSelectors = $mSelector;
41
- } else {
42
- $this->aSelectors = explode(',', $mSelector);
43
- }
44
- foreach ($this->aSelectors as $iKey => $mSelector) {
45
- if (!($mSelector instanceof Selector)) {
46
- $this->aSelectors[$iKey] = new Selector($mSelector);
47
- }
48
- }
49
- }
50
-
51
- // remove one of the selector of the block
52
- public function removeSelector($mSelector) {
53
- if($mSelector instanceof Selector) {
54
- $mSelector = $mSelector->getSelector();
55
- }
56
- foreach($this->aSelectors as $iKey => $oSelector) {
57
- if($oSelector->getSelector() === $mSelector) {
58
- unset($this->aSelectors[$iKey]);
59
- return true;
60
- }
61
- }
62
- return false;
63
- }
64
-
65
- /**
66
- * @deprecated use getSelectors()
67
- */
68
- public function getSelector() {
69
- return $this->getSelectors();
70
- }
71
-
72
- /**
73
- * @deprecated use setSelectors()
74
- */
75
- public function setSelector($mSelector) {
76
- $this->setSelectors($mSelector);
77
- }
78
-
79
- /**
80
- * Get selectors.
81
- *
82
- * @return Selector[] Selectors.
83
- */
84
- public function getSelectors() {
85
- return $this->aSelectors;
86
- }
87
-
88
- /**
89
- * Split shorthand declarations (e.g. +margin+ or +font+) into their constituent parts.
90
- * */
91
- public function expandShorthands() {
92
- // border must be expanded before dimensions
93
- $this->expandBorderShorthand();
94
- $this->expandDimensionsShorthand();
95
- $this->expandFontShorthand();
96
- $this->expandBackgroundShorthand();
97
- $this->expandListStyleShorthand();
98
- }
99
-
100
- /**
101
- * Create shorthand declarations (e.g. +margin+ or +font+) whenever possible.
102
- * */
103
- public function createShorthands() {
104
- $this->createBackgroundShorthand();
105
- $this->createDimensionsShorthand();
106
- // border must be shortened after dimensions
107
- $this->createBorderShorthand();
108
- $this->createFontShorthand();
109
- $this->createListStyleShorthand();
110
- }
111
-
112
- /**
113
- * Split shorthand border declarations (e.g. <tt>border: 1px red;</tt>)
114
- * Additional splitting happens in expandDimensionsShorthand
115
- * Multiple borders are not yet supported as of 3
116
- * */
117
- public function expandBorderShorthand() {
118
- $aBorderRules = array(
119
- 'border', 'border-left', 'border-right', 'border-top', 'border-bottom'
120
- );
121
- $aBorderSizes = array(
122
- 'thin', 'medium', 'thick'
123
- );
124
- $aRules = $this->getRulesAssoc();
125
- foreach ($aBorderRules as $sBorderRule) {
126
- if (!isset($aRules[$sBorderRule]))
127
- continue;
128
- $oRule = $aRules[$sBorderRule];
129
- $mRuleValue = $oRule->getValue();
130
- $aValues = array();
131
- if (!$mRuleValue instanceof RuleValueList) {
132
- $aValues[] = $mRuleValue;
133
- } else {
134
- $aValues = $mRuleValue->getListComponents();
135
- }
136
- foreach ($aValues as $mValue) {
137
- if ($mValue instanceof Value) {
138
- $mNewValue = clone $mValue;
139
- } else {
140
- $mNewValue = $mValue;
141
- }
142
- if ($mValue instanceof Size) {
143
- $sNewRuleName = $sBorderRule . "-width";
144
- } else if ($mValue instanceof Color) {
145
- $sNewRuleName = $sBorderRule . "-color";
146
- } else {
147
- if (in_array($mValue, $aBorderSizes)) {
148
- $sNewRuleName = $sBorderRule . "-width";
149
- } else/* if(in_array($mValue, $aBorderStyles)) */ {
150
- $sNewRuleName = $sBorderRule . "-style";
151
- }
152
- }
153
- $oNewRule = new Rule($sNewRuleName, $this->iLineNo);
154
- $oNewRule->setIsImportant($oRule->getIsImportant());
155
- $oNewRule->addValue(array($mNewValue));
156
- $this->addRule($oNewRule);
157
- }
158
- $this->removeRule($sBorderRule);
159
- }
160
- }
161
-
162
- /**
163
- * Split shorthand dimensional declarations (e.g. <tt>margin: 0px auto;</tt>)
164
- * into their constituent parts.
165
- * Handles margin, padding, border-color, border-style and border-width.
166
- * */
167
- public function expandDimensionsShorthand() {
168
- $aExpansions = array(
169
- 'margin' => 'margin-%s',
170
- 'padding' => 'padding-%s',
171
- 'border-color' => 'border-%s-color',
172
- 'border-style' => 'border-%s-style',
173
- 'border-width' => 'border-%s-width'
174
- );
175
- $aRules = $this->getRulesAssoc();
176
- foreach ($aExpansions as $sProperty => $sExpanded) {
177
- if (!isset($aRules[$sProperty]))
178
- continue;
179
- $oRule = $aRules[$sProperty];
180
- $mRuleValue = $oRule->getValue();
181
- $aValues = array();
182
- if (!$mRuleValue instanceof RuleValueList) {
183
- $aValues[] = $mRuleValue;
184
- } else {
185
- $aValues = $mRuleValue->getListComponents();
186
- }
187
- $top = $right = $bottom = $left = null;
188
- switch (count($aValues)) {
189
- case 1:
190
- $top = $right = $bottom = $left = $aValues[0];
191
- break;
192
- case 2:
193
- $top = $bottom = $aValues[0];
194
- $left = $right = $aValues[1];
195
- break;
196
- case 3:
197
- $top = $aValues[0];
198
- $left = $right = $aValues[1];
199
- $bottom = $aValues[2];
200
- break;
201
- case 4:
202
- $top = $aValues[0];
203
- $right = $aValues[1];
204
- $bottom = $aValues[2];
205
- $left = $aValues[3];
206
- break;
207
- }
208
- foreach (array('top', 'right', 'bottom', 'left') as $sPosition) {
209
- $oNewRule = new Rule(sprintf($sExpanded, $sPosition), $this->iLineNo);
210
- $oNewRule->setIsImportant($oRule->getIsImportant());
211
- $oNewRule->addValue(${$sPosition});
212
- $this->addRule($oNewRule);
213
- }
214
- $this->removeRule($sProperty);
215
- }
216
- }
217
-
218
- /**
219
- * Convert shorthand font declarations
220
- * (e.g. <tt>font: 300 italic 11px/14px verdana, helvetica, sans-serif;</tt>)
221
- * into their constituent parts.
222
- * */
223
- public function expandFontShorthand() {
224
- $aRules = $this->getRulesAssoc();
225
- if (!isset($aRules['font']))
226
- return;
227
- $oRule = $aRules['font'];
228
- // reset properties to 'normal' per http://www.w3.org/TR/21/fonts.html#font-shorthand
229
- $aFontProperties = array(
230
- 'font-style' => 'normal',
231
- 'font-variant' => 'normal',
232
- 'font-weight' => 'normal',
233
- 'font-size' => 'normal',
234
- 'line-height' => 'normal'
235
- );
236
- $mRuleValue = $oRule->getValue();
237
- $aValues = array();
238
- if (!$mRuleValue instanceof RuleValueList) {
239
- $aValues[] = $mRuleValue;
240
- } else {
241
- $aValues = $mRuleValue->getListComponents();
242
- }
243
- foreach ($aValues as $mValue) {
244
- if (!$mValue instanceof Value) {
245
- $mValue = mb_strtolower($mValue);
246
- }
247
- if (in_array($mValue, array('normal', 'inherit'))) {
248
- foreach (array('font-style', 'font-weight', 'font-variant') as $sProperty) {
249
- if (!isset($aFontProperties[$sProperty])) {
250
- $aFontProperties[$sProperty] = $mValue;
251
- }
252
- }
253
- } else if (in_array($mValue, array('italic', 'oblique'))) {
254
- $aFontProperties['font-style'] = $mValue;
255
- } else if ($mValue == 'small-caps') {
256
- $aFontProperties['font-variant'] = $mValue;
257
- } else if (
258
- in_array($mValue, array('bold', 'bolder', 'lighter'))
259
- || ($mValue instanceof Size
260
- && in_array($mValue->getSize(), range(100, 900, 100)))
261
- ) {
262
- $aFontProperties['font-weight'] = $mValue;
263
- } else if ($mValue instanceof RuleValueList && $mValue->getListSeparator() == '/') {
264
- list($oSize, $oHeight) = $mValue->getListComponents();
265
- $aFontProperties['font-size'] = $oSize;
266
- $aFontProperties['line-height'] = $oHeight;
267
- } else if ($mValue instanceof Size && $mValue->getUnit() !== null) {
268
- $aFontProperties['font-size'] = $mValue;
269
- } else {
270
- $aFontProperties['font-family'] = $mValue;
271
- }
272
- }
273
- foreach ($aFontProperties as $sProperty => $mValue) {
274
- $oNewRule = new Rule($sProperty, $this->iLineNo);
275
- $oNewRule->addValue($mValue);
276
- $oNewRule->setIsImportant($oRule->getIsImportant());
277
- $this->addRule($oNewRule);
278
- }
279
- $this->removeRule('font');
280
- }
281
-
282
- /*
283
- * Convert shorthand background declarations
284
- * (e.g. <tt>background: url("chess.png") gray 50% repeat fixed;</tt>)
285
- * into their constituent parts.
286
- * @see http://www.w3.org/TR/21/colors.html#propdef-background
287
- * */
288
-
289
- public function expandBackgroundShorthand() {
290
- $aRules = $this->getRulesAssoc();
291
- if (!isset($aRules['background']))
292
- return;
293
- $oRule = $aRules['background'];
294
- $aBgProperties = array(
295
- 'background-color' => array('transparent'), 'background-image' => array('none'),
296
- 'background-repeat' => array('repeat'), 'background-attachment' => array('scroll'),
297
- 'background-position' => array(new Size(0, '%', null, false, $this->iLineNo), new Size(0, '%', null, false, $this->iLineNo))
298
- );
299
- $mRuleValue = $oRule->getValue();
300
- $aValues = array();
301
- if (!$mRuleValue instanceof RuleValueList) {
302
- $aValues[] = $mRuleValue;
303
- } else {
304
- $aValues = $mRuleValue->getListComponents();
305
- }
306
- if (count($aValues) == 1 && $aValues[0] == 'inherit') {
307
- foreach ($aBgProperties as $sProperty => $mValue) {
308
- $oNewRule = new Rule($sProperty, $this->iLineNo);
309
- $oNewRule->addValue('inherit');
310
- $oNewRule->setIsImportant($oRule->getIsImportant());
311
- $this->addRule($oNewRule);
312
- }
313
- $this->removeRule('background');
314
- return;
315
- }
316
- $iNumBgPos = 0;
317
- foreach ($aValues as $mValue) {
318
- if (!$mValue instanceof Value) {
319
- $mValue = mb_strtolower($mValue);
320
- }
321
- if ($mValue instanceof URL) {
322
- $aBgProperties['background-image'] = $mValue;
323
- } else if ($mValue instanceof Color) {
324
- $aBgProperties['background-color'] = $mValue;
325
- } else if (in_array($mValue, array('scroll', 'fixed'))) {
326
- $aBgProperties['background-attachment'] = $mValue;
327
- } else if (in_array($mValue, array('repeat', 'no-repeat', 'repeat-x', 'repeat-y'))) {
328
- $aBgProperties['background-repeat'] = $mValue;
329
- } else if (in_array($mValue, array('left', 'center', 'right', 'top', 'bottom'))
330
- || $mValue instanceof Size
331
- ) {
332
- if ($iNumBgPos == 0) {
333
- $aBgProperties['background-position'][0] = $mValue;
334
- $aBgProperties['background-position'][1] = 'center';
335
- } else {
336
- $aBgProperties['background-position'][$iNumBgPos] = $mValue;
337
- }
338
- $iNumBgPos++;
339
- }
340
- }
341
- foreach ($aBgProperties as $sProperty => $mValue) {
342
- $oNewRule = new Rule($sProperty, $this->iLineNo);
343
- $oNewRule->setIsImportant($oRule->getIsImportant());
344
- $oNewRule->addValue($mValue);
345
- $this->addRule($oNewRule);
346
- }
347
- $this->removeRule('background');
348
- }
349
-
350
- public function expandListStyleShorthand() {
351
- $aListProperties = array(
352
- 'list-style-type' => 'disc',
353
- 'list-style-position' => 'outside',
354
- 'list-style-image' => 'none'
355
- );
356
- $aListStyleTypes = array(
357
- 'none', 'disc', 'circle', 'square', 'decimal-leading-zero', 'decimal',
358
- 'lower-roman', 'upper-roman', 'lower-greek', 'lower-alpha', 'lower-latin',
359
- 'upper-alpha', 'upper-latin', 'hebrew', 'armenian', 'georgian', 'cjk-ideographic',
360
- 'hiragana', 'hira-gana-iroha', 'katakana-iroha', 'katakana'
361
- );
362
- $aListStylePositions = array(
363
- 'inside', 'outside'
364
- );
365
- $aRules = $this->getRulesAssoc();
366
- if (!isset($aRules['list-style']))
367
- return;
368
- $oRule = $aRules['list-style'];
369
- $mRuleValue = $oRule->getValue();
370
- $aValues = array();
371
- if (!$mRuleValue instanceof RuleValueList) {
372
- $aValues[] = $mRuleValue;
373
- } else {
374
- $aValues = $mRuleValue->getListComponents();
375
- }
376
- if (count($aValues) == 1 && $aValues[0] == 'inherit') {
377
- foreach ($aListProperties as $sProperty => $mValue) {
378
- $oNewRule = new Rule($sProperty, $this->iLineNo);
379
- $oNewRule->addValue('inherit');
380
- $oNewRule->setIsImportant($oRule->getIsImportant());
381
- $this->addRule($oNewRule);
382
- }
383
- $this->removeRule('list-style');
384
- return;
385
- }
386
- foreach ($aValues as $mValue) {
387
- if (!$mValue instanceof Value) {
388
- $mValue = mb_strtolower($mValue);
389
- }
390
- if ($mValue instanceof Url) {
391
- $aListProperties['list-style-image'] = $mValue;
392
- } else if (in_array($mValue, $aListStyleTypes)) {
393
- $aListProperties['list-style-types'] = $mValue;
394
- } else if (in_array($mValue, $aListStylePositions)) {
395
- $aListProperties['list-style-position'] = $mValue;
396
- }
397
- }
398
- foreach ($aListProperties as $sProperty => $mValue) {
399
- $oNewRule = new Rule($sProperty, $this->iLineNo);
400
- $oNewRule->setIsImportant($oRule->getIsImportant());
401
- $oNewRule->addValue($mValue);
402
- $this->addRule($oNewRule);
403
- }
404
- $this->removeRule('list-style');
405
- }
406
-
407
- public function createShorthandProperties(array $aProperties, $sShorthand) {
408
- $aRules = $this->getRulesAssoc();
409
- $aNewValues = array();
410
- foreach ($aProperties as $sProperty) {
411
- if (!isset($aRules[$sProperty]))
412
- continue;
413
- $oRule = $aRules[$sProperty];
414
- if (!$oRule->getIsImportant()) {
415
- $mRuleValue = $oRule->getValue();
416
- $aValues = array();
417
- if (!$mRuleValue instanceof RuleValueList) {
418
- $aValues[] = $mRuleValue;
419
- } else {
420
- $aValues = $mRuleValue->getListComponents();
421
- }
422
- foreach ($aValues as $mValue) {
423
- $aNewValues[] = $mValue;
424
- }
425
- $this->removeRule($sProperty);
426
- }
427
- }
428
- if (count($aNewValues)) {
429
- $oNewRule = new Rule($sShorthand, $this->iLineNo);
430
- foreach ($aNewValues as $mValue) {
431
- $oNewRule->addValue($mValue);
432
- }
433
- $this->addRule($oNewRule);
434
- }
435
- }
436
-
437
- public function createBackgroundShorthand() {
438
- $aProperties = array(
439
- 'background-color', 'background-image', 'background-repeat',
440
- 'background-position', 'background-attachment'
441
- );
442
- $this->createShorthandProperties($aProperties, 'background');
443
- }
444
-
445
- public function createListStyleShorthand() {
446
- $aProperties = array(
447
- 'list-style-type', 'list-style-position', 'list-style-image'
448
- );
449
- $this->createShorthandProperties($aProperties, 'list-style');
450
- }
451
-
452
- /**
453
- * Combine border-color, border-style and border-width into border
454
- * Should be run after create_dimensions_shorthand!
455
- * */
456
- public function createBorderShorthand() {
457
- $aProperties = array(
458
- 'border-width', 'border-style', 'border-color'
459
- );
460
- $this->createShorthandProperties($aProperties, 'border');
461
- }
462
-
463
- /*
464
- * Looks for long format CSS dimensional properties
465
- * (margin, padding, border-color, border-style and border-width)
466
- * and converts them into shorthand CSS properties.
467
- * */
468
-
469
- public function createDimensionsShorthand() {
470
- $aPositions = array('top', 'right', 'bottom', 'left');
471
- $aExpansions = array(
472
- 'margin' => 'margin-%s',
473
- 'padding' => 'padding-%s',
474
- 'border-color' => 'border-%s-color',
475
- 'border-style' => 'border-%s-style',
476
- 'border-width' => 'border-%s-width'
477
- );
478
- $aRules = $this->getRulesAssoc();
479
- foreach ($aExpansions as $sProperty => $sExpanded) {
480
- $aFoldable = array();
481
- foreach ($aRules as $sRuleName => $oRule) {
482
- foreach ($aPositions as $sPosition) {
483
- if ($sRuleName == sprintf($sExpanded, $sPosition)) {
484
- $aFoldable[$sRuleName] = $oRule;
485
- }
486
- }
487
- }
488
- // All four dimensions must be present
489
- if (count($aFoldable) == 4) {
490
- $aValues = array();
491
- foreach ($aPositions as $sPosition) {
492
- $oRule = $aRules[sprintf($sExpanded, $sPosition)];
493
- $mRuleValue = $oRule->getValue();
494
- $aRuleValues = array();
495
- if (!$mRuleValue instanceof RuleValueList) {
496
- $aRuleValues[] = $mRuleValue;
497
- } else {
498
- $aRuleValues = $mRuleValue->getListComponents();
499
- }
500
- $aValues[$sPosition] = $aRuleValues;
501
- }
502
- $oNewRule = new Rule($sProperty, $this->iLineNo);
503
- if ((string) $aValues['left'][0] == (string) $aValues['right'][0]) {
504
- if ((string) $aValues['top'][0] == (string) $aValues['bottom'][0]) {
505
- if ((string) $aValues['top'][0] == (string) $aValues['left'][0]) {
506
- // All 4 sides are equal
507
- $oNewRule->addValue($aValues['top']);
508
- } else {
509
- // Top and bottom are equal, left and right are equal
510
- $oNewRule->addValue($aValues['top']);
511
- $oNewRule->addValue($aValues['left']);
512
- }
513
- } else {
514
- // Only left and right are equal
515
- $oNewRule->addValue($aValues['top']);
516
- $oNewRule->addValue($aValues['left']);
517
- $oNewRule->addValue($aValues['bottom']);
518
- }
519
- } else {
520
- // No sides are equal
521
- $oNewRule->addValue($aValues['top']);
522
- $oNewRule->addValue($aValues['left']);
523
- $oNewRule->addValue($aValues['bottom']);
524
- $oNewRule->addValue($aValues['right']);
525
- }
526
- $this->addRule($oNewRule);
527
- foreach ($aPositions as $sPosition) {
528
- $this->removeRule(sprintf($sExpanded, $sPosition));
529
- }
530
- }
531
- }
532
- }
533
-
534
- /**
535
- * Looks for long format CSS font properties (e.g. <tt>font-weight</tt>) and
536
- * tries to convert them into a shorthand CSS <tt>font</tt> property.
537
- * At least font-size AND font-family must be present in order to create a shorthand declaration.
538
- * */
539
- public function createFontShorthand() {
540
- $aFontProperties = array(
541
- 'font-style', 'font-variant', 'font-weight', 'font-size', 'line-height', 'font-family'
542
- );
543
- $aRules = $this->getRulesAssoc();
544
- if (!isset($aRules['font-size']) || !isset($aRules['font-family'])) {
545
- return;
546
- }
547
- $oNewRule = new Rule('font', $this->iLineNo);
548
- foreach (array('font-style', 'font-variant', 'font-weight') as $sProperty) {
549
- if (isset($aRules[$sProperty])) {
550
- $oRule = $aRules[$sProperty];
551
- $mRuleValue = $oRule->getValue();
552
- $aValues = array();
553
- if (!$mRuleValue instanceof RuleValueList) {
554
- $aValues[] = $mRuleValue;
555
- } else {
556
- $aValues = $mRuleValue->getListComponents();
557
- }
558
- if ($aValues[0] !== 'normal') {
559
- $oNewRule->addValue($aValues[0]);
560
- }
561
- }
562
- }
563
- // Get the font-size value
564
- $oRule = $aRules['font-size'];
565
- $mRuleValue = $oRule->getValue();
566
- $aFSValues = array();
567
- if (!$mRuleValue instanceof RuleValueList) {
568
- $aFSValues[] = $mRuleValue;
569
- } else {
570
- $aFSValues = $mRuleValue->getListComponents();
571
- }
572
- // But wait to know if we have line-height to add it
573
- if (isset($aRules['line-height'])) {
574
- $oRule = $aRules['line-height'];
575
- $mRuleValue = $oRule->getValue();
576
- $aLHValues = array();
577
- if (!$mRuleValue instanceof RuleValueList) {
578
- $aLHValues[] = $mRuleValue;
579
- } else {
580
- $aLHValues = $mRuleValue->getListComponents();
581
- }
582
- if ($aLHValues[0] !== 'normal') {
583
- $val = new RuleValueList('/', $this->iLineNo);
584
- $val->addListComponent($aFSValues[0]);
585
- $val->addListComponent($aLHValues[0]);
586
- $oNewRule->addValue($val);
587
- }
588
- } else {
589
- $oNewRule->addValue($aFSValues[0]);
590
- }
591
- $oRule = $aRules['font-family'];
592
- $mRuleValue = $oRule->getValue();
593
- $aFFValues = array();
594
- if (!$mRuleValue instanceof RuleValueList) {
595
- $aFFValues[] = $mRuleValue;
596
- } else {
597
- $aFFValues = $mRuleValue->getListComponents();
598
- }
599
- $oFFValue = new RuleValueList(',', $this->iLineNo);
600
- $oFFValue->setListComponents($aFFValues);
601
- $oNewRule->addValue($oFFValue);
602
-
603
- $this->addRule($oNewRule);
604
- foreach ($aFontProperties as $sProperty) {
605
- $this->removeRule($sProperty);
606
- }
607
- }
608
-
609
- public function __toString() {
610
- return $this->render(new \Sabberworm\CSS\OutputFormat());
611
- }
612
-
613
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
614
- if(count($this->aSelectors) === 0) {
615
- // If all the selectors have been removed, this declaration block becomes invalid
616
- throw new OutputException("Attempt to print declaration block with missing selector", $this->iLineNo);
617
- }
618
- $sResult = $oOutputFormat->sBeforeDeclarationBlock;
619
- $sResult .= $oOutputFormat->implode($oOutputFormat->spaceBeforeSelectorSeparator() . ',' . $oOutputFormat->spaceAfterSelectorSeparator(), $this->aSelectors);
620
- $sResult .= $oOutputFormat->sAfterDeclarationBlockSelectors;
621
- $sResult .= $oOutputFormat->spaceBeforeOpeningBrace() . '{';
622
- $sResult .= parent::render($oOutputFormat);
623
- $sResult .= '}';
624
- $sResult .= $oOutputFormat->sAfterDeclarationBlock;
625
- return $sResult;
626
- }
627
-
628
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php DELETED
@@ -1,212 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\RuleSet;
4
-
5
- use Sabberworm\CSS\Comment\Commentable;
6
- use Sabberworm\CSS\Parsing\ParserState;
7
- use Sabberworm\CSS\Parsing\UnexpectedTokenException;
8
- use Sabberworm\CSS\Renderable;
9
- use Sabberworm\CSS\Rule\Rule;
10
-
11
- /**
12
- * RuleSet is a generic superclass denoting rules. The typical example for rule sets are declaration block.
13
- * However, unknown At-Rules (like @font-face) are also rule sets.
14
- */
15
- abstract class RuleSet implements Renderable, Commentable {
16
-
17
- private $aRules;
18
- protected $iLineNo;
19
- protected $aComments;
20
-
21
- public function __construct($iLineNo = 0) {
22
- $this->aRules = array();
23
- $this->iLineNo = $iLineNo;
24
- $this->aComments = array();
25
- }
26
-
27
- public static function parseRuleSet(ParserState $oParserState, RuleSet $oRuleSet) {
28
- while ($oParserState->comes(';')) {
29
- $oParserState->consume(';');
30
- }
31
- while (!$oParserState->comes('}')) {
32
- $oRule = null;
33
- if($oParserState->getSettings()->bLenientParsing) {
34
- try {
35
- $oRule = Rule::parse($oParserState);
36
- } catch (UnexpectedTokenException $e) {
37
- try {
38
- $sConsume = $oParserState->consumeUntil(array("\n", ";", '}'), true);
39
- // We need to “unfind” the matches to the end of the ruleSet as this will be matched later
40
- if($oParserState->streql(substr($sConsume, -1), '}')) {
41
- $oParserState->backtrack(1);
42
- } else {
43
- while ($oParserState->comes(';')) {
44
- $oParserState->consume(';');
45
- }
46
- }
47
- } catch (UnexpectedTokenException $e) {
48
- // We’ve reached the end of the document. Just close the RuleSet.
49
- return;
50
- }
51
- }
52
- } else {
53
- $oRule = Rule::parse($oParserState);
54
- }
55
- if($oRule) {
56
- $oRuleSet->addRule($oRule);
57
- }
58
- }
59
- $oParserState->consume('}');
60
- }
61
-
62
- /**
63
- * @return int
64
- */
65
- public function getLineNo() {
66
- return $this->iLineNo;
67
- }
68
-
69
- public function addRule(Rule $oRule, Rule $oSibling = null) {
70
- $sRule = $oRule->getRule();
71
- if(!isset($this->aRules[$sRule])) {
72
- $this->aRules[$sRule] = array();
73
- }
74
-
75
- $iPosition = count($this->aRules[$sRule]);
76
-
77
- if ($oSibling !== null) {
78
- $iSiblingPos = array_search($oSibling, $this->aRules[$sRule], true);
79
- if ($iSiblingPos !== false) {
80
- $iPosition = $iSiblingPos;
81
- }
82
- }
83
-
84
- array_splice($this->aRules[$sRule], $iPosition, 0, array($oRule));
85
- }
86
-
87
- /**
88
- * Returns all rules matching the given rule name
89
- * @param (null|string|Rule) $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()).
90
- * @example $oRuleSet->getRules('font-') //returns an array of all rules either beginning with font- or matching font.
91
- * @example $oRuleSet->getRules('font') //returns array(0 => $oRule, …) or array().
92
- * @return Rule[] Rules.
93
- */
94
- public function getRules($mRule = null) {
95
- if ($mRule instanceof Rule) {
96
- $mRule = $mRule->getRule();
97
- }
98
- $aResult = array();
99
- foreach($this->aRules as $sName => $aRules) {
100
- // 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.
101
- if(!$mRule || $sName === $mRule || (strrpos($mRule, '-') === strlen($mRule) - strlen('-') && (strpos($sName, $mRule) === 0 || $sName === substr($mRule, 0, -1)))) {
102
- $aResult = array_merge($aResult, $aRules);
103
- }
104
- }
105
- return $aResult;
106
- }
107
-
108
- /**
109
- * Override all the rules of this set.
110
- * @param Rule[] $aRules The rules to override with.
111
- */
112
- public function setRules(array $aRules) {
113
- $this->aRules = array();
114
- foreach ($aRules as $rule) {
115
- $this->addRule($rule);
116
- }
117
- }
118
-
119
- /**
120
- * Returns all rules matching the given pattern and returns them in an associative array with the rule’s name as keys. This method exists mainly for backwards-compatibility and is really only partially useful.
121
- * @param (string) $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()).
122
- * Note: This method loses some information: Calling this (with an argument of 'background-') on a declaration block like { background-color: green; background-color; rgba(0, 127, 0, 0.7); } will only yield an associative array containing the rgba-valued rule while @link{getRules()} would yield an indexed array containing both.
123
- * @return Rule[] Rules.
124
- */
125
- public function getRulesAssoc($mRule = null) {
126
- $aResult = array();
127
- foreach($this->getRules($mRule) as $oRule) {
128
- $aResult[$oRule->getRule()] = $oRule;
129
- }
130
- return $aResult;
131
- }
132
-
133
- /**
134
- * Remove a rule from this RuleSet. This accepts all the possible values that @link{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 behvaiour, use removeRule($oRule->getRule()).
135
- * @param (null|string|Rule) $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.
136
- */
137
- public function removeRule($mRule) {
138
- if($mRule instanceof Rule) {
139
- $sRule = $mRule->getRule();
140
- if(!isset($this->aRules[$sRule])) {
141
- return;
142
- }
143
- foreach($this->aRules[$sRule] as $iKey => $oRule) {
144
- if($oRule === $mRule) {
145
- unset($this->aRules[$sRule][$iKey]);
146
- }
147
- }
148
- } else {
149
- foreach($this->aRules as $sName => $aRules) {
150
- // 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).
151
- if(!$mRule || $sName === $mRule || (strrpos($mRule, '-') === strlen($mRule) - strlen('-') && (strpos($sName, $mRule) === 0 || $sName === substr($mRule, 0, -1)))) {
152
- unset($this->aRules[$sName]);
153
- }
154
- }
155
- }
156
- }
157
-
158
- public function __toString() {
159
- return $this->render(new \Sabberworm\CSS\OutputFormat());
160
- }
161
-
162
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
163
- $sResult = '';
164
- $bIsFirst = true;
165
- foreach ($this->aRules as $aRules) {
166
- foreach($aRules as $oRule) {
167
- $sRendered = $oOutputFormat->safely(function() use ($oRule, $oOutputFormat) {
168
- return $oRule->render($oOutputFormat->nextLevel());
169
- });
170
- if($sRendered === null) {
171
- continue;
172
- }
173
- if($bIsFirst) {
174
- $bIsFirst = false;
175
- $sResult .= $oOutputFormat->nextLevel()->spaceBeforeRules();
176
- } else {
177
- $sResult .= $oOutputFormat->nextLevel()->spaceBetweenRules();
178
- }
179
- $sResult .= $sRendered;
180
- }
181
- }
182
-
183
- if(!$bIsFirst) {
184
- // Had some output
185
- $sResult .= $oOutputFormat->spaceAfterRules();
186
- }
187
-
188
- return $oOutputFormat->removeLastSemicolon($sResult);
189
- }
190
-
191
- /**
192
- * @param array $aComments Array of comments.
193
- */
194
- public function addComments(array $aComments) {
195
- $this->aComments = array_merge($this->aComments, $aComments);
196
- }
197
-
198
- /**
199
- * @return array
200
- */
201
- public function getComments() {
202
- return $this->aComments;
203
- }
204
-
205
- /**
206
- * @param array $aComments Array containing Comment objects.
207
- */
208
- public function setComments(array $aComments) {
209
- $this->aComments = $aComments;
210
- }
211
-
212
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Settings.php DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS;
4
-
5
- use Sabberworm\CSS\Rule\Rule;
6
-
7
- /**
8
- * Parser settings class.
9
- *
10
- * Configure parser behaviour here.
11
- */
12
- class Settings {
13
- /**
14
- * Multi-byte string support. If true (mbstring extension must be enabled), will use (slower) mb_strlen, mb_convert_case, mb_substr and mb_strpos functions. Otherwise, the normal (ASCII-Only) functions will be used.
15
- */
16
- public $bMultibyteSupport;
17
-
18
- /**
19
- * The default charset for the CSS if no `@charset` rule is found. Defaults to utf-8.
20
- */
21
- public $sDefaultCharset = 'utf-8';
22
-
23
- /**
24
- * Lenient parsing. When used (which is true by default), the parser will not choke on unexpected tokens but simply ignore them.
25
- */
26
- public $bLenientParsing = true;
27
-
28
- private function __construct() {
29
- $this->bMultibyteSupport = extension_loaded('mbstring');
30
- }
31
-
32
- public static function create() {
33
- return new Settings();
34
- }
35
-
36
- public function withMultibyteSupport($bMultibyteSupport = true) {
37
- $this->bMultibyteSupport = $bMultibyteSupport;
38
- return $this;
39
- }
40
-
41
- public function withDefaultCharset($sDefaultCharset) {
42
- $this->sDefaultCharset = $sDefaultCharset;
43
- return $this;
44
- }
45
-
46
- public function withLenientParsing($bLenientParsing = true) {
47
- $this->bLenientParsing = $bLenientParsing;
48
- return $this;
49
- }
50
-
51
- public function beStrict() {
52
- return $this->withLenientParsing(false);
53
- }
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSFunction.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- class CSSFunction extends ValueList {
6
-
7
- protected $sName;
8
-
9
- public function __construct($sName, $aArguments, $sSeparator = ',', $iLineNo = 0) {
10
- if($aArguments instanceof RuleValueList) {
11
- $sSeparator = $aArguments->getListSeparator();
12
- $aArguments = $aArguments->getListComponents();
13
- }
14
- $this->sName = $sName;
15
- $this->iLineNo = $iLineNo;
16
- parent::__construct($aArguments, $sSeparator, $iLineNo);
17
- }
18
-
19
- public function getName() {
20
- return $this->sName;
21
- }
22
-
23
- public function setName($sName) {
24
- $this->sName = $sName;
25
- }
26
-
27
- public function getArguments() {
28
- return $this->aComponents;
29
- }
30
-
31
- public function __toString() {
32
- return $this->render(new \Sabberworm\CSS\OutputFormat());
33
- }
34
-
35
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
36
- $aArguments = parent::render($oOutputFormat);
37
- return "{$this->sName}({$aArguments})";
38
- }
39
-
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSString.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- use Sabberworm\CSS\Parsing\ParserState;
6
- use Sabberworm\CSS\Parsing\SourceException;
7
-
8
- class CSSString extends PrimitiveValue {
9
-
10
- private $sString;
11
-
12
- public function __construct($sString, $iLineNo = 0) {
13
- $this->sString = $sString;
14
- parent::__construct($iLineNo);
15
- }
16
-
17
- public static function parse(ParserState $oParserState) {
18
- $sBegin = $oParserState->peek();
19
- $sQuote = null;
20
- if ($sBegin === "'") {
21
- $sQuote = "'";
22
- } else if ($sBegin === '"') {
23
- $sQuote = '"';
24
- }
25
- if ($sQuote !== null) {
26
- $oParserState->consume($sQuote);
27
- }
28
- $sResult = "";
29
- $sContent = null;
30
- if ($sQuote === null) {
31
- // Unquoted strings end in whitespace or with braces, brackets, parentheses
32
- while (!preg_match('/[\\s{}()<>\\[\\]]/isu', $oParserState->peek())) {
33
- $sResult .= $oParserState->parseCharacter(false);
34
- }
35
- } else {
36
- while (!$oParserState->comes($sQuote)) {
37
- $sContent = $oParserState->parseCharacter(false);
38
- if ($sContent === null) {
39
- throw new SourceException("Non-well-formed quoted string {$oParserState->peek(3)}", $oParserState->currentLine());
40
- }
41
- $sResult .= $sContent;
42
- }
43
- $oParserState->consume($sQuote);
44
- }
45
- return new CSSString($sResult, $oParserState->currentLine());
46
- }
47
-
48
- public function setString($sString) {
49
- $this->sString = $sString;
50
- }
51
-
52
- public function getString() {
53
- return $this->sString;
54
- }
55
-
56
- public function __toString() {
57
- return $this->render(new \Sabberworm\CSS\OutputFormat());
58
- }
59
-
60
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
61
- $sString = addslashes($this->sString);
62
- $sString = str_replace("\n", '\A', $sString);
63
- return $oOutputFormat->getStringQuotingType() . $sString . $oOutputFormat->getStringQuotingType();
64
- }
65
-
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CalcFunction.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- use Sabberworm\CSS\Parsing\ParserState;
6
- use Sabberworm\CSS\Parsing\UnexpectedTokenException;
7
-
8
- class CalcFunction extends CSSFunction {
9
- const T_OPERAND = 1;
10
- const T_OPERATOR = 2;
11
-
12
- public static function parse(ParserState $oParserState) {
13
- $aOperators = array('+', '-', '*', '/');
14
- $sFunction = trim($oParserState->consumeUntil('(', false, true));
15
- $oCalcList = new CalcRuleValueList($oParserState->currentLine());
16
- $oList = new RuleValueList(',', $oParserState->currentLine());
17
- $iNestingLevel = 0;
18
- $iLastComponentType = NULL;
19
- while(!$oParserState->comes(')') || $iNestingLevel > 0) {
20
- $oParserState->consumeWhiteSpace();
21
- if ($oParserState->comes('(')) {
22
- $iNestingLevel++;
23
- $oCalcList->addListComponent($oParserState->consume(1));
24
- continue;
25
- } else if ($oParserState->comes(')')) {
26
- $iNestingLevel--;
27
- $oCalcList->addListComponent($oParserState->consume(1));
28
- continue;
29
- }
30
- if ($iLastComponentType != CalcFunction::T_OPERAND) {
31
- $oVal = Value::parsePrimitiveValue($oParserState);
32
- $oCalcList->addListComponent($oVal);
33
- $iLastComponentType = CalcFunction::T_OPERAND;
34
- } else {
35
- if (in_array($oParserState->peek(), $aOperators)) {
36
- if (($oParserState->comes('-') || $oParserState->comes('+'))) {
37
- if ($oParserState->peek(1, -1) != ' ' || !($oParserState->comes('- ') || $oParserState->comes('+ '))) {
38
- throw new UnexpectedTokenException(" {$oParserState->peek()} ", $oParserState->peek(1, -1) . $oParserState->peek(2), 'literal', $oParserState->currentLine());
39
- }
40
- }
41
- $oCalcList->addListComponent($oParserState->consume(1));
42
- $iLastComponentType = CalcFunction::T_OPERATOR;
43
- } else {
44
- throw new UnexpectedTokenException(
45
- sprintf(
46
- 'Next token was expected to be an operand of type %s. Instead "%s" was found.',
47
- implode(', ', $aOperators),
48
- $oVal
49
- ),
50
- '',
51
- 'custom',
52
- $oParserState->currentLine()
53
- );
54
- }
55
- }
56
- }
57
- $oList->addListComponent($oCalcList);
58
- $oParserState->consume(')');
59
- return new CalcFunction($sFunction, $oList, ',', $oParserState->currentLine());
60
- }
61
-
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CalcRuleValueList.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- class CalcRuleValueList extends RuleValueList {
6
- public function __construct($iLineNo = 0) {
7
- parent::__construct(array(), ',', $iLineNo);
8
- }
9
-
10
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
11
- return $oOutputFormat->implode(' ', $this->aComponents);
12
- }
13
-
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Color.php DELETED
@@ -1,95 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- use Sabberworm\CSS\Parsing\ParserState;
6
-
7
- class Color extends CSSFunction {
8
-
9
- public function __construct($aColor, $iLineNo = 0) {
10
- parent::__construct(implode('', array_keys($aColor)), $aColor, ',', $iLineNo);
11
- }
12
-
13
- public static function parse(ParserState $oParserState) {
14
- $aColor = array();
15
- if ($oParserState->comes('#')) {
16
- $oParserState->consume('#');
17
- $sValue = $oParserState->parseIdentifier(false);
18
- if ($oParserState->strlen($sValue) === 3) {
19
- $sValue = $sValue[0] . $sValue[0] . $sValue[1] . $sValue[1] . $sValue[2] . $sValue[2];
20
- } else if ($oParserState->strlen($sValue) === 4) {
21
- $sValue = $sValue[0] . $sValue[0] . $sValue[1] . $sValue[1] . $sValue[2] . $sValue[2] . $sValue[3] . $sValue[3];
22
- }
23
-
24
- if ($oParserState->strlen($sValue) === 8) {
25
- $aColor = array(
26
- 'r' => new Size(intval($sValue[0] . $sValue[1], 16), null, true, $oParserState->currentLine()),
27
- 'g' => new Size(intval($sValue[2] . $sValue[3], 16), null, true, $oParserState->currentLine()),
28
- 'b' => new Size(intval($sValue[4] . $sValue[5], 16), null, true, $oParserState->currentLine()),
29
- 'a' => new Size(round(self::mapRange(intval($sValue[6] . $sValue[7], 16), 0, 255, 0, 1), 2), null, true, $oParserState->currentLine())
30
- );
31
- } else {
32
- $aColor = array(
33
- 'r' => new Size(intval($sValue[0] . $sValue[1], 16), null, true, $oParserState->currentLine()),
34
- 'g' => new Size(intval($sValue[2] . $sValue[3], 16), null, true, $oParserState->currentLine()),
35
- 'b' => new Size(intval($sValue[4] . $sValue[5], 16), null, true, $oParserState->currentLine())
36
- );
37
- }
38
- } else {
39
- $sColorMode = $oParserState->parseIdentifier(true);
40
- $oParserState->consumeWhiteSpace();
41
- $oParserState->consume('(');
42
- $iLength = $oParserState->strlen($sColorMode);
43
- for ($i = 0; $i < $iLength; ++$i) {
44
- $oParserState->consumeWhiteSpace();
45
- $aColor[$sColorMode[$i]] = Size::parse($oParserState, true);
46
- $oParserState->consumeWhiteSpace();
47
- if ($i < ($iLength - 1)) {
48
- $oParserState->consume(',');
49
- }
50
- }
51
- $oParserState->consume(')');
52
- }
53
- return new Color($aColor, $oParserState->currentLine());
54
- }
55
-
56
- private static function mapRange($fVal, $fFromMin, $fFromMax, $fToMin, $fToMax) {
57
- $fFromRange = $fFromMax - $fFromMin;
58
- $fToRange = $fToMax - $fToMin;
59
- $fMultiplier = $fToRange / $fFromRange;
60
- $fNewVal = $fVal - $fFromMin;
61
- $fNewVal *= $fMultiplier;
62
- return $fNewVal + $fToMin;
63
- }
64
-
65
- public function getColor() {
66
- return $this->aComponents;
67
- }
68
-
69
- public function setColor($aColor) {
70
- $this->setName(implode('', array_keys($aColor)));
71
- $this->aComponents = $aColor;
72
- }
73
-
74
- public function getColorDescription() {
75
- return $this->getName();
76
- }
77
-
78
- public function __toString() {
79
- return $this->render(new \Sabberworm\CSS\OutputFormat());
80
- }
81
-
82
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
83
- // Shorthand RGB color values
84
- if($oOutputFormat->getRGBHashNotation() && implode('', array_keys($this->aComponents)) === 'rgb') {
85
- $sResult = sprintf(
86
- '%02x%02x%02x',
87
- $this->aComponents['r']->getSize(),
88
- $this->aComponents['g']->getSize(),
89
- $this->aComponents['b']->getSize()
90
- );
91
- return '#'.(($sResult[0] == $sResult[1]) && ($sResult[2] == $sResult[3]) && ($sResult[4] == $sResult[5]) ? "$sResult[0]$sResult[2]$sResult[4]" : $sResult);
92
- }
93
- return parent::render($oOutputFormat);
94
- }
95
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/LineName.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- use Sabberworm\CSS\Parsing\ParserState;
6
- use Sabberworm\CSS\Parsing\UnexpectedTokenException;
7
-
8
- class LineName extends ValueList {
9
- public function __construct($aComponents = array(), $iLineNo = 0) {
10
- parent::__construct($aComponents, ' ', $iLineNo);
11
- }
12
-
13
- public static function parse(ParserState $oParserState) {
14
- $oParserState->consume('[');
15
- $oParserState->consumeWhiteSpace();
16
- $aNames = array();
17
- do {
18
- if($oParserState->getSettings()->bLenientParsing) {
19
- try {
20
- $aNames[] = $oParserState->parseIdentifier();
21
- } catch(UnexpectedTokenException $e) {}
22
- } else {
23
- $aNames[] = $oParserState->parseIdentifier();
24
- }
25
- $oParserState->consumeWhiteSpace();
26
- } while (!$oParserState->comes(']'));
27
- $oParserState->consume(']');
28
- return new LineName($aNames, $oParserState->currentLine());
29
- }
30
-
31
-
32
-
33
- public function __toString() {
34
- return $this->render(new \Sabberworm\CSS\OutputFormat());
35
- }
36
-
37
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
38
- return '[' . parent::render(\Sabberworm\CSS\OutputFormat::createCompact()) . ']';
39
- }
40
-
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/PrimitiveValue.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- abstract class PrimitiveValue extends Value {
6
- public function __construct($iLineNo = 0) {
7
- parent::__construct($iLineNo);
8
- }
9
-
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/RuleValueList.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- class RuleValueList extends ValueList {
6
- public function __construct($sSeparator = ',', $iLineNo = 0) {
7
- parent::__construct(array(), $sSeparator, $iLineNo);
8
- }
9
- }
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Size.php DELETED
@@ -1,122 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- use Sabberworm\CSS\Parsing\ParserState;
6
-
7
- class Size extends PrimitiveValue {
8
-
9
- const ABSOLUTE_SIZE_UNITS = 'px/cm/mm/mozmm/in/pt/pc/vh/vw/vm/vmin/vmax/rem'; //vh/vw/vm(ax)/vmin/rem are absolute insofar as they don’t scale to the immediate parent (only the viewport)
10
- const RELATIVE_SIZE_UNITS = '%/em/ex/ch/fr';
11
- const NON_SIZE_UNITS = 'deg/grad/rad/s/ms/turns/Hz/kHz';
12
-
13
- private static $SIZE_UNITS = null;
14
-
15
- private $fSize;
16
- private $sUnit;
17
- private $bIsColorComponent;
18
-
19
- public function __construct($fSize, $sUnit = null, $bIsColorComponent = false, $iLineNo = 0) {
20
- parent::__construct($iLineNo);
21
- $this->fSize = floatval($fSize);
22
- $this->sUnit = $sUnit;
23
- $this->bIsColorComponent = $bIsColorComponent;
24
- }
25
-
26
- public static function parse(ParserState $oParserState, $bIsColorComponent = false) {
27
- $sSize = '';
28
- if ($oParserState->comes('-')) {
29
- $sSize .= $oParserState->consume('-');
30
- }
31
- while (is_numeric($oParserState->peek()) || $oParserState->comes('.')) {
32
- if ($oParserState->comes('.')) {
33
- $sSize .= $oParserState->consume('.');
34
- } else {
35
- $sSize .= $oParserState->consume(1);
36
- }
37
- }
38
-
39
- $sUnit = null;
40
- $aSizeUnits = self::getSizeUnits();
41
- foreach($aSizeUnits as $iLength => &$aValues) {
42
- $sKey = strtolower($oParserState->peek($iLength));
43
- if(array_key_exists($sKey, $aValues)) {
44
- if (($sUnit = $aValues[$sKey]) !== null) {
45
- $oParserState->consume($iLength);
46
- break;
47
- }
48
- }
49
- }
50
- return new Size(floatval($sSize), $sUnit, $bIsColorComponent, $oParserState->currentLine());
51
- }
52
-
53
- private static function getSizeUnits() {
54
- if(self::$SIZE_UNITS === null) {
55
- self::$SIZE_UNITS = array();
56
- foreach (explode('/', Size::ABSOLUTE_SIZE_UNITS.'/'.Size::RELATIVE_SIZE_UNITS.'/'.Size::NON_SIZE_UNITS) as $val) {
57
- $iSize = strlen($val);
58
- if(!isset(self::$SIZE_UNITS[$iSize])) {
59
- self::$SIZE_UNITS[$iSize] = array();
60
- }
61
- self::$SIZE_UNITS[$iSize][strtolower($val)] = $val;
62
- }
63
-
64
- // FIXME: Should we not order the longest units first?
65
- ksort(self::$SIZE_UNITS, SORT_NUMERIC);
66
- }
67
-
68
- return self::$SIZE_UNITS;
69
- }
70
-
71
- public function setUnit($sUnit) {
72
- $this->sUnit = $sUnit;
73
- }
74
-
75
- public function getUnit() {
76
- return $this->sUnit;
77
- }
78
-
79
- public function setSize($fSize) {
80
- $this->fSize = floatval($fSize);
81
- }
82
-
83
- public function getSize() {
84
- return $this->fSize;
85
- }
86
-
87
- public function isColorComponent() {
88
- return $this->bIsColorComponent;
89
- }
90
-
91
- /**
92
- * Returns whether the number stored in this Size really represents a size (as in a length of something on screen).
93
- * @return false if the unit an angle, a duration, a frequency or the number is a component in a Color object.
94
- */
95
- public function isSize() {
96
- if (in_array($this->sUnit, explode('/', self::NON_SIZE_UNITS))) {
97
- return false;
98
- }
99
- return !$this->isColorComponent();
100
- }
101
-
102
- public function isRelative() {
103
- if (in_array($this->sUnit, explode('/', self::RELATIVE_SIZE_UNITS))) {
104
- return true;
105
- }
106
- if ($this->sUnit === null && $this->fSize != 0) {
107
- return true;
108
- }
109
- return false;
110
- }
111
-
112
- public function __toString() {
113
- return $this->render(new \Sabberworm\CSS\OutputFormat());
114
- }
115
-
116
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
117
- $l = localeconv();
118
- $sPoint = preg_quote($l['decimal_point'], '/');
119
- return preg_replace(array("/$sPoint/", "/^(-?)0\./"), array('.', '$1.'), $this->fSize) . ($this->sUnit === null ? '' : $this->sUnit);
120
- }
121
-
122
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/URL.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- use Sabberworm\CSS\Parsing\ParserState;
6
-
7
- class URL extends PrimitiveValue {
8
-
9
- private $oURL;
10
-
11
- public function __construct(CSSString $oURL, $iLineNo = 0) {
12
- parent::__construct($iLineNo);
13
- $this->oURL = $oURL;
14
- }
15
-
16
- public static function parse(ParserState $oParserState) {
17
- $bUseUrl = $oParserState->comes('url', true);
18
- if ($bUseUrl) {
19
- $oParserState->consume('url');
20
- $oParserState->consumeWhiteSpace();
21
- $oParserState->consume('(');
22
- }
23
- $oParserState->consumeWhiteSpace();
24
- $oResult = new URL(CSSString::parse($oParserState), $oParserState->currentLine());
25
- if ($bUseUrl) {
26
- $oParserState->consumeWhiteSpace();
27
- $oParserState->consume(')');
28
- }
29
- return $oResult;
30
- }
31
-
32
-
33
- public function setURL(CSSString $oURL) {
34
- $this->oURL = $oURL;
35
- }
36
-
37
- public function getURL() {
38
- return $this->oURL;
39
- }
40
-
41
- public function __toString() {
42
- return $this->render(new \Sabberworm\CSS\OutputFormat());
43
- }
44
-
45
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
46
- return "url({$this->oURL->render($oOutputFormat)})";
47
- }
48
-
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Value.php DELETED
@@ -1,131 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- use Sabberworm\CSS\Parsing\ParserState;
6
- use Sabberworm\CSS\Parsing\UnexpectedTokenException;
7
- use Sabberworm\CSS\Renderable;
8
-
9
- abstract class Value implements Renderable {
10
- protected $iLineNo;
11
-
12
- public function __construct($iLineNo = 0) {
13
- $this->iLineNo = $iLineNo;
14
- }
15
-
16
- public static function parseValue(ParserState $oParserState, $aListDelimiters = array()) {
17
- $aStack = array();
18
- $oParserState->consumeWhiteSpace();
19
- //Build a list of delimiters and parsed values
20
- while (!($oParserState->comes('}') || $oParserState->comes(';') || $oParserState->comes('!') || $oParserState->comes(')') || $oParserState->comes('\\'))) {
21
- if (count($aStack) > 0) {
22
- $bFoundDelimiter = false;
23
- foreach ($aListDelimiters as $sDelimiter) {
24
- if ($oParserState->comes($sDelimiter)) {
25
- array_push($aStack, $oParserState->consume($sDelimiter));
26
- $oParserState->consumeWhiteSpace();
27
- $bFoundDelimiter = true;
28
- break;
29
- }
30
- }
31
- if (!$bFoundDelimiter) {
32
- //Whitespace was the list delimiter
33
- array_push($aStack, ' ');
34
- }
35
- }
36
- array_push($aStack, self::parsePrimitiveValue($oParserState));
37
- $oParserState->consumeWhiteSpace();
38
- }
39
- //Convert the list to list objects
40
- foreach ($aListDelimiters as $sDelimiter) {
41
- if (count($aStack) === 1) {
42
- return $aStack[0];
43
- }
44
- $iStartPosition = null;
45
- while (($iStartPosition = array_search($sDelimiter, $aStack, true)) !== false) {
46
- $iLength = 2; //Number of elements to be joined
47
- for ($i = $iStartPosition + 2; $i < count($aStack); $i+=2, ++$iLength) {
48
- if ($sDelimiter !== $aStack[$i]) {
49
- break;
50
- }
51
- }
52
- $oList = new RuleValueList($sDelimiter, $oParserState->currentLine());
53
- for ($i = $iStartPosition - 1; $i - $iStartPosition + 1 < $iLength * 2; $i+=2) {
54
- $oList->addListComponent($aStack[$i]);
55
- }
56
- array_splice($aStack, $iStartPosition - 1, $iLength * 2 - 1, array($oList));
57
- }
58
- }
59
- if (!isset($aStack[0])) {
60
- throw new UnexpectedTokenException(" {$oParserState->peek()} ", $oParserState->peek(1, -1) . $oParserState->peek(2), 'literal', $oParserState->currentLine());
61
- }
62
- return $aStack[0];
63
- }
64
-
65
- public static function parseIdentifierOrFunction(ParserState $oParserState, $bIgnoreCase = false) {
66
- $sResult = $oParserState->parseIdentifier($bIgnoreCase);
67
-
68
- if ($oParserState->comes('(')) {
69
- $oParserState->consume('(');
70
- $aArguments = Value::parseValue($oParserState, array('=', ' ', ','));
71
- $sResult = new CSSFunction($sResult, $aArguments, ',', $oParserState->currentLine());
72
- $oParserState->consume(')');
73
- }
74
-
75
- return $sResult;
76
- }
77
-
78
- public static function parsePrimitiveValue(ParserState $oParserState) {
79
- $oValue = null;
80
- $oParserState->consumeWhiteSpace();
81
- if (is_numeric($oParserState->peek()) || ($oParserState->comes('-.') && is_numeric($oParserState->peek(1, 2))) || (($oParserState->comes('-') || $oParserState->comes('.')) && is_numeric($oParserState->peek(1, 1)))) {
82
- $oValue = Size::parse($oParserState);
83
- } else if ($oParserState->comes('#') || $oParserState->comes('rgb', true) || $oParserState->comes('hsl', true)) {
84
- $oValue = Color::parse($oParserState);
85
- } else if ($oParserState->comes('url', true)) {
86
- $oValue = URL::parse($oParserState);
87
- } else if ($oParserState->comes('calc', true) || $oParserState->comes('-webkit-calc', true) || $oParserState->comes('-moz-calc', true)) {
88
- $oValue = CalcFunction::parse($oParserState);
89
- } else if ($oParserState->comes("'") || $oParserState->comes('"')) {
90
- $oValue = CSSString::parse($oParserState);
91
- } else if ($oParserState->comes("progid:") && $oParserState->getSettings()->bLenientParsing) {
92
- $oValue = self::parseMicrosoftFilter($oParserState);
93
- } else if ($oParserState->comes("[")) {
94
- $oValue = LineName::parse($oParserState);
95
- } else if ($oParserState->comes("U+")) {
96
- $oValue = self::parseUnicodeRangeValue($oParserState);
97
- } else {
98
- $oValue = self::parseIdentifierOrFunction($oParserState);
99
- }
100
- $oParserState->consumeWhiteSpace();
101
- return $oValue;
102
- }
103
-
104
- private static function parseMicrosoftFilter(ParserState $oParserState) {
105
- $sFunction = $oParserState->consumeUntil('(', false, true);
106
- $aArguments = Value::parseValue($oParserState, array(',', '='));
107
- return new CSSFunction($sFunction, $aArguments, ',', $oParserState->currentLine());
108
- }
109
-
110
- private static function parseUnicodeRangeValue(ParserState $oParserState) {
111
- $iCodepointMaxLenth = 6; // Code points outside BMP can use up to six digits
112
- $sRange = "";
113
- $oParserState->consume("U+");
114
- do {
115
- if ($oParserState->comes('-')) $iCodepointMaxLenth = 13; // Max length is 2 six digit code points + the dash(-) between them
116
- $sRange .= $oParserState->consume(1);
117
- } while (strlen($sRange) < $iCodepointMaxLenth && preg_match("/[A-Fa-f0-9\?-]/", $oParserState->peek()));
118
- return "U+{$sRange}";
119
- }
120
-
121
- /**
122
- * @return int
123
- */
124
- public function getLineNo() {
125
- return $this->iLineNo;
126
- }
127
-
128
- //Methods are commented out because re-declaring them here is a fatal error in PHP < 5.3.9
129
- //public abstract function __toString();
130
- //public abstract function render(\Sabberworm\CSS\OutputFormat $oOutputFormat);
131
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/ValueList.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\Value;
4
-
5
- abstract class ValueList extends Value {
6
-
7
- protected $aComponents;
8
- protected $sSeparator;
9
-
10
- public function __construct($aComponents = array(), $sSeparator = ',', $iLineNo = 0) {
11
- parent::__construct($iLineNo);
12
- if (!is_array($aComponents)) {
13
- $aComponents = array($aComponents);
14
- }
15
- $this->aComponents = $aComponents;
16
- $this->sSeparator = $sSeparator;
17
- }
18
-
19
- public function addListComponent($mComponent) {
20
- $this->aComponents[] = $mComponent;
21
- }
22
-
23
- public function getListComponents() {
24
- return $this->aComponents;
25
- }
26
-
27
- public function setListComponents($aComponents) {
28
- $this->aComponents = $aComponents;
29
- }
30
-
31
- public function getListSeparator() {
32
- return $this->sSeparator;
33
- }
34
-
35
- public function setListSeparator($sSeparator) {
36
- $this->sSeparator = $sSeparator;
37
- }
38
-
39
- public function __toString() {
40
- return $this->render(new \Sabberworm\CSS\OutputFormat());
41
- }
42
-
43
- public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
44
- return $oOutputFormat->implode($oOutputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator . $oOutputFormat->spaceAfterListArgumentSeparator($this->sSeparator), $this->aComponents);
45
- }
46
-
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/phpunit.xml DELETED
@@ -1,10 +0,0 @@
1
- <phpunit
2
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
- xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
4
- bootstrap="tests/bootstrap.php">
5
- <testsuites>
6
- <testsuite name="Project Test Suite">
7
- <directory>tests</directory>
8
- </testsuite>
9
- </testsuites>
10
- </phpunit>
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/src/CSSList/AtRuleBlockList.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\CSSList;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+ use Sabberworm\CSS\Property\AtRule;
7
+
8
+ /**
9
+ * A `BlockList` constructed by an unknown at-rule. `@media` rules are rendered into `AtRuleBlockList` objects.
10
+ */
11
+ class AtRuleBlockList extends CSSBlockList implements AtRule
12
+ {
13
+ /**
14
+ * @var string
15
+ */
16
+ private $sType;
17
+
18
+ /**
19
+ * @var string
20
+ */
21
+ private $sArgs;
22
+
23
+ /**
24
+ * @param string $sType
25
+ * @param string $sArgs
26
+ * @param int $iLineNo
27
+ */
28
+ public function __construct($sType, $sArgs = '', $iLineNo = 0)
29
+ {
30
+ parent::__construct($iLineNo);
31
+ $this->sType = $sType;
32
+ $this->sArgs = $sArgs;
33
+ }
34
+
35
+ /**
36
+ * @return string
37
+ */
38
+ public function atRuleName()
39
+ {
40
+ return $this->sType;
41
+ }
42
+
43
+ /**
44
+ * @return string
45
+ */
46
+ public function atRuleArgs()
47
+ {
48
+ return $this->sArgs;
49
+ }
50
+
51
+ /**
52
+ * @return string
53
+ */
54
+ public function __toString()
55
+ {
56
+ return $this->render(new OutputFormat());
57
+ }
58
+
59
+ /**
60
+ * @return string
61
+ */
62
+ public function render(OutputFormat $oOutputFormat)
63
+ {
64
+ $sArgs = $this->sArgs;
65
+ if ($sArgs) {
66
+ $sArgs = ' ' . $sArgs;
67
+ }
68
+ $sResult = $oOutputFormat->sBeforeAtRuleBlock;
69
+ $sResult .= "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
70
+ $sResult .= parent::render($oOutputFormat);
71
+ $sResult .= '}';
72
+ $sResult .= $oOutputFormat->sAfterAtRuleBlock;
73
+ return $sResult;
74
+ }
75
+
76
+ /**
77
+ * @return bool
78
+ */
79
+ public function isRootList()
80
+ {
81
+ return false;
82
+ }
83
+ }
vendor/sabberworm/php-css-parser/src/CSSList/CSSBlockList.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\CSSList;
4
+
5
+ use Sabberworm\CSS\Property\Selector;
6
+ use Sabberworm\CSS\Rule\Rule;
7
+ use Sabberworm\CSS\RuleSet\DeclarationBlock;
8
+ use Sabberworm\CSS\RuleSet\RuleSet;
9
+ use Sabberworm\CSS\Value\CSSFunction;
10
+ use Sabberworm\CSS\Value\Value;
11
+ use Sabberworm\CSS\Value\ValueList;
12
+
13
+ /**
14
+ * A `CSSBlockList` is a `CSSList` whose `DeclarationBlock`s are guaranteed to contain valid declaration blocks or
15
+ * at-rules.
16
+ *
17
+ * Most `CSSList`s conform to this category but some at-rules (such as `@keyframes`) do not.
18
+ */
19
+ abstract class CSSBlockList extends CSSList
20
+ {
21
+ /**
22
+ * @param int $iLineNo
23
+ */
24
+ public function __construct($iLineNo = 0)
25
+ {
26
+ parent::__construct($iLineNo);
27
+ }
28
+
29
+ /**
30
+ * @param array<int, DeclarationBlock> $aResult
31
+ *
32
+ * @return void
33
+ */
34
+ protected function allDeclarationBlocks(array &$aResult)
35
+ {
36
+ foreach ($this->aContents as $mContent) {
37
+ if ($mContent instanceof DeclarationBlock) {
38
+ $aResult[] = $mContent;
39
+ } elseif ($mContent instanceof CSSBlockList) {
40
+ $mContent->allDeclarationBlocks($aResult);
41
+ }
42
+ }
43
+ }
44
+
45
+ /**
46
+ * @param array<int, RuleSet> $aResult
47
+ *
48
+ * @return void
49
+ */
50
+ protected function allRuleSets(array &$aResult)
51
+ {
52
+ foreach ($this->aContents as $mContent) {
53
+ if ($mContent instanceof RuleSet) {
54
+ $aResult[] = $mContent;
55
+ } elseif ($mContent instanceof CSSBlockList) {
56
+ $mContent->allRuleSets($aResult);
57
+ }
58
+ }
59
+ }
60
+
61
+ /**
62
+ * @param CSSList|Rule|RuleSet|Value $oElement
63
+ * @param array<int, Value> $aResult
64
+ * @param string|null $sSearchString
65
+ * @param bool $bSearchInFunctionArguments
66
+ *
67
+ * @return void
68
+ */
69
+ protected function allValues($oElement, array &$aResult, $sSearchString = null, $bSearchInFunctionArguments = false)
70
+ {
71
+ if ($oElement instanceof CSSBlockList) {
72
+ foreach ($oElement->getContents() as $oContent) {
73
+ $this->allValues($oContent, $aResult, $sSearchString, $bSearchInFunctionArguments);
74
+ }
75
+ } elseif ($oElement instanceof RuleSet) {
76
+ foreach ($oElement->getRules($sSearchString) as $oRule) {
77
+ $this->allValues($oRule, $aResult, $sSearchString, $bSearchInFunctionArguments);
78
+ }
79
+ } elseif ($oElement instanceof Rule) {
80
+ $this->allValues($oElement->getValue(), $aResult, $sSearchString, $bSearchInFunctionArguments);
81
+ } elseif ($oElement instanceof ValueList) {
82
+ if ($bSearchInFunctionArguments || !($oElement instanceof CSSFunction)) {
83
+ foreach ($oElement->getListComponents() as $mComponent) {
84
+ $this->allValues($mComponent, $aResult, $sSearchString, $bSearchInFunctionArguments);
85
+ }
86
+ }
87
+ } else {
88
+ // Non-List `Value` or `CSSString` (CSS identifier)
89
+ $aResult[] = $oElement;
90
+ }
91
+ }
92
+
93
+ /**
94
+ * @param array<int, Selector> $aResult
95
+ * @param string|null $sSpecificitySearch
96
+ *
97
+ * @return void
98
+ */
99
+ protected function allSelectors(array &$aResult, $sSpecificitySearch = null)
100
+ {
101
+ /** @var array<int, DeclarationBlock> $aDeclarationBlocks */
102
+ $aDeclarationBlocks = [];
103
+ $this->allDeclarationBlocks($aDeclarationBlocks);
104
+ foreach ($aDeclarationBlocks as $oBlock) {
105
+ foreach ($oBlock->getSelectors() as $oSelector) {
106
+ if ($sSpecificitySearch === null) {
107
+ $aResult[] = $oSelector;
108
+ } else {
109
+ $sComparator = '===';
110
+ $aSpecificitySearch = explode(' ', $sSpecificitySearch);
111
+ $iTargetSpecificity = $aSpecificitySearch[0];
112
+ if (count($aSpecificitySearch) > 1) {
113
+ $sComparator = $aSpecificitySearch[0];
114
+ $iTargetSpecificity = $aSpecificitySearch[1];
115
+ }
116
+ $iTargetSpecificity = (int)$iTargetSpecificity;
117
+ $iSelectorSpecificity = $oSelector->getSpecificity();
118
+ $bMatches = false;
119
+ switch ($sComparator) {
120
+ case '<=':
121
+ $bMatches = $iSelectorSpecificity <= $iTargetSpecificity;
122
+ break;
123
+ case '<':
124
+ $bMatches = $iSelectorSpecificity < $iTargetSpecificity;
125
+ break;
126
+ case '>=':
127
+ $bMatches = $iSelectorSpecificity >= $iTargetSpecificity;
128
+ break;
129
+ case '>':
130
+ $bMatches = $iSelectorSpecificity > $iTargetSpecificity;
131
+ break;
132
+ default:
133
+ $bMatches = $iSelectorSpecificity === $iTargetSpecificity;
134
+ break;
135
+ }
136
+ if ($bMatches) {
137
+ $aResult[] = $oSelector;
138
+ }
139
+ }
140
+ }
141
+ }
142
+ }
143
+ }
vendor/sabberworm/php-css-parser/src/CSSList/CSSList.php ADDED
@@ -0,0 +1,479 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\CSSList;
4
+
5
+ use Sabberworm\CSS\Comment\Comment;
6
+ use Sabberworm\CSS\Comment\Commentable;
7
+ use Sabberworm\CSS\OutputFormat;
8
+ use Sabberworm\CSS\Parsing\ParserState;
9
+ use Sabberworm\CSS\Parsing\SourceException;
10
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
11
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
12
+ use Sabberworm\CSS\Property\AtRule;
13
+ use Sabberworm\CSS\Property\Charset;
14
+ use Sabberworm\CSS\Property\CSSNamespace;
15
+ use Sabberworm\CSS\Property\Import;
16
+ use Sabberworm\CSS\Property\Selector;
17
+ use Sabberworm\CSS\Renderable;
18
+ use Sabberworm\CSS\RuleSet\AtRuleSet;
19
+ use Sabberworm\CSS\RuleSet\DeclarationBlock;
20
+ use Sabberworm\CSS\RuleSet\RuleSet;
21
+ use Sabberworm\CSS\Settings;
22
+ use Sabberworm\CSS\Value\CSSString;
23
+ use Sabberworm\CSS\Value\URL;
24
+ use Sabberworm\CSS\Value\Value;
25
+
26
+ /**
27
+ * A `CSSList` is the most generic container available. Its contents include `RuleSet` as well as other `CSSList`
28
+ * objects.
29
+ *
30
+ * Also, it may contain `Import` and `Charset` objects stemming from at-rules.
31
+ */
32
+ abstract class CSSList implements Renderable, Commentable
33
+ {
34
+ /**
35
+ * @var array<array-key, Comment>
36
+ */
37
+ protected $aComments;
38
+
39
+ /**
40
+ * @var array<int, RuleSet|CSSList|Import|Charset>
41
+ */
42
+ protected $aContents;
43
+
44
+ /**
45
+ * @var int
46
+ */
47
+ protected $iLineNo;
48
+
49
+ /**
50
+ * @param int $iLineNo
51
+ */
52
+ public function __construct($iLineNo = 0)
53
+ {
54
+ $this->aComments = [];
55
+ $this->aContents = [];
56
+ $this->iLineNo = $iLineNo;
57
+ }
58
+
59
+ /**
60
+ * @return void
61
+ *
62
+ * @throws UnexpectedTokenException
63
+ * @throws SourceException
64
+ */
65
+ public static function parseList(ParserState $oParserState, CSSList $oList)
66
+ {
67
+ $bIsRoot = $oList instanceof Document;
68
+ if (is_string($oParserState)) {
69
+ $oParserState = new ParserState($oParserState, Settings::create());
70
+ }
71
+ $bLenientParsing = $oParserState->getSettings()->bLenientParsing;
72
+ while (!$oParserState->isEnd()) {
73
+ $comments = $oParserState->consumeWhiteSpace();
74
+ $oListItem = null;
75
+ if ($bLenientParsing) {
76
+ try {
77
+ $oListItem = self::parseListItem($oParserState, $oList);
78
+ } catch (UnexpectedTokenException $e) {
79
+ $oListItem = false;
80
+ }
81
+ } else {
82
+ $oListItem = self::parseListItem($oParserState, $oList);
83
+ }
84
+ if ($oListItem === null) {
85
+ // List parsing finished
86
+ return;
87
+ }
88
+ if ($oListItem) {
89
+ $oListItem->setComments($comments);
90
+ $oList->append($oListItem);
91
+ }
92
+ $oParserState->consumeWhiteSpace();
93
+ }
94
+ if (!$bIsRoot && !$bLenientParsing) {
95
+ throw new SourceException("Unexpected end of document", $oParserState->currentLine());
96
+ }
97
+ }
98
+
99
+ /**
100
+ * @return AtRuleBlockList|KeyFrame|Charset|CSSNamespace|Import|AtRuleSet|DeclarationBlock|null|false
101
+ *
102
+ * @throws SourceException
103
+ * @throws UnexpectedEOFException
104
+ * @throws UnexpectedTokenException
105
+ */
106
+ private static function parseListItem(ParserState $oParserState, CSSList $oList)
107
+ {
108
+ $bIsRoot = $oList instanceof Document;
109
+ if ($oParserState->comes('@')) {
110
+ $oAtRule = self::parseAtRule($oParserState);
111
+ if ($oAtRule instanceof Charset) {
112
+ if (!$bIsRoot) {
113
+ throw new UnexpectedTokenException(
114
+ '@charset may only occur in root document',
115
+ '',
116
+ 'custom',
117
+ $oParserState->currentLine()
118
+ );
119
+ }
120
+ if (count($oList->getContents()) > 0) {
121
+ throw new UnexpectedTokenException(
122
+ '@charset must be the first parseable token in a document',
123
+ '',
124
+ 'custom',
125
+ $oParserState->currentLine()
126
+ );
127
+ }
128
+ $oParserState->setCharset($oAtRule->getCharset()->getString());
129
+ }
130
+ return $oAtRule;
131
+ } elseif ($oParserState->comes('}')) {
132
+ if (!$oParserState->getSettings()->bLenientParsing) {
133
+ throw new UnexpectedTokenException('CSS selector', '}', 'identifier', $oParserState->currentLine());
134
+ } else {
135
+ if ($bIsRoot) {
136
+ if ($oParserState->getSettings()->bLenientParsing) {
137
+ return DeclarationBlock::parse($oParserState);
138
+ } else {
139
+ throw new SourceException("Unopened {", $oParserState->currentLine());
140
+ }
141
+ } else {
142
+ return null;
143
+ }
144
+ }
145
+ } else {
146
+ return DeclarationBlock::parse($oParserState, $oList);
147
+ }
148
+ }
149
+
150
+ /**
151
+ * @param ParserState $oParserState
152
+ *
153
+ * @return AtRuleBlockList|KeyFrame|Charset|CSSNamespace|Import|AtRuleSet|null
154
+ *
155
+ * @throws SourceException
156
+ * @throws UnexpectedTokenException
157
+ * @throws UnexpectedEOFException
158
+ */
159
+ private static function parseAtRule(ParserState $oParserState)
160
+ {
161
+ $oParserState->consume('@');
162
+ $sIdentifier = $oParserState->parseIdentifier();
163
+ $iIdentifierLineNum = $oParserState->currentLine();
164
+ $oParserState->consumeWhiteSpace();
165
+ if ($sIdentifier === 'import') {
166
+ $oLocation = URL::parse($oParserState);
167
+ $oParserState->consumeWhiteSpace();
168
+ $sMediaQuery = null;
169
+ if (!$oParserState->comes(';')) {
170
+ $sMediaQuery = trim($oParserState->consumeUntil([';', ParserState::EOF]));
171
+ }
172
+ $oParserState->consumeUntil([';', ParserState::EOF], true, true);
173
+ return new Import($oLocation, $sMediaQuery ?: null, $iIdentifierLineNum);
174
+ } elseif ($sIdentifier === 'charset') {
175
+ $sCharset = CSSString::parse($oParserState);
176
+ $oParserState->consumeWhiteSpace();
177
+ $oParserState->consumeUntil([';', ParserState::EOF], true, true);
178
+ return new Charset($sCharset, $iIdentifierLineNum);
179
+ } elseif (self::identifierIs($sIdentifier, 'keyframes')) {
180
+ $oResult = new KeyFrame($iIdentifierLineNum);
181
+ $oResult->setVendorKeyFrame($sIdentifier);
182
+ $oResult->setAnimationName(trim($oParserState->consumeUntil('{', false, true)));
183
+ CSSList::parseList($oParserState, $oResult);
184
+ if ($oParserState->comes('}')) {
185
+ $oParserState->consume('}');
186
+ }
187
+ return $oResult;
188
+ } elseif ($sIdentifier === 'namespace') {
189
+ $sPrefix = null;
190
+ $mUrl = Value::parsePrimitiveValue($oParserState);
191
+ if (!$oParserState->comes(';')) {
192
+ $sPrefix = $mUrl;
193
+ $mUrl = Value::parsePrimitiveValue($oParserState);
194
+ }
195
+ $oParserState->consumeUntil([';', ParserState::EOF], true, true);
196
+ if ($sPrefix !== null && !is_string($sPrefix)) {
197
+ throw new UnexpectedTokenException('Wrong namespace prefix', $sPrefix, 'custom', $iIdentifierLineNum);
198
+ }
199
+ if (!($mUrl instanceof CSSString || $mUrl instanceof URL)) {
200
+ throw new UnexpectedTokenException(
201
+ 'Wrong namespace url of invalid type',
202
+ $mUrl,
203
+ 'custom',
204
+ $iIdentifierLineNum
205
+ );
206
+ }
207
+ return new CSSNamespace($mUrl, $sPrefix, $iIdentifierLineNum);
208
+ } else {
209
+ // Unknown other at rule (font-face or such)
210
+ $sArgs = trim($oParserState->consumeUntil('{', false, true));
211
+ if (substr_count($sArgs, "(") != substr_count($sArgs, ")")) {
212
+ if ($oParserState->getSettings()->bLenientParsing) {
213
+ return null;
214
+ } else {
215
+ throw new SourceException("Unmatched brace count in media query", $oParserState->currentLine());
216
+ }
217
+ }
218
+ $bUseRuleSet = true;
219
+ foreach (explode('/', AtRule::BLOCK_RULES) as $sBlockRuleName) {
220
+ if (self::identifierIs($sIdentifier, $sBlockRuleName)) {
221
+ $bUseRuleSet = false;
222
+ break;
223
+ }
224
+ }
225
+ if ($bUseRuleSet) {
226
+ $oAtRule = new AtRuleSet($sIdentifier, $sArgs, $iIdentifierLineNum);
227
+ RuleSet::parseRuleSet($oParserState, $oAtRule);
228
+ } else {
229
+ $oAtRule = new AtRuleBlockList($sIdentifier, $sArgs, $iIdentifierLineNum);
230
+ CSSList::parseList($oParserState, $oAtRule);
231
+ if ($oParserState->comes('}')) {
232
+ $oParserState->consume('}');
233
+ }
234
+ }
235
+ return $oAtRule;
236
+ }
237
+ }
238
+
239
+ /**
240
+ * Tests an identifier for a given value. Since identifiers are all keywords, they can be vendor-prefixed.
241
+ * We need to check for these versions too.
242
+ *
243
+ * @param string $sIdentifier
244
+ * @param string $sMatch
245
+ *
246
+ * @return bool
247
+ */
248
+ private static function identifierIs($sIdentifier, $sMatch)
249
+ {
250
+ return (strcasecmp($sIdentifier, $sMatch) === 0)
251
+ ?: preg_match("/^(-\\w+-)?$sMatch$/i", $sIdentifier) === 1;
252
+ }
253
+
254
+ /**
255
+ * @return int
256
+ */
257
+ public function getLineNo()
258
+ {
259
+ return $this->iLineNo;
260
+ }
261
+
262
+ /**
263
+ * Prepends an item to the list of contents.
264
+ *
265
+ * @param RuleSet|CSSList|Import|Charset $oItem
266
+ *
267
+ * @return void
268
+ */
269
+ public function prepend($oItem)
270
+ {
271
+ array_unshift($this->aContents, $oItem);
272
+ }
273
+
274
+ /**
275
+ * Appends an item to tje list of contents.
276
+ *
277
+ * @param RuleSet|CSSList|Import|Charset $oItem
278
+ *
279
+ * @return void
280
+ */
281
+ public function append($oItem)
282
+ {
283
+ $this->aContents[] = $oItem;
284
+ }
285
+
286
+ /**
287
+ * Splices the list of contents.
288
+ *
289
+ * @param int $iOffset
290
+ * @param int $iLength
291
+ * @param array<int, RuleSet|CSSList|Import|Charset> $mReplacement
292
+ *
293
+ * @return void
294
+ */
295
+ public function splice($iOffset, $iLength = null, $mReplacement = null)
296
+ {
297
+ array_splice($this->aContents, $iOffset, $iLength, $mReplacement);
298
+ }
299
+
300
+ /**
301
+ * Removes an item from the CSS list.
302
+ *
303
+ * @param RuleSet|Import|Charset|CSSList $oItemToRemove
304
+ * May be a RuleSet (most likely a DeclarationBlock), a Import,
305
+ * a Charset or another CSSList (most likely a MediaQuery)
306
+ *
307
+ * @return bool whether the item was removed
308
+ */
309
+ public function remove($oItemToRemove)
310
+ {
311
+ $iKey = array_search($oItemToRemove, $this->aContents, true);
312
+ if ($iKey !== false) {
313
+ unset($this->aContents[$iKey]);
314
+ return true;
315
+ }
316
+ return false;
317
+ }
318
+
319
+ /**
320
+ * Replaces an item from the CSS list.
321
+ *
322
+ * @param RuleSet|Import|Charset|CSSList $oOldItem
323
+ * May be a `RuleSet` (most likely a `DeclarationBlock`), an `Import`, a `Charset`
324
+ * or another `CSSList` (most likely a `MediaQuery`)
325
+ *
326
+ * @return bool
327
+ */
328
+ public function replace($oOldItem, $mNewItem)
329
+ {
330
+ $iKey = array_search($oOldItem, $this->aContents, true);
331
+ if ($iKey !== false) {
332
+ if (is_array($mNewItem)) {
333
+ array_splice($this->aContents, $iKey, 1, $mNewItem);
334
+ } else {
335
+ array_splice($this->aContents, $iKey, 1, [$mNewItem]);
336
+ }
337
+ return true;
338
+ }
339
+ return false;
340
+ }
341
+
342
+ /**
343
+ * @param array<int, RuleSet|Import|Charset|CSSList> $aContents
344
+ */
345
+ public function setContents(array $aContents)
346
+ {
347
+ $this->aContents = [];
348
+ foreach ($aContents as $content) {
349
+ $this->append($content);
350
+ }
351
+ }
352
+
353
+ /**
354
+ * Removes a declaration block from the CSS list if it matches all given selectors.
355
+ *
356
+ * @param DeclarationBlock|array<array-key, Selector>|string $mSelector the selectors to match
357
+ * @param bool $bRemoveAll whether to stop at the first declaration block found or remove all blocks
358
+ *
359
+ * @return void
360
+ */
361
+ public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false)
362
+ {
363
+ if ($mSelector instanceof DeclarationBlock) {
364
+ $mSelector = $mSelector->getSelectors();
365
+ }
366
+ if (!is_array($mSelector)) {
367
+ $mSelector = explode(',', $mSelector);
368
+ }
369
+ foreach ($mSelector as $iKey => &$mSel) {
370
+ if (!($mSel instanceof Selector)) {
371
+ if (!Selector::isValid($mSel)) {
372
+ throw new UnexpectedTokenException(
373
+ "Selector did not match '" . Selector::SELECTOR_VALIDATION_RX . "'.",
374
+ $mSel,
375
+ "custom"
376
+ );
377
+ }
378
+ $mSel = new Selector($mSel);
379
+ }
380
+ }
381
+ foreach ($this->aContents as $iKey => $mItem) {
382
+ if (!($mItem instanceof DeclarationBlock)) {
383
+ continue;
384
+ }
385
+ if ($mItem->getSelectors() == $mSelector) {
386
+ unset($this->aContents[$iKey]);
387
+ if (!$bRemoveAll) {
388
+ return;
389
+ }
390
+ }
391
+ }
392
+ }
393
+
394
+ /**
395
+ * @return string
396
+ */
397
+ public function __toString()
398
+ {
399
+ return $this->render(new OutputFormat());
400
+ }
401
+
402
+ /**
403
+ * @return string
404
+ */
405
+ public function render(OutputFormat $oOutputFormat)
406
+ {
407
+ $sResult = '';
408
+ $bIsFirst = true;
409
+ $oNextLevel = $oOutputFormat;
410
+ if (!$this->isRootList()) {
411
+ $oNextLevel = $oOutputFormat->nextLevel();
412
+ }
413
+ foreach ($this->aContents as $oContent) {
414
+ $sRendered = $oOutputFormat->safely(function () use ($oNextLevel, $oContent) {
415
+ return $oContent->render($oNextLevel);
416
+ });
417
+ if ($sRendered === null) {
418
+ continue;
419
+ }
420
+ if ($bIsFirst) {
421
+ $bIsFirst = false;
422
+ $sResult .= $oNextLevel->spaceBeforeBlocks();
423
+ } else {
424
+ $sResult .= $oNextLevel->spaceBetweenBlocks();
425
+ }
426
+ $sResult .= $sRendered;
427
+ }
428
+
429
+ if (!$bIsFirst) {
430
+ // Had some output
431
+ $sResult .= $oOutputFormat->spaceAfterBlocks();
432
+ }
433
+
434
+ return $sResult;
435
+ }
436
+
437
+ /**
438
+ * Return true if the list can not be further outdented. Only important when rendering.
439
+ *
440
+ * @return bool
441
+ */
442
+ abstract public function isRootList();
443
+
444
+ /**
445
+ * @return array<int, RuleSet|Import|Charset|CSSList>
446
+ */
447
+ public function getContents()
448
+ {
449
+ return $this->aContents;
450
+ }
451
+
452
+ /**
453
+ * @param array<array-key, Comment> $aComments
454
+ *
455
+ * @return void
456
+ */
457
+ public function addComments(array $aComments)
458
+ {
459
+ $this->aComments = array_merge($this->aComments, $aComments);
460
+ }
461
+
462
+ /**
463
+ * @return array<array-key, Comment>
464
+ */
465
+ public function getComments()
466
+ {
467
+ return $this->aComments;
468
+ }
469
+
470
+ /**
471
+ * @param array<array-key, Comment> $aComments
472
+ *
473
+ * @return void
474
+ */
475
+ public function setComments(array $aComments)
476
+ {
477
+ $this->aComments = $aComments;
478
+ }
479
+ }
vendor/sabberworm/php-css-parser/src/CSSList/Document.php ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\CSSList;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+ use Sabberworm\CSS\Parsing\ParserState;
7
+ use Sabberworm\CSS\Parsing\SourceException;
8
+ use Sabberworm\CSS\Property\Selector;
9
+ use Sabberworm\CSS\RuleSet\DeclarationBlock;
10
+ use Sabberworm\CSS\RuleSet\RuleSet;
11
+ use Sabberworm\CSS\Value\Value;
12
+
13
+ /**
14
+ * The root `CSSList` of a parsed file. Contains all top-level CSS contents, mostly declaration blocks,
15
+ * but also any at-rules encountered.
16
+ */
17
+ class Document extends CSSBlockList
18
+ {
19
+ /**
20
+ * @param int $iLineNo
21
+ */
22
+ public function __construct($iLineNo = 0)
23
+ {
24
+ parent::__construct($iLineNo);
25
+ }
26
+
27
+ /**
28
+ * @return Document
29
+ *
30
+ * @throws SourceException
31
+ */
32
+ public static function parse(ParserState $oParserState)
33
+ {
34
+ $oDocument = new Document($oParserState->currentLine());
35
+ CSSList::parseList($oParserState, $oDocument);
36
+ return $oDocument;
37
+ }
38
+
39
+ /**
40
+ * Gets all `DeclarationBlock` objects recursively.
41
+ *
42
+ * @return array<int, DeclarationBlock>
43
+ */
44
+ public function getAllDeclarationBlocks()
45
+ {
46
+ /** @var array<int, DeclarationBlock> $aResult */
47
+ $aResult = [];
48
+ $this->allDeclarationBlocks($aResult);
49
+ return $aResult;
50
+ }
51
+
52
+ /**
53
+ * Gets all `DeclarationBlock` objects recursively.
54
+ *
55
+ * @return array<int, DeclarationBlock>
56
+ *
57
+ * @deprecated will be removed in version 9.0; use `getAllDeclarationBlocks()` instead
58
+ */
59
+ public function getAllSelectors()
60
+ {
61
+ return $this->getAllDeclarationBlocks();
62
+ }
63
+
64
+ /**
65
+ * Returns all `RuleSet` objects found recursively in the tree.
66
+ *
67
+ * @return array<int, RuleSet>
68
+ */
69
+ public function getAllRuleSets()
70
+ {
71
+ /** @var array<int, RuleSet> $aResult */
72
+ $aResult = [];
73
+ $this->allRuleSets($aResult);
74
+ return $aResult;
75
+ }
76
+
77
+ /**
78
+ * Returns all `Value` objects found recursively in the tree.
79
+ *
80
+ * @param CSSList|RuleSet|string $mElement
81
+ * the `CSSList` or `RuleSet` to start the search from (defaults to the whole document).
82
+ * If a string is given, it is used as rule name filter.
83
+ * @param bool $bSearchInFunctionArguments whether to also return Value objects used as Function arguments.
84
+ *
85
+ * @return array<int, Value>
86
+ *
87
+ * @see RuleSet->getRules()
88
+ */
89
+ public function getAllValues($mElement = null, $bSearchInFunctionArguments = false)
90
+ {
91
+ $sSearchString = null;
92
+ if ($mElement === null) {
93
+ $mElement = $this;
94
+ } elseif (is_string($mElement)) {
95
+ $sSearchString = $mElement;
96
+ $mElement = $this;
97
+ }
98
+ /** @var array<int, Value> $aResult */
99
+ $aResult = [];
100
+ $this->allValues($mElement, $aResult, $sSearchString, $bSearchInFunctionArguments);
101
+ return $aResult;
102
+ }
103
+
104
+ /**
105
+ * Returns all `Selector` objects found recursively in the tree.
106
+ *
107
+ * Note that this does not yield the full `DeclarationBlock` that the selector belongs to
108
+ * (and, currently, there is no way to get to that).
109
+ *
110
+ * @param string|null $sSpecificitySearch
111
+ * An optional filter by specificity.
112
+ * May contain a comparison operator and a number or just a number (defaults to "==").
113
+ *
114
+ * @return array<int, Selector>
115
+ * @example `getSelectorsBySpecificity('>= 100')`
116
+ *
117
+ */
118
+ public function getSelectorsBySpecificity($sSpecificitySearch = null)
119
+ {
120
+ /** @var array<int, Selector> $aResult */
121
+ $aResult = [];
122
+ $this->allSelectors($aResult, $sSpecificitySearch);
123
+ return $aResult;
124
+ }
125
+
126
+ /**
127
+ * Expands all shorthand properties to their long value.
128
+ *
129
+ * @return void
130
+ */
131
+ public function expandShorthands()
132
+ {
133
+ foreach ($this->getAllDeclarationBlocks() as $oDeclaration) {
134
+ $oDeclaration->expandShorthands();
135
+ }
136
+ }
137
+
138
+ /**
139
+ * Create shorthands properties whenever possible.
140
+ *
141
+ * @return void
142
+ */
143
+ public function createShorthands()
144
+ {
145
+ foreach ($this->getAllDeclarationBlocks() as $oDeclaration) {
146
+ $oDeclaration->createShorthands();
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Overrides `render()` to make format argument optional.
152
+ *
153
+ * @param OutputFormat|null $oOutputFormat
154
+ *
155
+ * @return string
156
+ */
157
+ public function render(OutputFormat $oOutputFormat = null)
158
+ {
159
+ if ($oOutputFormat === null) {
160
+ $oOutputFormat = new OutputFormat();
161
+ }
162
+ return parent::render($oOutputFormat);
163
+ }
164
+
165
+ /**
166
+ * @return bool
167
+ */
168
+ public function isRootList()
169
+ {
170
+ return true;
171
+ }
172
+ }
vendor/sabberworm/php-css-parser/src/CSSList/KeyFrame.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\CSSList;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+ use Sabberworm\CSS\Property\AtRule;
7
+
8
+ class KeyFrame extends CSSList implements AtRule
9
+ {
10
+ /**
11
+ * @var string|null
12
+ */
13
+ private $vendorKeyFrame;
14
+
15
+ /**
16
+ * @var string|null
17
+ */
18
+ private $animationName;
19
+
20
+ /**
21
+ * @param int $iLineNo
22
+ */
23
+ public function __construct($iLineNo = 0)
24
+ {
25
+ parent::__construct($iLineNo);
26
+ $this->vendorKeyFrame = null;
27
+ $this->animationName = null;
28
+ }
29
+
30
+ /**
31
+ * @param string $vendorKeyFrame
32
+ */
33
+ public function setVendorKeyFrame($vendorKeyFrame)
34
+ {
35
+ $this->vendorKeyFrame = $vendorKeyFrame;
36
+ }
37
+
38
+ /**
39
+ * @return string|null
40
+ */
41
+ public function getVendorKeyFrame()
42
+ {
43
+ return $this->vendorKeyFrame;
44
+ }
45
+
46
+ /**
47
+ * @param string $animationName
48
+ */
49
+ public function setAnimationName($animationName)
50
+ {
51
+ $this->animationName = $animationName;
52
+ }
53
+
54
+ /**
55
+ * @return string|null
56
+ */
57
+ public function getAnimationName()
58
+ {
59
+ return $this->animationName;
60
+ }
61
+
62
+ /**
63
+ * @return string
64
+ */
65
+ public function __toString()
66
+ {
67
+ return $this->render(new OutputFormat());
68
+ }
69
+
70
+ /**
71
+ * @return string
72
+ */
73
+ public function render(OutputFormat $oOutputFormat)
74
+ {
75
+ $sResult = "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{";
76
+ $sResult .= parent::render($oOutputFormat);
77
+ $sResult .= '}';
78
+ return $sResult;
79
+ }
80
+
81
+ /**
82
+ * @return bool
83
+ */
84
+ public function isRootList()
85
+ {
86
+ return false;
87
+ }
88
+
89
+ /**
90
+ * @return string|null
91
+ */
92
+ public function atRuleName()
93
+ {
94
+ return $this->vendorKeyFrame;
95
+ }
96
+
97
+ /**
98
+ * @return string|null
99
+ */
100
+ public function atRuleArgs()
101
+ {
102
+ return $this->animationName;
103
+ }
104
+ }
vendor/sabberworm/php-css-parser/src/Comment/Comment.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Comment;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+ use Sabberworm\CSS\Renderable;
7
+
8
+ class Comment implements Renderable
9
+ {
10
+ /**
11
+ * @var int
12
+ */
13
+ protected $iLineNo;
14
+
15
+ /**
16
+ * @var string
17
+ */
18
+ protected $sComment;
19
+
20
+ /**
21
+ * @param string $sComment
22
+ * @param int $iLineNo
23
+ */
24
+ public function __construct($sComment = '', $iLineNo = 0)
25
+ {
26
+ $this->sComment = $sComment;
27
+ $this->iLineNo = $iLineNo;
28
+ }
29
+
30
+ /**
31
+ * @return string
32
+ */
33
+ public function getComment()
34
+ {
35
+ return $this->sComment;
36
+ }
37
+
38
+ /**
39
+ * @return int
40
+ */
41
+ public function getLineNo()
42
+ {
43
+ return $this->iLineNo;
44
+ }
45
+
46
+ /**
47
+ * @param string $sComment
48
+ *
49
+ * @return void
50
+ */
51
+ public function setComment($sComment)
52
+ {
53
+ $this->sComment = $sComment;
54
+ }
55
+
56
+ /**
57
+ * @return string
58
+ */
59
+ public function __toString()
60
+ {
61
+ return $this->render(new OutputFormat());
62
+ }
63
+
64
+ /**
65
+ * @return string
66
+ */
67
+ public function render(OutputFormat $oOutputFormat)
68
+ {
69
+ return '/*' . $this->sComment . '*/';
70
+ }
71
+ }
vendor/sabberworm/php-css-parser/src/Comment/Commentable.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Comment;
4
+
5
+ interface Commentable
6
+ {
7
+ /**
8
+ * @param array<array-key, Comment> $aComments
9
+ *
10
+ * @return void
11
+ */
12
+ public function addComments(array $aComments);
13
+
14
+ /**
15
+ * @return array<array-key, Comment>
16
+ */
17
+ public function getComments();
18
+
19
+ /**
20
+ * @param array<array-key, Comment> $aComments
21
+ *
22
+ * @return void
23
+ */
24
+ public function setComments(array $aComments);
25
+ }
vendor/sabberworm/php-css-parser/src/OutputFormat.php ADDED
@@ -0,0 +1,334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS;
4
+
5
+ /**
6
+ * Class OutputFormat
7
+ *
8
+ * @method OutputFormat setSemicolonAfterLastRule(bool $bSemicolonAfterLastRule) Set whether semicolons are added after
9
+ * last rule.
10
+ */
11
+ class OutputFormat
12
+ {
13
+ /**
14
+ * Value format: `"` means double-quote, `'` means single-quote
15
+ *
16
+ * @var string
17
+ */
18
+ public $sStringQuotingType = '"';
19
+
20
+ /**
21
+ * Output RGB colors in hash notation if possible
22
+ *
23
+ * @var string
24
+ */
25
+ public $bRGBHashNotation = true;
26
+
27
+ /**
28
+ * Declaration format
29
+ *
30
+ * Semicolon after the last rule of a declaration block can be omitted. To do that, set this false.
31
+ *
32
+ * @var bool
33
+ */
34
+ public $bSemicolonAfterLastRule = true;
35
+
36
+ /**
37
+ * Spacing
38
+ * Note that these strings are not sanity-checked: the value should only consist of whitespace
39
+ * Any newline character will be indented according to the current level.
40
+ * The triples (After, Before, Between) can be set using a wildcard (e.g. `$oFormat->set('Space*Rules', "\n");`)
41
+ */
42
+ public $sSpaceAfterRuleName = ' ';
43
+
44
+ /**
45
+ * @var string
46
+ */
47
+ public $sSpaceBeforeRules = '';
48
+
49
+ /**
50
+ * @var string
51
+ */
52
+ public $sSpaceAfterRules = '';
53
+
54
+ /**
55
+ * @var string
56
+ */
57
+ public $sSpaceBetweenRules = '';
58
+
59
+ /**
60
+ * @var string
61
+ */
62
+ public $sSpaceBeforeBlocks = '';
63
+
64
+ /**
65
+ * @var string
66
+ */
67
+ public $sSpaceAfterBlocks = '';
68
+
69
+ /**
70
+ * @var string
71
+ */
72
+ public $sSpaceBetweenBlocks = "\n";
73
+
74
+ /**
75
+ * Content injected in and around at-rule blocks.
76
+ *
77
+ * @var string
78
+ */
79
+ public $sBeforeAtRuleBlock = '';
80
+
81
+ /**
82
+ * @var string
83
+ */
84
+ public $sAfterAtRuleBlock = '';
85
+
86
+ /**
87
+ * This is what’s printed before and after the comma if a declaration block contains multiple selectors.
88
+ *
89
+ * @var string
90
+ */
91
+ public $sSpaceBeforeSelectorSeparator = '';
92
+
93
+ /**
94
+ * @var string
95
+ */
96
+ public $sSpaceAfterSelectorSeparator = ' ';
97
+
98
+ /**
99
+ * This is what’s printed after the comma of value lists
100
+ *
101
+ * @var string
102
+ */
103
+ public $sSpaceBeforeListArgumentSeparator = '';
104
+
105
+ /**
106
+ * @var string
107
+ */
108
+ public $sSpaceAfterListArgumentSeparator = '';
109
+
110
+ /**
111
+ * @var string
112
+ */
113
+ public $sSpaceBeforeOpeningBrace = ' ';
114
+
115
+ /**
116
+ * Content injected in and around declaration blocks.
117
+ *
118
+ * @var string
119
+ */
120
+ public $sBeforeDeclarationBlock = '';
121
+
122
+ /**
123
+ * @var string
124
+ */
125
+ public $sAfterDeclarationBlockSelectors = '';
126
+
127
+ /**
128
+ * @var string
129
+ */
130
+ public $sAfterDeclarationBlock = '';
131
+
132
+ /**
133
+ * Indentation character(s) per level. Only applicable if newlines are used in any of the spacing settings.
134
+ *
135
+ * @var string
136
+ */
137
+ public $sIndentation = "\t";
138
+
139
+ /**
140
+ * Output exceptions.
141
+ *
142
+ * @var bool
143
+ */
144
+ public $bIgnoreExceptions = false;
145
+
146
+ /**
147
+ * @var OutputFormatter|null
148
+ */
149
+ private $oFormatter = null;
150
+
151
+ /**
152
+ * @var OutputFormat|null
153
+ */
154
+ private $oNextLevelFormat = null;
155
+
156
+ /**
157
+ * @var int
158
+ */
159
+ private $iIndentationLevel = 0;
160
+
161
+ public function __construct()
162
+ {
163
+ }
164
+
165
+ /**
166
+ * @param string $sName
167
+ *
168
+ * @return string|null
169
+ */
170
+ public function get($sName)
171
+ {
172
+ $aVarPrefixes = ['a', 's', 'm', 'b', 'f', 'o', 'c', 'i'];
173
+ foreach ($aVarPrefixes as $sPrefix) {
174
+ $sFieldName = $sPrefix . ucfirst($sName);
175
+ if (isset($this->$sFieldName)) {
176
+ return $this->$sFieldName;
177
+ }
178
+ }
179
+ return null;
180
+ }
181
+
182
+ /**
183
+ * @param array<array-key, string>|string $aNames
184
+ * @param mixed $mValue
185
+ *
186
+ * @return self|false
187
+ */
188
+ public function set($aNames, $mValue)
189
+ {
190
+ $aVarPrefixes = ['a', 's', 'm', 'b', 'f', 'o', 'c', 'i'];
191
+ if (is_string($aNames) && strpos($aNames, '*') !== false) {
192
+ $aNames =
193
+ [
194
+ str_replace('*', 'Before', $aNames),
195
+ str_replace('*', 'Between', $aNames),
196
+ str_replace('*', 'After', $aNames),
197
+ ];
198
+ } elseif (!is_array($aNames)) {
199
+ $aNames = [$aNames];
200
+ }
201
+ foreach ($aVarPrefixes as $sPrefix) {
202
+ $bDidReplace = false;
203
+ foreach ($aNames as $sName) {
204
+ $sFieldName = $sPrefix . ucfirst($sName);
205
+ if (isset($this->$sFieldName)) {
206
+ $this->$sFieldName = $mValue;
207
+ $bDidReplace = true;
208
+ }
209
+ }
210
+ if ($bDidReplace) {
211
+ return $this;
212
+ }
213
+ }
214
+ // Break the chain so the user knows this option is invalid
215
+ return false;
216
+ }
217
+
218
+ /**
219
+ * @param string $sMethodName
220
+ * @param array<array-key, mixed> $aArguments
221
+ *
222
+ * @return mixed
223
+ *
224
+ * @throws \Exception
225
+ */
226
+ public function __call($sMethodName, array $aArguments)
227
+ {
228
+ if (strpos($sMethodName, 'set') === 0) {
229
+ return $this->set(substr($sMethodName, 3), $aArguments[0]);
230
+ } elseif (strpos($sMethodName, 'get') === 0) {
231
+ return $this->get(substr($sMethodName, 3));
232
+ } elseif (method_exists(OutputFormatter::class, $sMethodName)) {
233
+ return call_user_func_array([$this->getFormatter(), $sMethodName], $aArguments);
234
+ } else {
235
+ throw new \Exception('Unknown OutputFormat method called: ' . $sMethodName);
236
+ }
237
+ }
238
+
239
+ /**
240
+ * @param int $iNumber
241
+ *
242
+ * @return self
243
+ */
244
+ public function indentWithTabs($iNumber = 1)
245
+ {
246
+ return $this->setIndentation(str_repeat("\t", $iNumber));
247
+ }
248
+
249
+ /**
250
+ * @param int $iNumber
251
+ *
252
+ * @return self
253
+ */
254
+ public function indentWithSpaces($iNumber = 2)
255
+ {
256
+ return $this->setIndentation(str_repeat(" ", $iNumber));
257
+ }
258
+
259
+ /**
260
+ * @return OutputFormat
261
+ */
262
+ public function nextLevel()
263
+ {
264
+ if ($this->oNextLevelFormat === null) {
265
+ $this->oNextLevelFormat = clone $this;
266
+ $this->oNextLevelFormat->iIndentationLevel++;
267
+ $this->oNextLevelFormat->oFormatter = null;
268
+ }
269
+ return $this->oNextLevelFormat;
270
+ }
271
+
272
+ /**
273
+ * @return void
274
+ */
275
+ public function beLenient()
276
+ {
277
+ $this->bIgnoreExceptions = true;
278
+ }
279
+
280
+ /**
281
+ * @return OutputFormatter
282
+ */
283
+ public function getFormatter()
284
+ {
285
+ if ($this->oFormatter === null) {
286
+ $this->oFormatter = new OutputFormatter($this);
287
+ }
288
+ return $this->oFormatter;
289
+ }
290
+
291
+ /**
292
+ * @return int
293
+ */
294
+ public function level()
295
+ {
296
+ return $this->iIndentationLevel;
297
+ }
298
+
299
+ /**
300
+ * Creates an instance of this class without any particular formatting settings.
301
+ *
302
+ * @return self
303
+ */
304
+ public static function create()
305
+ {
306
+ return new OutputFormat();
307
+ }
308
+
309
+ /**
310
+ * Creates an instance of this class with a preset for compact formatting.
311
+ *
312
+ * @return self
313
+ */
314
+ public static function createCompact()
315
+ {
316
+ $format = self::create();
317
+ $format->set('Space*Rules', "")->set('Space*Blocks', "")->setSpaceAfterRuleName('')
318
+ ->setSpaceBeforeOpeningBrace('')->setSpaceAfterSelectorSeparator('');
319
+ return $format;
320
+ }
321
+
322
+ /**
323
+ * Creates an instance of this class with a preset for pretty formatting.
324
+ *
325
+ * @return self
326
+ */
327
+ public static function createPretty()
328
+ {
329
+ $format = self::create();
330
+ $format->set('Space*Rules', "\n")->set('Space*Blocks', "\n")
331
+ ->setSpaceBetweenBlocks("\n\n")->set('SpaceAfterListArgumentSeparator', ['default' => '', ',' => ' ']);
332
+ return $format;
333
+ }
334
+ }
vendor/sabberworm/php-css-parser/src/OutputFormatter.php ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS;
4
+
5
+ use Sabberworm\CSS\Parsing\OutputException;
6
+
7
+ class OutputFormatter
8
+ {
9
+ /**
10
+ * @var OutputFormat
11
+ */
12
+ private $oFormat;
13
+
14
+ public function __construct(OutputFormat $oFormat)
15
+ {
16
+ $this->oFormat = $oFormat;
17
+ }
18
+
19
+ /**
20
+ * @param string $sName
21
+ * @param string|null $sType
22
+ *
23
+ * @return string
24
+ */
25
+ public function space($sName, $sType = null)
26
+ {
27
+ $sSpaceString = $this->oFormat->get("Space$sName");
28
+ // If $sSpaceString is an array, we have multiple values configured
29
+ // depending on the type of object the space applies to
30
+ if (is_array($sSpaceString)) {
31
+ if ($sType !== null && isset($sSpaceString[$sType])) {
32
+ $sSpaceString = $sSpaceString[$sType];
33
+ } else {
34
+ $sSpaceString = reset($sSpaceString);
35
+ }
36
+ }
37
+ return $this->prepareSpace($sSpaceString);
38
+ }
39
+
40
+ /**
41
+ * @return string
42
+ */
43
+ public function spaceAfterRuleName()
44
+ {
45
+ return $this->space('AfterRuleName');
46
+ }
47
+
48
+ /**
49
+ * @return string
50
+ */
51
+ public function spaceBeforeRules()
52
+ {
53
+ return $this->space('BeforeRules');
54
+ }
55
+
56
+ /**
57
+ * @return string
58
+ */
59
+ public function spaceAfterRules()
60
+ {
61
+ return $this->space('AfterRules');
62
+ }
63
+
64
+ /**
65
+ * @return string
66
+ */
67
+ public function spaceBetweenRules()
68
+ {
69
+ return $this->space('BetweenRules');
70
+ }
71
+
72
+ /**
73
+ * @return string
74
+ */
75
+ public function spaceBeforeBlocks()
76
+ {
77
+ return $this->space('BeforeBlocks');
78
+ }
79
+
80
+ /**
81
+ * @return string
82
+ */
83
+ public function spaceAfterBlocks()
84
+ {
85
+ return $this->space('AfterBlocks');
86
+ }
87
+
88
+ /**
89
+ * @return string
90
+ */
91
+ public function spaceBetweenBlocks()
92
+ {
93
+ return $this->space('BetweenBlocks');
94
+ }
95
+
96
+ /**
97
+ * @return string
98
+ */
99
+ public function spaceBeforeSelectorSeparator()
100
+ {
101
+ return $this->space('BeforeSelectorSeparator');
102
+ }
103
+
104
+ /**
105
+ * @return string
106
+ */
107
+ public function spaceAfterSelectorSeparator()
108
+ {
109
+ return $this->space('AfterSelectorSeparator');
110
+ }
111
+
112
+ /**
113
+ * @param string $sSeparator
114
+ *
115
+ * @return string
116
+ */
117
+ public function spaceBeforeListArgumentSeparator($sSeparator)
118
+ {
119
+ return $this->space('BeforeListArgumentSeparator', $sSeparator);
120
+ }
121
+
122
+ /**
123
+ * @param string $sSeparator
124
+ *
125
+ * @return string
126
+ */
127
+ public function spaceAfterListArgumentSeparator($sSeparator)
128
+ {
129
+ return $this->space('AfterListArgumentSeparator', $sSeparator);
130
+ }
131
+
132
+ /**
133
+ * @return string
134
+ */
135
+ public function spaceBeforeOpeningBrace()
136
+ {
137
+ return $this->space('BeforeOpeningBrace');
138
+ }
139
+
140
+ /**
141
+ * Runs the given code, either swallowing or passing exceptions, depending on the `bIgnoreExceptions` setting.
142
+ *
143
+ * @param string $cCode the name of the function to call
144
+ *
145
+ * @return string|null
146
+ */
147
+ public function safely($cCode)
148
+ {
149
+ if ($this->oFormat->get('IgnoreExceptions')) {
150
+ // If output exceptions are ignored, run the code with exception guards
151
+ try {
152
+ return $cCode();
153
+ } catch (OutputException $e) {
154
+ return null;
155
+ } // Do nothing
156
+ } else {
157
+ // Run the code as-is
158
+ return $cCode();
159
+ }
160
+ }
161
+
162
+ /**
163
+ * Clone of the `implode` function, but calls `render` with the current output format instead of `__toString()`.
164
+ *
165
+ * @param string $sSeparator
166
+ * @param array<array-key, Renderable|string> $aValues
167
+ * @param bool $bIncreaseLevel
168
+ *
169
+ * @return string
170
+ */
171
+ public function implode($sSeparator, array $aValues, $bIncreaseLevel = false)
172
+ {
173
+ $sResult = '';
174
+ $oFormat = $this->oFormat;
175
+ if ($bIncreaseLevel) {
176
+ $oFormat = $oFormat->nextLevel();
177
+ }
178
+ $bIsFirst = true;
179
+ foreach ($aValues as $mValue) {
180
+ if ($bIsFirst) {
181
+ $bIsFirst = false;
182
+ } else {
183
+ $sResult .= $sSeparator;
184
+ }
185
+ if ($mValue instanceof Renderable) {
186
+ $sResult .= $mValue->render($oFormat);
187
+ } else {
188
+ $sResult .= $mValue;
189
+ }
190
+ }
191
+ return $sResult;
192
+ }
193
+
194
+ /**
195
+ * @param string $sString
196
+ *
197
+ * @return string
198
+ */
199
+ public function removeLastSemicolon($sString)
200
+ {
201
+ if ($this->oFormat->get('SemicolonAfterLastRule')) {
202
+ return $sString;
203
+ }
204
+ $sString = explode(';', $sString);
205
+ if (count($sString) < 2) {
206
+ return $sString[0];
207
+ }
208
+ $sLast = array_pop($sString);
209
+ $sNextToLast = array_pop($sString);
210
+ array_push($sString, $sNextToLast . $sLast);
211
+ return implode(';', $sString);
212
+ }
213
+
214
+ /**
215
+ * @param string $sSpaceString
216
+ *
217
+ * @return string
218
+ */
219
+ private function prepareSpace($sSpaceString)
220
+ {
221
+ return str_replace("\n", "\n" . $this->indent(), $sSpaceString);
222
+ }
223
+
224
+ /**
225
+ * @return string
226
+ */
227
+ private function indent()
228
+ {
229
+ return str_repeat($this->oFormat->sIndentation, $this->oFormat->level());
230
+ }
231
+ }
vendor/sabberworm/php-css-parser/src/Parser.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS;
4
+
5
+ use Sabberworm\CSS\CSSList\Document;
6
+ use Sabberworm\CSS\Parsing\ParserState;
7
+ use Sabberworm\CSS\Parsing\SourceException;
8
+
9
+ /**
10
+ * This class parses CSS from text into a data structure.
11
+ */
12
+ class Parser
13
+ {
14
+ /**
15
+ * @var ParserState
16
+ */
17
+ private $oParserState;
18
+
19
+ /**
20
+ * @param string $sText
21
+ * @param Settings|null $oParserSettings
22
+ * @param int $iLineNo the line number (starting from 1, not from 0)
23
+ */
24
+ public function __construct($sText, Settings $oParserSettings = null, $iLineNo = 1)
25
+ {
26
+ if ($oParserSettings === null) {
27
+ $oParserSettings = Settings::create();
28
+ }
29
+ $this->oParserState = new ParserState($sText, $oParserSettings, $iLineNo);
30
+ }
31
+
32
+ /**
33
+ * @param string $sCharset
34
+ *
35
+ * @return void
36
+ */
37
+ public function setCharset($sCharset)
38
+ {
39
+ $this->oParserState->setCharset($sCharset);
40
+ }
41
+
42
+ /**
43
+ * @return void
44
+ */
45
+ public function getCharset()
46
+ {
47
+ // Note: The `return` statement is missing here. This is a bug that needs to be fixed.
48
+ $this->oParserState->getCharset();
49
+ }
50
+
51
+ /**
52
+ * @return Document
53
+ *
54
+ * @throws SourceException
55
+ */
56
+ public function parse()
57
+ {
58
+ return Document::parse($this->oParserState);
59
+ }
60
+ }
vendor/sabberworm/php-css-parser/src/Parsing/OutputException.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Parsing;
4
+
5
+ /**
6
+ * Thrown if the CSS parser attempts to print something invalid.
7
+ */
8
+ class OutputException extends SourceException
9
+ {
10
+ /**
11
+ * @param string $sMessage
12
+ * @param int $iLineNo
13
+ */
14
+ public function __construct($sMessage, $iLineNo = 0)
15
+ {
16
+ parent::__construct($sMessage, $iLineNo);
17
+ }
18
+ }
vendor/sabberworm/php-css-parser/src/Parsing/ParserState.php ADDED
@@ -0,0 +1,516 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Parsing;
4
+
5
+ use Sabberworm\CSS\Comment\Comment;
6
+ use Sabberworm\CSS\Settings;
7
+
8
+ class ParserState
9
+ {
10
+ /**
11
+ * @var null
12
+ */
13
+ const EOF = null;
14
+
15
+ /**
16
+ * @var Settings
17
+ */
18
+ private $oParserSettings;
19
+
20
+ /**
21
+ * @var string
22
+ */
23
+ private $sText;
24
+
25
+ /**
26
+ * @var array<int, string>
27
+ */
28
+ private $aText;
29
+
30
+ /**
31
+ * @var int
32
+ */
33
+ private $iCurrentPosition;
34
+
35
+ /**
36
+ * @var string
37
+ */
38
+ private $sCharset;
39
+
40
+ /**
41
+ * @var int
42
+ */
43
+ private $iLength;
44
+
45
+ /**
46
+ * @var int
47
+ */
48
+ private $iLineNo;
49
+
50
+ /**
51
+ * @param string $sText
52
+ * @param int $iLineNo
53
+ */
54
+ public function __construct($sText, Settings $oParserSettings, $iLineNo = 1)
55
+ {
56
+ $this->oParserSettings = $oParserSettings;
57
+ $this->sText = $sText;
58
+ $this->iCurrentPosition = 0;
59
+ $this->iLineNo = $iLineNo;
60
+ $this->setCharset($this->oParserSettings->sDefaultCharset);
61
+ }
62
+
63
+ /**
64
+ * @param string $sCharset
65
+ *
66
+ * @return void
67
+ */
68
+ public function setCharset($sCharset)
69
+ {
70
+ $this->sCharset = $sCharset;
71
+ $this->aText = $this->strsplit($this->sText);
72
+ if (is_array($this->aText)) {
73
+ $this->iLength = count($this->aText);
74
+ }
75
+ }
76
+
77
+ /**
78
+ * @return string
79
+ */
80
+ public function getCharset()
81
+ {
82
+ return $this->sCharset;
83
+ }
84
+
85
+ /**
86
+ * @return int
87
+ */
88
+ public function currentLine()
89
+ {
90
+ return $this->iLineNo;
91
+ }
92
+
93
+ /**
94
+ * @return int
95
+ */
96
+ public function currentColumn()
97
+ {
98
+ return $this->iCurrentPosition;
99
+ }
100
+
101
+ /**
102
+ * @return Settings
103
+ */
104
+ public function getSettings()
105
+ {
106
+ return $this->oParserSettings;
107
+ }
108
+
109
+ /**
110
+ * @param bool $bIgnoreCase
111
+ *
112
+ * @return string
113
+ *
114
+ * @throws UnexpectedTokenException
115
+ */
116
+ public function parseIdentifier($bIgnoreCase = true)
117
+ {
118
+ $sResult = $this->parseCharacter(true);
119
+ if ($sResult === null) {
120
+ throw new UnexpectedTokenException($sResult, $this->peek(5), 'identifier', $this->iLineNo);
121
+ }
122
+ $sCharacter = null;
123
+ while (($sCharacter = $this->parseCharacter(true)) !== null) {
124
+ if (preg_match('/[a-zA-Z0-9\x{00A0}-\x{FFFF}_-]/Sux', $sCharacter)) {
125
+ $sResult .= $sCharacter;
126
+ } else {
127
+ $sResult .= '\\' . $sCharacter;
128
+ }
129
+ }
130
+ if ($bIgnoreCase) {
131
+ $sResult = $this->strtolower($sResult);
132
+ }
133
+ return $sResult;
134
+ }
135
+
136
+ /**
137
+ * @param bool $bIsForIdentifier
138
+ *
139
+ * @return string|null
140
+ *
141
+ * @throws UnexpectedEOFException
142
+ * @throws UnexpectedTokenException
143
+ */
144
+ public function parseCharacter($bIsForIdentifier)
145
+ {
146
+ if ($this->peek() === '\\') {
147
+ if (
148
+ $bIsForIdentifier && $this->oParserSettings->bLenientParsing
149
+ && ($this->comes('\0') || $this->comes('\9'))
150
+ ) {
151
+ // Non-strings can contain \0 or \9 which is an IE hack supported in lenient parsing.
152
+ return null;
153
+ }
154
+ $this->consume('\\');
155
+ if ($this->comes('\n') || $this->comes('\r')) {
156
+ return '';
157
+ }
158
+ if (preg_match('/[0-9a-fA-F]/Su', $this->peek()) === 0) {
159
+ return $this->consume(1);
160
+ }
161
+ $sUnicode = $this->consumeExpression('/^[0-9a-fA-F]{1,6}/u', 6);
162
+ if ($this->strlen($sUnicode) < 6) {
163
+ // Consume whitespace after incomplete unicode escape
164
+ if (preg_match('/\\s/isSu', $this->peek())) {
165
+ if ($this->comes('\r\n')) {
166
+ $this->consume(2);
167
+ } else {
168
+ $this->consume(1);
169
+ }
170
+ }
171
+ }
172
+ $iUnicode = intval($sUnicode, 16);
173
+ $sUtf32 = "";
174
+ for ($i = 0; $i < 4; ++$i) {
175
+ $sUtf32 .= chr($iUnicode & 0xff);
176
+ $iUnicode = $iUnicode >> 8;
177
+ }
178
+ return iconv('utf-32le', $this->sCharset, $sUtf32);
179
+ }
180
+ if ($bIsForIdentifier) {
181
+ $peek = ord($this->peek());
182
+ // Ranges: a-z A-Z 0-9 - _
183
+ if (
184
+ ($peek >= 97 && $peek <= 122)
185
+ || ($peek >= 65 && $peek <= 90)
186
+ || ($peek >= 48 && $peek <= 57)
187
+ || ($peek === 45)
188
+ || ($peek === 95)
189
+ || ($peek > 0xa1)
190
+ ) {
191
+ return $this->consume(1);
192
+ }
193
+ } else {
194
+ return $this->consume(1);
195
+ }
196
+ return null;
197
+ }
198
+
199
+ /**
200
+ * @return array<int, Comment>|void
201
+ *
202
+ * @throws UnexpectedEOFException
203
+ * @throws UnexpectedTokenException
204
+ */
205
+ public function consumeWhiteSpace()
206
+ {
207
+ $comments = [];
208
+ do {
209
+ while (preg_match('/\\s/isSu', $this->peek()) === 1) {
210
+ $this->consume(1);
211
+ }
212
+ if ($this->oParserSettings->bLenientParsing) {
213
+ try {
214
+ $oComment = $this->consumeComment();
215
+ } catch (UnexpectedEOFException $e) {
216
+ $this->iCurrentPosition = $this->iLength;
217
+ return;
218
+ }
219
+ } else {
220
+ $oComment = $this->consumeComment();
221
+ }
222
+ if ($oComment !== false) {
223
+ $comments[] = $oComment;
224
+ }
225
+ } while ($oComment !== false);
226
+ return $comments;
227
+ }
228
+
229
+ /**
230
+ * @param string $sString
231
+ * @param bool $bCaseInsensitive
232
+ *
233
+ * @return bool
234
+ */
235
+ public function comes($sString, $bCaseInsensitive = false)
236
+ {
237
+ $sPeek = $this->peek(strlen($sString));
238
+ return ($sPeek == '')
239
+ ? false
240
+ : $this->streql($sPeek, $sString, $bCaseInsensitive);
241
+ }
242
+
243
+ /**
244
+ * @param int $iLength
245
+ * @param int $iOffset
246
+ *
247
+ * @return string
248
+ */
249
+ public function peek($iLength = 1, $iOffset = 0)
250
+ {
251
+ $iOffset += $this->iCurrentPosition;
252
+ if ($iOffset >= $this->iLength) {
253
+ return '';
254
+ }
255
+ return $this->substr($iOffset, $iLength);
256
+ }
257
+
258
+ /**
259
+ * @param int $mValue
260
+ *
261
+ * @return string
262
+ *
263
+ * @throws UnexpectedEOFException
264
+ * @throws UnexpectedTokenException
265
+ */
266
+ public function consume($mValue = 1)
267
+ {
268
+ if (is_string($mValue)) {
269
+ $iLineCount = substr_count($mValue, "\n");
270
+ $iLength = $this->strlen($mValue);
271
+ if (!$this->streql($this->substr($this->iCurrentPosition, $iLength), $mValue)) {
272
+ throw new UnexpectedTokenException($mValue, $this->peek(max($iLength, 5)), $this->iLineNo);
273
+ }
274
+ $this->iLineNo += $iLineCount;
275
+ $this->iCurrentPosition += $this->strlen($mValue);
276
+ return $mValue;
277
+ } else {
278
+ if ($this->iCurrentPosition + $mValue > $this->iLength) {
279
+ throw new UnexpectedEOFException($mValue, $this->peek(5), 'count', $this->iLineNo);
280
+ }
281
+ $sResult = $this->substr($this->iCurrentPosition, $mValue);
282
+ $iLineCount = substr_count($sResult, "\n");
283
+ $this->iLineNo += $iLineCount;
284
+ $this->iCurrentPosition += $mValue;
285
+ return $sResult;
286
+ }
287
+ }
288
+
289
+ /**
290
+ * @param string $mExpression
291
+ * @param int|null $iMaxLength
292
+ *
293
+ * @return string
294
+ *
295
+ * @throws UnexpectedEOFException
296
+ * @throws UnexpectedTokenException
297
+ */
298
+ public function consumeExpression($mExpression, $iMaxLength = null)
299
+ {
300
+ $aMatches = null;
301
+ $sInput = $iMaxLength !== null ? $this->peek($iMaxLength) : $this->inputLeft();
302
+ if (preg_match($mExpression, $sInput, $aMatches, PREG_OFFSET_CAPTURE) === 1) {
303
+ return $this->consume($aMatches[0][0]);
304
+ }
305
+ throw new UnexpectedTokenException($mExpression, $this->peek(5), 'expression', $this->iLineNo);
306
+ }
307
+
308
+ /**
309
+ * @return Comment|false
310
+ */
311
+ public function consumeComment()
312
+ {
313
+ $mComment = false;
314
+ if ($this->comes('/*')) {
315
+ $iLineNo = $this->iLineNo;
316
+ $this->consume(1);
317
+ $mComment = '';
318
+ while (($char = $this->consume(1)) !== '') {
319
+ $mComment .= $char;
320
+ if ($this->comes('*/')) {
321
+ $this->consume(2);
322
+ break;
323
+ }
324
+ }
325
+ }
326
+
327
+ if ($mComment !== false) {
328
+ // We skip the * which was included in the comment.
329
+ return new Comment(substr($mComment, 1), $iLineNo);
330
+ }
331
+
332
+ return $mComment;
333
+ }
334
+
335
+ /**
336
+ * @return bool
337
+ */
338
+ public function isEnd()
339
+ {
340
+ return $this->iCurrentPosition >= $this->iLength;
341
+ }
342
+
343
+ /**
344
+ * @param array<array-key, string>|string $aEnd
345
+ * @param string $bIncludeEnd
346
+ * @param string $consumeEnd
347
+ * @param array<int, Comment> $comments
348
+ *
349
+ * @return string
350
+ *
351
+ * @throws UnexpectedEOFException
352
+ * @throws UnexpectedTokenException
353
+ */
354
+ public function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false, array &$comments = [])
355
+ {
356
+ $aEnd = is_array($aEnd) ? $aEnd : [$aEnd];
357
+ $out = '';
358
+ $start = $this->iCurrentPosition;
359
+
360
+ while (!$this->isEnd()) {
361
+ $char = $this->consume(1);
362
+ if (in_array($char, $aEnd)) {
363
+ if ($bIncludeEnd) {
364
+ $out .= $char;
365
+ } elseif (!$consumeEnd) {
366
+ $this->iCurrentPosition -= $this->strlen($char);
367
+ }
368
+ return $out;
369
+ }
370
+ $out .= $char;
371
+ if ($comment = $this->consumeComment()) {
372
+ $comments[] = $comment;
373
+ }
374
+ }
375
+
376
+ if (in_array(self::EOF, $aEnd)) {
377
+ return $out;
378
+ }
379
+
380
+ $this->iCurrentPosition = $start;
381
+ throw new UnexpectedEOFException(
382
+ 'One of ("' . implode('","', $aEnd) . '")',
383
+ $this->peek(5),
384
+ 'search',
385
+ $this->iLineNo
386
+ );
387
+ }
388
+
389
+ /**
390
+ * @return string
391
+ */
392
+ private function inputLeft()
393
+ {
394
+ return $this->substr($this->iCurrentPosition, -1);
395
+ }
396
+
397
+ /**
398
+ * @param string $sString1
399
+ * @param string $sString2
400
+ * @param bool $bCaseInsensitive
401
+ *
402
+ * @return bool
403
+ */
404
+ public function streql($sString1, $sString2, $bCaseInsensitive = true)
405
+ {
406
+ if ($bCaseInsensitive) {
407
+ return $this->strtolower($sString1) === $this->strtolower($sString2);
408
+ } else {
409
+ return $sString1 === $sString2;
410
+ }
411
+ }
412
+
413
+ /**
414
+ * @param int $iAmount
415
+ *
416
+ * @return void
417
+ */
418
+ public function backtrack($iAmount)
419
+ {
420
+ $this->iCurrentPosition -= $iAmount;
421
+ }
422
+
423
+ /**
424
+ * @param string $sString
425
+ *
426
+ * @return int
427
+ */
428
+ public function strlen($sString)
429
+ {
430
+ if ($this->oParserSettings->bMultibyteSupport) {
431
+ return mb_strlen($sString, $this->sCharset);
432
+ } else {
433
+ return strlen($sString);
434
+ }
435
+ }
436
+
437
+ /**
438
+ * @param int $iStart
439
+ * @param int $iLength
440
+ *
441
+ * @return string
442
+ */
443
+ private function substr($iStart, $iLength)
444
+ {
445
+ if ($iLength < 0) {
446
+ $iLength = $this->iLength - $iStart + $iLength;
447
+ }
448
+ if ($iStart + $iLength > $this->iLength) {
449
+ $iLength = $this->iLength - $iStart;
450
+ }
451
+ $sResult = '';
452
+ while ($iLength > 0) {
453
+ $sResult .= $this->aText[$iStart];
454
+ $iStart++;
455
+ $iLength--;
456
+ }
457
+ return $sResult;
458
+ }
459
+
460
+ /**
461
+ * @param string $sString
462
+ *
463
+ * @return string
464
+ */
465
+ private function strtolower($sString)
466
+ {
467
+ if ($this->oParserSettings->bMultibyteSupport) {
468
+ return mb_strtolower($sString, $this->sCharset);
469
+ } else {
470
+ return strtolower($sString);
471
+ }
472
+ }
473
+
474
+ /**
475
+ * @param string $sString
476
+ *
477
+ * @return array<int, string>
478
+ */
479
+ private function strsplit($sString)
480
+ {
481
+ if ($this->oParserSettings->bMultibyteSupport) {
482
+ if ($this->streql($this->sCharset, 'utf-8')) {
483
+ return preg_split('//u', $sString, -1, PREG_SPLIT_NO_EMPTY);
484
+ } else {
485
+ $iLength = mb_strlen($sString, $this->sCharset);
486
+ $aResult = [];
487
+ for ($i = 0; $i < $iLength; ++$i) {
488
+ $aResult[] = mb_substr($sString, $i, 1, $this->sCharset);
489
+ }
490
+ return $aResult;
491
+ }
492
+ } else {
493
+ if ($sString === '') {
494
+ return [];
495
+ } else {
496
+ return str_split($sString);
497
+ }
498
+ }
499
+ }
500
+
501
+ /**
502
+ * @param string $sString
503
+ * @param string $sNeedle
504
+ * @param int $iOffset
505
+ *
506
+ * @return int|false
507
+ */
508
+ private function strpos($sString, $sNeedle, $iOffset)
509
+ {
510
+ if ($this->oParserSettings->bMultibyteSupport) {
511
+ return mb_strpos($sString, $sNeedle, $iOffset, $this->sCharset);
512
+ } else {
513
+ return strpos($sString, $sNeedle, $iOffset);
514
+ }
515
+ }
516
+ }
vendor/sabberworm/php-css-parser/src/Parsing/SourceException.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Parsing;
4
+
5
+ class SourceException extends \Exception
6
+ {
7
+ /**
8
+ * @var int
9
+ */
10
+ private $iLineNo;
11
+
12
+ /**
13
+ * @param string $sMessage
14
+ * @param int $iLineNo
15
+ */
16
+ public function __construct($sMessage, $iLineNo = 0)
17
+ {
18
+ $this->iLineNo = $iLineNo;
19
+ if (!empty($iLineNo)) {
20
+ $sMessage .= " [line no: $iLineNo]";
21
+ }
22
+ parent::__construct($sMessage);
23
+ }
24
+
25
+ /**
26
+ * @return int
27
+ */
28
+ public function getLineNo()
29
+ {
30
+ return $this->iLineNo;
31
+ }
32
+ }
vendor/sabberworm/php-css-parser/src/Parsing/UnexpectedEOFException.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Parsing;
4
+
5
+ /**
6
+ * Thrown if the CSS parser encounters end of file it did not expect.
7
+ *
8
+ * Extends `UnexpectedTokenException` in order to preserve backwards compatibility.
9
+ */
10
+ class UnexpectedEOFException extends UnexpectedTokenException
11
+ {
12
+ }
vendor/sabberworm/php-css-parser/src/Parsing/UnexpectedTokenException.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Parsing;
4
+
5
+ /**
6
+ * Thrown if the CSS parser encounters a token it did not expect.
7
+ */
8
+ class UnexpectedTokenException extends SourceException
9
+ {
10
+ /**
11
+ * @var string
12
+ */
13
+ private $sExpected;
14
+
15
+ /**
16
+ * @var string
17
+ */
18
+ private $sFound;
19
+
20
+ /**
21
+ * Possible values: literal, identifier, count, expression, search
22
+ *
23
+ * @var string
24
+ */
25
+ private $sMatchType;
26
+
27
+ /**
28
+ * @param string $sExpected
29
+ * @param string $sFound
30
+ * @param string $sMatchType
31
+ * @param int $iLineNo
32
+ */
33
+ public function __construct($sExpected, $sFound, $sMatchType = 'literal', $iLineNo = 0)
34
+ {
35
+ $this->sExpected = $sExpected;
36
+ $this->sFound = $sFound;
37
+ $this->sMatchType = $sMatchType;
38
+ $sMessage = "Token “{$sExpected}” ({$sMatchType}) not found. Got “{$sFound}”.";
39
+ if ($this->sMatchType === 'search') {
40
+ $sMessage = "Search for “{$sExpected}” returned no results. Context: “{$sFound}”.";
41
+ } elseif ($this->sMatchType === 'count') {
42
+ $sMessage = "Next token was expected to have {$sExpected} chars. Context: “{$sFound}”.";
43
+ } elseif ($this->sMatchType === 'identifier') {
44
+ $sMessage = "Identifier expected. Got “{$sFound}”";
45
+ } elseif ($this->sMatchType === 'custom') {
46
+ $sMessage = trim("$sExpected $sFound");
47
+ }
48
+
49
+ parent::__construct($sMessage, $iLineNo);
50
+ }
51
+ }
vendor/sabberworm/php-css-parser/src/Property/AtRule.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Property;
4
+
5
+ use Sabberworm\CSS\Comment\Commentable;
6
+ use Sabberworm\CSS\Renderable;
7
+
8
+ interface AtRule extends Renderable, Commentable
9
+ {
10
+ /**
11
+ * Since there are more set rules than block rules,
12
+ * we’re whitelisting the block rules and have anything else be treated as a set rule.
13
+ *
14
+ * @var string
15
+ */
16
+ const BLOCK_RULES = 'media/document/supports/region-style/font-feature-values';
17
+
18
+ /**
19
+ * … and more font-specific ones (to be used inside font-feature-values)
20
+ *
21
+ * @var string
22
+ */
23
+ const SET_RULES = 'font-face/counter-style/page/swash/styleset/annotation';
24
+
25
+ /**
26
+ * @return string|null
27
+ */
28
+ public function atRuleName();
29
+
30
+ /**
31
+ * @return string|null
32
+ */
33
+ public function atRuleArgs();
34
+ }
vendor/sabberworm/php-css-parser/src/Property/CSSNamespace.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Property;
4
+
5
+ use Sabberworm\CSS\Comment\Comment;
6
+ use Sabberworm\CSS\OutputFormat;
7
+
8
+ /**
9
+ * `CSSNamespace` represents an `@namespace` rule.
10
+ */
11
+ class CSSNamespace implements AtRule
12
+ {
13
+ /**
14
+ * @var string
15
+ */
16
+ private $mUrl;
17
+
18
+ /**
19
+ * @var string
20
+ */
21
+ private $sPrefix;
22
+
23
+ /**
24
+ * @var int
25
+ */
26
+ private $iLineNo;
27
+
28
+ /**
29
+ * @var array<array-key, Comment>
30
+ */
31
+ protected $aComments;
32
+
33
+ /**
34
+ * @param string $mUrl
35
+ * @param string|null $sPrefix
36
+ * @param int $iLineNo
37
+ */
38
+ public function __construct($mUrl, $sPrefix = null, $iLineNo = 0)
39
+ {
40
+ $this->mUrl = $mUrl;
41
+ $this->sPrefix = $sPrefix;
42
+ $this->iLineNo = $iLineNo;
43
+ $this->aComments = [];
44
+ }
45
+
46
+ /**
47
+ * @return int
48
+ */
49
+ public function getLineNo()
50
+ {
51
+ return $this->iLineNo;
52
+ }
53
+
54
+ /**
55
+ * @return string
56
+ */
57
+ public function __toString()
58
+ {
59
+ return $this->render(new OutputFormat());
60
+ }
61
+
62
+ /**
63
+ * @return string
64
+ */
65
+ public function render(OutputFormat $oOutputFormat)
66
+ {
67
+ return '@namespace ' . ($this->sPrefix === null ? '' : $this->sPrefix . ' ')
68
+ . $this->mUrl->render($oOutputFormat) . ';';
69
+ }
70
+
71
+ /**
72
+ * @return string
73
+ */
74
+ public function getUrl()
75
+ {
76
+ return $this->mUrl;
77
+ }
78
+
79
+ /**
80
+ * @return string|null
81
+ */
82
+ public function getPrefix()
83
+ {
84
+ return $this->sPrefix;
85
+ }
86
+
87
+ /**
88
+ * @param string $mUrl
89
+ *
90
+ * @return void
91
+ */
92
+ public function setUrl($mUrl)
93
+ {
94
+ $this->mUrl = $mUrl;
95
+ }
96
+
97
+ /**
98
+ * @param string $sPrefix
99
+ *
100
+ * @return void
101
+ */
102
+ public function setPrefix($sPrefix)
103
+ {
104
+ $this->sPrefix = $sPrefix;
105
+ }
106
+
107
+ /**
108
+ * @return string
109
+ */
110
+ public function atRuleName()
111
+ {
112
+ return 'namespace';
113
+ }
114
+
115
+ /**
116
+ * @return array<int, string>
117
+ */
118
+ public function atRuleArgs()
119
+ {
120
+ $aResult = [$this->mUrl];
121
+ if ($this->sPrefix) {
122
+ array_unshift($aResult, $this->sPrefix);
123
+ }
124
+ return $aResult;
125
+ }
126
+
127
+ /**
128
+ * @param array<array-key, Comment> $aComments
129
+ *
130
+ * @return void
131
+ */
132
+ public function addComments(array $aComments)
133
+ {
134
+ $this->aComments = array_merge($this->aComments, $aComments);
135
+ }
136
+
137
+ /**
138
+ * @return array<array-key, Comment>
139
+ */
140
+ public function getComments()
141
+ {
142
+ return $this->aComments;
143
+ }
144
+
145
+ /**
146
+ * @param array<array-key, Comment> $aComments
147
+ *
148
+ * @return void
149
+ */
150
+ public function setComments(array $aComments)
151
+ {
152
+ $this->aComments = $aComments;
153
+ }
154
+ }
vendor/sabberworm/php-css-parser/src/Property/Charset.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Property;
4
+
5
+ use Sabberworm\CSS\Comment\Comment;
6
+ use Sabberworm\CSS\OutputFormat;
7
+
8
+ /**
9
+ * Class representing an `@charset` rule.
10
+ *
11
+ * The following restrictions apply:
12
+ * - May not be found in any CSSList other than the Document.
13
+ * - May only appear at the very top of a Document’s contents.
14
+ * - Must not appear more than once.
15
+ */
16
+ class Charset implements AtRule
17
+ {
18
+ /**
19
+ * @var string
20
+ */
21
+ private $sCharset;
22
+
23
+ /**
24
+ * @var int
25
+ */
26
+ protected $iLineNo;
27
+
28
+ /**
29
+ * @var array<array-key, Comment>
30
+ */
31
+ protected $aComments;
32
+
33
+ /**
34
+ * @param string $sCharset
35
+ * @param int $iLineNo
36
+ */
37
+ public function __construct($sCharset, $iLineNo = 0)
38
+ {
39
+ $this->sCharset = $sCharset;
40
+ $this->iLineNo = $iLineNo;
41
+ $this->aComments = [];
42
+ }
43
+
44
+ /**
45
+ * @return int
46
+ */
47
+ public function getLineNo()
48
+ {
49
+ return $this->iLineNo;
50
+ }
51
+
52
+ /**
53
+ * @param string $sCharset
54
+ *
55
+ * @return void
56
+ */
57
+ public function setCharset($sCharset)
58
+ {
59
+ $this->sCharset = $sCharset;
60
+ }
61
+
62
+ /**
63
+ * @return string
64
+ */
65
+ public function getCharset()
66
+ {
67
+ return $this->sCharset;
68
+ }
69
+
70
+ /**
71
+ * @return string
72
+ */
73
+ public function __toString()
74
+ {
75
+ return $this->render(new OutputFormat());
76
+ }
77
+
78
+ /**
79
+ * @return string
80
+ */
81
+ public function render(OutputFormat $oOutputFormat)
82
+ {
83
+ return "@charset {$this->sCharset->render($oOutputFormat)};";
84
+ }
85
+
86
+ /**
87
+ * @return string
88
+ */
89
+ public function atRuleName()
90
+ {
91
+ return 'charset';
92
+ }
93
+
94
+ /**
95
+ * @return string
96
+ */
97
+ public function atRuleArgs()
98
+ {
99
+ return $this->sCharset;
100
+ }
101
+
102
+ /**
103
+ * @param array<array-key, Comment> $aComments
104
+ *
105
+ * @return void
106
+ */
107
+ public function addComments(array $aComments)
108
+ {
109
+ $this->aComments = array_merge($this->aComments, $aComments);
110
+ }
111
+
112
+ /**
113
+ * @return array<array-key, Comment>
114
+ */
115
+ public function getComments()
116
+ {
117
+ return $this->aComments;
118
+ }
119
+
120
+ /**
121
+ * @param array<array-key, Comment> $aComments
122
+ *
123
+ * @return void
124
+ */
125
+ public function setComments(array $aComments)
126
+ {
127
+ $this->aComments = $aComments;
128
+ }
129
+ }
vendor/sabberworm/php-css-parser/src/Property/Import.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Property;
4
+
5
+ use Sabberworm\CSS\Comment\Comment;
6
+ use Sabberworm\CSS\OutputFormat;
7
+ use Sabberworm\CSS\Value\URL;
8
+
9
+ /**
10
+ * Class representing an `@import` rule.
11
+ */
12
+ class Import implements AtRule
13
+ {
14
+ /**
15
+ * @var URL
16
+ */
17
+ private $oLocation;
18
+
19
+ /**
20
+ * @var string
21
+ */
22
+ private $sMediaQuery;
23
+
24
+ /**
25
+ * @var int
26
+ */
27
+ protected $iLineNo;
28
+
29
+ /**
30
+ * @var array<array-key, Comment>
31
+ */
32
+ protected $aComments;
33
+
34
+ /**
35
+ * @param URL $oLocation
36
+ * @param string $sMediaQuery
37
+ * @param int $iLineNo
38
+ */
39
+ public function __construct(URL $oLocation, $sMediaQuery, $iLineNo = 0)
40
+ {
41
+ $this->oLocation = $oLocation;
42
+ $this->sMediaQuery = $sMediaQuery;
43
+ $this->iLineNo = $iLineNo;
44
+ $this->aComments = [];
45
+ }
46
+
47
+ /**
48
+ * @return int
49
+ */
50
+ public function getLineNo()
51
+ {
52
+ return $this->iLineNo;
53
+ }
54
+
55
+ /**
56
+ * @param URL $oLocation
57
+ *
58
+ * @return void
59
+ */
60
+ public function setLocation($oLocation)
61
+ {
62
+ $this->oLocation = $oLocation;
63
+ }
64
+
65
+ /**
66
+ * @return URL
67
+ */
68
+ public function getLocation()
69
+ {
70
+ return $this->oLocation;
71
+ }
72
+
73
+ /**
74
+ * @return string
75
+ */
76
+ public function __toString()
77
+ {
78
+ return $this->render(new OutputFormat());
79
+ }
80
+
81
+ /**
82
+ * @return string
83
+ */
84
+ public function render(OutputFormat $oOutputFormat)
85
+ {
86
+ return "@import " . $this->oLocation->render($oOutputFormat)
87
+ . ($this->sMediaQuery === null ? '' : ' ' . $this->sMediaQuery) . ';';
88
+ }
89
+
90
+ /**
91
+ * @return string
92
+ */
93
+ public function atRuleName()
94
+ {
95
+ return 'import';
96
+ }
97
+
98
+ /**
99
+ * @return array<int, URL|string>
100
+ */
101
+ public function atRuleArgs()
102
+ {
103
+ $aResult = [$this->oLocation];
104
+ if ($this->sMediaQuery) {
105
+ array_push($aResult, $this->sMediaQuery);
106
+ }
107
+ return $aResult;
108
+ }
109
+
110
+ /**
111
+ * @param array<array-key, Comment> $aComments
112
+ *
113
+ * @return void
114
+ */
115
+ public function addComments(array $aComments)
116
+ {
117
+ $this->aComments = array_merge($this->aComments, $aComments);
118
+ }
119
+
120
+ /**
121
+ * @return array<array-key, Comment>
122
+ */
123
+ public function getComments()
124
+ {
125
+ return $this->aComments;
126
+ }
127
+
128
+ /**
129
+ * @param array<array-key, Comment> $aComments
130
+ *
131
+ * @return void
132
+ */
133
+ public function setComments(array $aComments)
134
+ {
135
+ $this->aComments = $aComments;
136
+ }
137
+ }
vendor/sabberworm/php-css-parser/src/Property/KeyframeSelector.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Property;
4
+
5
+ class KeyframeSelector extends Selector
6
+ {
7
+ /**
8
+ * regexp for specificity calculations
9
+ *
10
+ * @var string
11
+ */
12
+ const SELECTOR_VALIDATION_RX = '/
13
+ ^(
14
+ (?:
15
+ [a-zA-Z0-9\x{00A0}-\x{FFFF}_^$|*="\'~\[\]()\-\s\.:#+>]* # any sequence of valid unescaped characters
16
+ (?:\\\\.)? # a single escaped character
17
+ (?:([\'"]).*?(?<!\\\\)\2)? # a quoted text like [id="example"]
18
+ )*
19
+ )|
20
+ (\d+%) # keyframe animation progress percentage (e.g. 50%)
21
+ $
22
+ /ux';
23
+ }
vendor/sabberworm/php-css-parser/src/Property/Selector.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Property;
4
+
5
+ /**
6
+ * Class representing a single CSS selector. Selectors have to be split by the comma prior to being passed into this
7
+ * class.
8
+ */
9
+ class Selector
10
+ {
11
+ /**
12
+ * regexp for specificity calculations
13
+ *
14
+ * @var string
15
+ */
16
+ const NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX = '/
17
+ (\.[\w]+) # classes
18
+ |
19
+ \[(\w+) # attributes
20
+ |
21
+ (\:( # pseudo classes
22
+ link|visited|active
23
+ |hover|focus
24
+ |lang
25
+ |target
26
+ |enabled|disabled|checked|indeterminate
27
+ |root
28
+ |nth-child|nth-last-child|nth-of-type|nth-last-of-type
29
+ |first-child|last-child|first-of-type|last-of-type
30
+ |only-child|only-of-type
31
+ |empty|contains
32
+ ))
33
+ /ix';
34
+
35
+ /**
36
+ * regexp for specificity calculations
37
+ *
38
+ * @var string
39
+ */
40
+ const ELEMENTS_AND_PSEUDO_ELEMENTS_RX = '/
41
+ ((^|[\s\+\>\~]+)[\w]+ # elements
42
+ |
43
+ \:{1,2}( # pseudo-elements
44
+ after|before|first-letter|first-line|selection
45
+ ))
46
+ /ix';
47
+
48
+ /**
49
+ * regexp for specificity calculations
50
+ *
51
+ * @var string
52
+ */
53
+ const SELECTOR_VALIDATION_RX = '/
54
+ ^(
55
+ (?:
56
+ [a-zA-Z0-9\x{00A0}-\x{FFFF}_^$|*="\'~\[\]()\-\s\.:#+>]* # any sequence of valid unescaped characters
57
+ (?:\\\\.)? # a single escaped character
58
+ (?:([\'"]).*?(?<!\\\\)\2)? # a quoted text like [id="example"]
59
+ )*
60
+ )$
61
+ /ux';
62
+
63
+ /**
64
+ * @var string
65
+ */
66
+ private $sSelector;
67
+
68
+ /**
69
+ * @var int|null
70
+ */
71
+ private $iSpecificity;
72
+
73
+ /**
74
+ * @param string $sSelector
75
+ *
76
+ * @return bool
77
+ */
78
+ public static function isValid($sSelector)
79
+ {
80
+ return preg_match(static::SELECTOR_VALIDATION_RX, $sSelector);
81
+ }
82
+
83
+ /**
84
+ * @param string $sSelector
85
+ * @param bool $bCalculateSpecificity
86
+ */
87
+ public function __construct($sSelector, $bCalculateSpecificity = false)
88
+ {
89
+ $this->setSelector($sSelector);
90
+ if ($bCalculateSpecificity) {
91
+ $this->getSpecificity();
92
+ }
93
+ }
94
+
95
+ /**
96
+ * @return string
97
+ */
98
+ public function getSelector()
99
+ {
100
+ return $this->sSelector;
101
+ }
102
+
103
+ /**
104
+ * @param string $sSelector
105
+ *
106
+ * @return void
107
+ */
108
+ public function setSelector($sSelector)
109
+ {
110
+ $this->sSelector = trim($sSelector);
111
+ $this->iSpecificity = null;
112
+ }
113
+
114
+ /**
115
+ * @return string
116
+ */
117
+ public function __toString()
118
+ {
119
+ return $this->getSelector();
120
+ }
121
+
122
+ /**
123
+ * @return int
124
+ */
125
+ public function getSpecificity()
126
+ {
127
+ if ($this->iSpecificity === null) {
128
+ $a = 0;
129
+ /// @todo should exclude \# as well as "#"
130
+ $aMatches = null;
131
+ $b = substr_count($this->sSelector, '#');
132
+ $c = preg_match_all(self::NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX, $this->sSelector, $aMatches);
133
+ $d = preg_match_all(self::ELEMENTS_AND_PSEUDO_ELEMENTS_RX, $this->sSelector, $aMatches);
134
+ $this->iSpecificity = ($a * 1000) + ($b * 100) + ($c * 10) + $d;
135
+ }
136
+ return $this->iSpecificity;
137
+ }
138
+ }
vendor/sabberworm/php-css-parser/src/Renderable.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS;
4
+
5
+ interface Renderable
6
+ {
7
+ /**
8
+ * @return string
9
+ */
10
+ public function __toString();
11
+
12
+ /**
13
+ * @return string
14
+ */
15
+ public function render(OutputFormat $oOutputFormat);
16
+
17
+ /**
18
+ * @return int
19
+ */
20
+ public function getLineNo();
21
+ }
vendor/sabberworm/php-css-parser/src/Rule/Rule.php ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Rule;
4
+
5
+ use Sabberworm\CSS\Comment\Comment;
6
+ use Sabberworm\CSS\Comment\Commentable;
7
+ use Sabberworm\CSS\OutputFormat;
8
+ use Sabberworm\CSS\Parsing\ParserState;
9
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
10
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
11
+ use Sabberworm\CSS\Renderable;
12
+ use Sabberworm\CSS\Value\RuleValueList;
13
+ use Sabberworm\CSS\Value\Value;
14
+
15
+ /**
16
+ * RuleSets contains Rule objects which always have a key and a value.
17
+ * In CSS, Rules are expressed as follows: “key: value[0][0] value[0][1], value[1][0] value[1][1];”
18
+ */
19
+ class Rule implements Renderable, Commentable
20
+ {
21
+ /**
22
+ * @var string
23
+ */
24
+ private $sRule;
25
+
26
+ /**
27
+ * @var RuleValueList|null
28
+ */
29
+ private $mValue;
30
+
31
+ /**
32
+ * @var bool
33
+ */
34
+ private $bIsImportant;
35
+
36
+ /**
37
+ * @var array<int, int>
38
+ */
39
+ private $aIeHack;
40
+
41
+ /**
42
+ * @var int
43
+ */
44
+ protected $iLineNo;
45
+
46
+ /**
47
+ * @var int
48
+ */
49
+ protected $iColNo;
50
+
51
+ /**
52
+ * @var array<array-key, Comment>
53
+ */
54
+ protected $aComments;
55
+
56
+ /**
57
+ * @param string $sRule
58
+ * @param int $iLineNo
59
+ * @param int $iColNo
60
+ */
61
+ public function __construct($sRule, $iLineNo = 0, $iColNo = 0)
62
+ {
63
+ $this->sRule = $sRule;
64
+ $this->mValue = null;
65
+ $this->bIsImportant = false;
66
+ $this->aIeHack = [];
67
+ $this->iLineNo = $iLineNo;
68
+ $this->iColNo = $iColNo;
69
+ $this->aComments = [];
70
+ }
71
+
72
+ /**
73
+ * @return Rule
74
+ *
75
+ * @throws UnexpectedEOFException
76
+ * @throws UnexpectedTokenException
77
+ */
78
+ public static function parse(ParserState $oParserState)
79
+ {
80
+ $aComments = $oParserState->consumeWhiteSpace();
81
+ $oRule = new Rule(
82
+ $oParserState->parseIdentifier(!$oParserState->comes("--")),
83
+ $oParserState->currentLine(),
84
+ $oParserState->currentColumn()
85
+ );
86
+ $oRule->setComments($aComments);
87
+ $oRule->addComments($oParserState->consumeWhiteSpace());
88
+ $oParserState->consume(':');
89
+ $oValue = Value::parseValue($oParserState, self::listDelimiterForRule($oRule->getRule()));
90
+ $oRule->setValue($oValue);
91
+ if ($oParserState->getSettings()->bLenientParsing) {
92
+ while ($oParserState->comes('\\')) {
93
+ $oParserState->consume('\\');
94
+ $oRule->addIeHack($oParserState->consume());
95
+ $oParserState->consumeWhiteSpace();
96
+ }
97
+ }
98
+ $oParserState->consumeWhiteSpace();
99
+ if ($oParserState->comes('!')) {
100
+ $oParserState->consume('!');
101
+ $oParserState->consumeWhiteSpace();
102
+ $oParserState->consume('important');
103
+ $oRule->setIsImportant(true);
104
+ }
105
+ $oParserState->consumeWhiteSpace();
106
+ while ($oParserState->comes(';')) {
107
+ $oParserState->consume(';');
108
+ }
109
+ $oParserState->consumeWhiteSpace();
110
+
111
+ return $oRule;
112
+ }
113
+
114
+ /**
115
+ * @param string $sRule
116
+ *
117
+ * @return array<int, string>
118
+ */
119
+ private static function listDelimiterForRule($sRule)
120
+ {
121
+ if (preg_match('/^font($|-)/', $sRule)) {
122
+ return [',', '/', ' '];
123
+ }
124
+ return [',', ' ', '/'];
125
+ }
126
+
127
+ /**
128
+ * @return int
129
+ */
130
+ public function getLineNo()
131
+ {
132
+ return $this->iLineNo;
133
+ }
134
+
135
+ /**
136
+ * @return int
137
+ */
138
+ public function getColNo()
139
+ {
140
+ return $this->iColNo;
141
+ }
142
+
143
+ /**
144
+ * @param int $iLine
145
+ * @param int $iColumn
146
+ *
147
+ * @return void
148
+ */
149
+ public function setPosition($iLine, $iColumn)
150
+ {
151
+ $this->iColNo = $iColumn;
152
+ $this->iLineNo = $iLine;
153
+ }
154
+
155
+ /**
156
+ * @param string $sRule
157
+ *
158
+ * @return void
159
+ */
160
+ public function setRule($sRule)
161
+ {
162
+ $this->sRule = $sRule;
163
+ }
164
+
165
+ /**
166
+ * @return string
167
+ */
168
+ public function getRule()
169
+ {
170
+ return $this->sRule;
171
+ }
172
+
173
+ /**
174
+ * @return RuleValueList|null
175
+ */
176
+ public function getValue()
177
+ {
178
+ return $this->mValue;
179
+ }
180
+
181
+ /**
182
+ * @param RuleValueList|null $mValue
183
+ *
184
+ * @return void
185
+ */
186
+ public function setValue($mValue)
187
+ {
188
+ $this->mValue = $mValue;
189
+ }
190
+
191
+ /**
192
+ * @param array<array-key, array<array-key, RuleValueList>> $aSpaceSeparatedValues
193
+ *
194
+ * @return RuleValueList
195
+ *
196
+ * @deprecated will be removed in version 9.0
197
+ * Old-Style 2-dimensional array given. Retained for (some) backwards-compatibility.
198
+ * Use `setValue()` instead and wrap the value inside a RuleValueList if necessary.
199
+ */
200
+ public function setValues(array $aSpaceSeparatedValues)
201
+ {
202
+ $oSpaceSeparatedList = null;
203
+ if (count($aSpaceSeparatedValues) > 1) {
204
+ $oSpaceSeparatedList = new RuleValueList(' ', $this->iLineNo);
205
+ }
206
+ foreach ($aSpaceSeparatedValues as $aCommaSeparatedValues) {
207
+ $oCommaSeparatedList = null;
208
+ if (count($aCommaSeparatedValues) > 1) {
209
+ $oCommaSeparatedList = new RuleValueList(',', $this->iLineNo);
210
+ }
211
+ foreach ($aCommaSeparatedValues as $mValue) {
212
+ if (!$oSpaceSeparatedList && !$oCommaSeparatedList) {
213
+ $this->mValue = $mValue;
214
+ return $mValue;
215
+ }
216
+ if ($oCommaSeparatedList) {
217
+ $oCommaSeparatedList->addListComponent($mValue);
218
+ } else {
219
+ $oSpaceSeparatedList->addListComponent($mValue);
220
+ }
221
+ }
222
+ if (!$oSpaceSeparatedList) {
223
+ $this->mValue = $oCommaSeparatedList;
224
+ return $oCommaSeparatedList;
225
+ } else {
226
+ $oSpaceSeparatedList->addListComponent($oCommaSeparatedList);
227
+ }
228
+ }
229
+ $this->mValue = $oSpaceSeparatedList;
230
+ return $oSpaceSeparatedList;
231
+ }
232
+
233
+ /**
234
+ * @return array<int, array<int, RuleValueList>>
235
+ *
236
+ * @deprecated will be removed in version 9.0
237
+ * Old-Style 2-dimensional array returned. Retained for (some) backwards-compatibility.
238
+ * Use `getValue()` instead and check for the existence of a (nested set of) ValueList object(s).
239
+ */
240
+ public function getValues()
241
+ {
242
+ if (!$this->mValue instanceof RuleValueList) {
243
+ return [[$this->mValue]];
244
+ }
245
+ if ($this->mValue->getListSeparator() === ',') {
246
+ return [$this->mValue->getListComponents()];
247
+ }
248
+ $aResult = [];
249
+ foreach ($this->mValue->getListComponents() as $mValue) {
250
+ if (!$mValue instanceof RuleValueList || $mValue->getListSeparator() !== ',') {
251
+ $aResult[] = [$mValue];
252
+ continue;
253
+ }
254
+ if ($this->mValue->getListSeparator() === ' ' || count($aResult) === 0) {
255
+ $aResult[] = [];
256
+ }
257
+ foreach ($mValue->getListComponents() as $mValue) {
258
+ $aResult[count($aResult) - 1][] = $mValue;
259
+ }
260
+ }
261
+ return $aResult;
262
+ }
263
+
264
+ /**
265
+ * Adds a value to the existing value. Value will be appended if a `RuleValueList` exists of the given type.
266
+ * Otherwise, the existing value will be wrapped by one.
267
+ *
268
+ * @param RuleValueList|array<int, RuleValueList> $mValue
269
+ * @param string $sType
270
+ *
271
+ * @return void
272
+ */
273
+ public function addValue($mValue, $sType = ' ')
274
+ {
275
+ if (!is_array($mValue)) {
276
+ $mValue = [$mValue];
277
+ }
278
+ if (!$this->mValue instanceof RuleValueList || $this->mValue->getListSeparator() !== $sType) {
279
+ $mCurrentValue = $this->mValue;
280
+ $this->mValue = new RuleValueList($sType, $this->iLineNo);
281
+ if ($mCurrentValue) {
282
+ $this->mValue->addListComponent($mCurrentValue);
283
+ }
284
+ }
285
+ foreach ($mValue as $mValueItem) {
286
+ $this->mValue->addListComponent($mValueItem);
287
+ }
288
+ }
289
+
290
+ /**
291
+ * @param int $iModifier
292
+ *
293
+ * @return void
294
+ */
295
+ public function addIeHack($iModifier)
296
+ {
297
+ $this->aIeHack[] = $iModifier;
298
+ }
299
+
300
+ /**
301
+ * @param array<int, int> $aModifiers
302
+ *
303
+ * @return void
304
+ */
305
+ public function setIeHack(array $aModifiers)
306
+ {
307
+ $this->aIeHack = $aModifiers;
308
+ }
309
+
310
+ /**
311
+ * @return array<int, int>
312
+ */
313
+ public function getIeHack()
314
+ {
315
+ return $this->aIeHack;
316
+ }
317
+
318
+ /**
319
+ * @param bool $bIsImportant
320
+ *
321
+ * @return void
322
+ */
323
+ public function setIsImportant($bIsImportant)
324
+ {
325
+ $this->bIsImportant = $bIsImportant;
326
+ }
327
+
328
+ /**
329
+ * @return bool
330
+ */
331
+ public function getIsImportant()
332
+ {
333
+ return $this->bIsImportant;
334
+ }
335
+
336
+ /**
337
+ * @return string
338
+ */
339
+ public function __toString()
340
+ {
341
+ return $this->render(new OutputFormat());
342
+ }
343
+
344
+ /**
345
+ * @return string
346
+ */
347
+ public function render(OutputFormat $oOutputFormat)
348
+ {
349
+ $sResult = "{$this->sRule}:{$oOutputFormat->spaceAfterRuleName()}";
350
+ if ($this->mValue instanceof Value) { //Can also be a ValueList
351
+ $sResult .= $this->mValue->render($oOutputFormat);
352
+ } else {
353
+ $sResult .= $this->mValue;
354
+ }
355
+ if (!empty($this->aIeHack)) {
356
+ $sResult .= ' \\' . implode('\\', $this->aIeHack);
357
+ }
358
+ if ($this->bIsImportant) {
359
+ $sResult .= ' !important';
360
+ }
361
+ $sResult .= ';';
362
+ return $sResult;
363
+ }
364
+
365
+ /**
366
+ * @param array<array-key, Comment> $aComments
367
+ *
368
+ * @return void
369
+ */
370
+ public function addComments(array $aComments)
371
+ {
372
+ $this->aComments = array_merge($this->aComments, $aComments);
373
+ }
374
+
375
+ /**
376
+ * @return array<array-key, Comment>
377
+ */
378
+ public function getComments()
379
+ {
380
+ return $this->aComments;
381
+ }
382
+
383
+ /**
384
+ * @param array<array-key, Comment> $aComments
385
+ *
386
+ * @return void
387
+ */
388
+ public function setComments(array $aComments)
389
+ {
390
+ $this->aComments = $aComments;
391
+ }
392
+ }
vendor/sabberworm/php-css-parser/src/RuleSet/AtRuleSet.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\RuleSet;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+ use Sabberworm\CSS\Property\AtRule;
7
+
8
+ /**
9
+ * A RuleSet constructed by an unknown at-rule. `@font-face` rules are rendered into AtRuleSet objects.
10
+ */
11
+ class AtRuleSet extends RuleSet implements AtRule
12
+ {
13
+ /**
14
+ * @var string
15
+ */
16
+ private $sType;
17
+
18
+ /**
19
+ * @var string
20
+ */
21
+ private $sArgs;
22
+
23
+ /**
24
+ * @param string $sType
25
+ * @param string $sArgs
26
+ * @param int $iLineNo
27
+ */
28
+ public function __construct($sType, $sArgs = '', $iLineNo = 0)
29
+ {
30
+ parent::__construct($iLineNo);
31
+ $this->sType = $sType;
32
+ $this->sArgs = $sArgs;
33
+ }
34
+
35
+ /**
36
+ * @return string
37
+ */
38
+ public function atRuleName()
39
+ {
40
+ return $this->sType;
41
+ }
42
+
43
+ /**
44
+ * @return string
45
+ */
46
+ public function atRuleArgs()
47
+ {
48
+ return $this->sArgs;
49
+ }
50
+
51
+ /**
52
+ * @return string
53
+ */
54
+ public function __toString()
55
+ {
56
+ return $this->render(new OutputFormat());
57
+ }
58
+
59
+ /**
60
+ * @return string
61
+ */
62
+ public function render(OutputFormat $oOutputFormat)
63
+ {
64
+ $sArgs = $this->sArgs;
65
+ if ($sArgs) {
66
+ $sArgs = ' ' . $sArgs;
67
+ }
68
+ $sResult = "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
69
+ $sResult .= parent::render($oOutputFormat);
70
+ $sResult .= '}';
71
+ return $sResult;
72
+ }
73
+ }
vendor/sabberworm/php-css-parser/src/RuleSet/DeclarationBlock.php ADDED
@@ -0,0 +1,831 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\RuleSet;
4
+
5
+ use Sabberworm\CSS\CSSList\CSSList;
6
+ use Sabberworm\CSS\CSSList\KeyFrame;
7
+ use Sabberworm\CSS\OutputFormat;
8
+ use Sabberworm\CSS\Parsing\OutputException;
9
+ use Sabberworm\CSS\Parsing\ParserState;
10
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
11
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
12
+ use Sabberworm\CSS\Property\KeyframeSelector;
13
+ use Sabberworm\CSS\Property\Selector;
14
+ use Sabberworm\CSS\Rule\Rule;
15
+ use Sabberworm\CSS\Value\Color;
16
+ use Sabberworm\CSS\Value\RuleValueList;
17
+ use Sabberworm\CSS\Value\Size;
18
+ use Sabberworm\CSS\Value\URL;
19
+ use Sabberworm\CSS\Value\Value;
20
+
21
+ /**
22
+ * Declaration blocks are the parts of a CSS file which denote the rules belonging to a selector.
23
+ *
24
+ * Declaration blocks usually appear directly inside a `Document` or another `CSSList` (mostly a `MediaQuery`).
25
+ */
26
+ class DeclarationBlock extends RuleSet
27
+ {
28
+ /**
29
+ * @var array<int, Selector|string>
30
+ */
31
+ private $aSelectors;
32
+
33
+ /**
34
+ * @param int $iLineNo
35
+ */
36
+ public function __construct($iLineNo = 0)
37
+ {
38
+ parent::__construct($iLineNo);
39
+ $this->aSelectors = [];
40
+ }
41
+
42
+ /**
43
+ * @param CSSList|null $oList
44
+ *
45
+ * @return DeclarationBlock|false
46
+ *
47
+ * @throws UnexpectedTokenException
48
+ * @throws UnexpectedEOFException
49
+ */
50
+ public static function parse(ParserState $oParserState, $oList = null)
51
+ {
52
+ $aComments = [];
53
+ $oResult = new DeclarationBlock($oParserState->currentLine());
54
+ try {
55
+ $aSelectorParts = [];
56
+ $sStringWrapperChar = false;
57
+ do {
58
+ $aSelectorParts[] = $oParserState->consume(1)
59
+ . $oParserState->consumeUntil(['{', '}', '\'', '"'], false, false, $aComments);
60
+ if (in_array($oParserState->peek(), ['\'', '"']) && substr(end($aSelectorParts), -1) != "\\") {
61
+ if ($sStringWrapperChar === false) {
62
+ $sStringWrapperChar = $oParserState->peek();
63
+ } elseif ($sStringWrapperChar == $oParserState->peek()) {
64
+ $sStringWrapperChar = false;
65
+ }
66
+ }
67
+ } while (!in_array($oParserState->peek(), ['{', '}']) || $sStringWrapperChar !== false);
68
+ $oResult->setSelectors(implode('', $aSelectorParts), $oList);
69
+ if ($oParserState->comes('{')) {
70
+ $oParserState->consume(1);
71
+ }
72
+ } catch (UnexpectedTokenException $e) {
73
+ if ($oParserState->getSettings()->bLenientParsing) {
74
+ if (!$oParserState->comes('}')) {
75
+ $oParserState->consumeUntil('}', false, true);
76
+ }
77
+ return false;
78
+ } else {
79
+ throw $e;
80
+ }
81
+ }
82
+ $oResult->setComments($aComments);
83
+ RuleSet::parseRuleSet($oParserState, $oResult);
84
+ return $oResult;
85
+ }
86
+
87
+ /**
88
+ * @param array<int, Selector|string>|string $mSelector
89
+ * @param CSSList|null $oList
90
+ *
91
+ * @throws UnexpectedTokenException
92
+ */
93
+ public function setSelectors($mSelector, $oList = null)
94
+ {
95
+ if (is_array($mSelector)) {
96
+ $this->aSelectors = $mSelector;
97
+ } else {
98
+ $this->aSelectors = explode(',', $mSelector);
99
+ }
100
+ foreach ($this->aSelectors as $iKey => $mSelector) {
101
+ if (!($mSelector instanceof Selector)) {
102
+ if ($oList === null || !($oList instanceof KeyFrame)) {
103
+ if (!Selector::isValid($mSelector)) {
104
+ throw new UnexpectedTokenException(
105
+ "Selector did not match '" . Selector::SELECTOR_VALIDATION_RX . "'.",
106
+ $mSelector,
107
+ "custom"
108
+ );
109
+ }
110
+ $this->aSelectors[$iKey] = new Selector($mSelector);
111
+ } else {
112
+ if (!KeyframeSelector::isValid($mSelector)) {
113
+ throw new UnexpectedTokenException(
114
+ "Selector did not match '" . KeyframeSelector::SELECTOR_VALIDATION_RX . "'.",
115
+ $mSelector,
116
+ "custom"
117
+ );
118
+ }
119
+ $this->aSelectors[$iKey] = new KeyframeSelector($mSelector);
120
+ }
121
+ }
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Remove one of the selectors of the block.
127
+ *
128
+ * @param Selector|string $mSelector
129
+ *
130
+ * @return bool
131
+ */
132
+ public function removeSelector($mSelector)
133
+ {
134
+ if ($mSelector instanceof Selector) {
135
+ $mSelector = $mSelector->getSelector();
136
+ }
137
+ foreach ($this->aSelectors as $iKey => $oSelector) {
138
+ if ($oSelector->getSelector() === $mSelector) {
139
+ unset($this->aSelectors[$iKey]);
140
+ return true;
141
+ }
142
+ }
143
+ return false;
144
+ }
145
+
146
+ /**
147
+ * @return array<int, Selector|string>
148
+ *
149
+ * @deprecated will be removed in version 9.0; use `getSelectors()` instead
150
+ */
151
+ public function getSelector()
152
+ {
153
+ return $this->getSelectors();
154
+ }
155
+
156
+ /**
157
+ * @param Selector|string $mSelector
158
+ * @param CSSList|null $oList
159
+ *
160
+ * @return void
161
+ *
162
+ * @deprecated will be removed in version 9.0; use `setSelectors()` instead
163
+ */
164
+ public function setSelector($mSelector, $oList = null)
165
+ {
166
+ $this->setSelectors($mSelector, $oList);
167
+ }
168
+
169
+ /**
170
+ * @return array<int, Selector|string>
171
+ */
172
+ public function getSelectors()
173
+ {
174
+ return $this->aSelectors;
175
+ }
176
+
177
+ /**
178
+ * Splits shorthand declarations (e.g. `margin` or `font`) into their constituent parts.
179
+ *
180
+ * @return void
181
+ */
182
+ public function expandShorthands()
183
+ {
184
+ // border must be expanded before dimensions
185
+ $this->expandBorderShorthand();
186
+ $this->expandDimensionsShorthand();
187
+ $this->expandFontShorthand();
188
+ $this->expandBackgroundShorthand();
189
+ $this->expandListStyleShorthand();
190
+ }
191
+
192
+ /**
193
+ * Creates shorthand declarations (e.g. `margin` or `font`) whenever possible.
194
+ *
195
+ * @return void
196
+ */
197
+ public function createShorthands()
198
+ {
199
+ $this->createBackgroundShorthand();
200
+ $this->createDimensionsShorthand();
201
+ // border must be shortened after dimensions
202
+ $this->createBorderShorthand();
203
+ $this->createFontShorthand();
204
+ $this->createListStyleShorthand();
205
+ }
206
+
207
+ /**
208
+ * Splits shorthand border declarations (e.g. `border: 1px red;`).
209
+ *
210
+ * Additional splitting happens in expandDimensionsShorthand.
211
+ *
212
+ * Multiple borders are not yet supported as of 3.
213
+ *
214
+ * @return void
215
+ */
216
+ public function expandBorderShorthand()
217
+ {
218
+ $aBorderRules = [
219
+ 'border',
220
+ 'border-left',
221
+ 'border-right',
222
+ 'border-top',
223
+ 'border-bottom',
224
+ ];
225
+ $aBorderSizes = [
226
+ 'thin',
227
+ 'medium',
228
+ 'thick',
229
+ ];
230
+ $aRules = $this->getRulesAssoc();
231
+ foreach ($aBorderRules as $sBorderRule) {
232
+ if (!isset($aRules[$sBorderRule])) {
233
+ continue;
234
+ }
235
+ $oRule = $aRules[$sBorderRule];
236
+ $mRuleValue = $oRule->getValue();
237
+ $aValues = [];
238
+ if (!$mRuleValue instanceof RuleValueList) {
239
+ $aValues[] = $mRuleValue;
240
+ } else {
241
+ $aValues = $mRuleValue->getListComponents();
242
+ }
243
+ foreach ($aValues as $mValue) {
244
+ if ($mValue instanceof Value) {
245
+ $mNewValue = clone $mValue;
246
+ } else {
247
+ $mNewValue = $mValue;
248
+ }
249
+ if ($mValue instanceof Size) {
250
+ $sNewRuleName = $sBorderRule . "-width";
251
+ } elseif ($mValue instanceof Color) {
252
+ $sNewRuleName = $sBorderRule . "-color";
253
+ } else {
254
+ if (in_array($mValue, $aBorderSizes)) {
255
+ $sNewRuleName = $sBorderRule . "-width";
256
+ } else {
257
+ $sNewRuleName = $sBorderRule . "-style";
258
+ }
259
+ }
260
+ $oNewRule = new Rule($sNewRuleName, $oRule->getLineNo(), $oRule->getColNo());
261
+ $oNewRule->setIsImportant($oRule->getIsImportant());
262
+ $oNewRule->addValue([$mNewValue]);
263
+ $this->addRule($oNewRule);
264
+ }
265
+ $this->removeRule($sBorderRule);
266
+ }
267
+ }
268
+
269
+ /**
270
+ * Splits shorthand dimensional declarations (e.g. `margin: 0px auto;`)
271
+ * into their constituent parts.
272
+ *
273
+ * Handles `margin`, `padding`, `border-color`, `border-style` and `border-width`.
274
+ *
275
+ * @return void
276
+ */
277
+ public function expandDimensionsShorthand()
278
+ {
279
+ $aExpansions = [
280
+ 'margin' => 'margin-%s',
281
+ 'padding' => 'padding-%s',
282
+ 'border-color' => 'border-%s-color',
283
+ 'border-style' => 'border-%s-style',
284
+ 'border-width' => 'border-%s-width',
285
+ ];
286
+ $aRules = $this->getRulesAssoc();
287
+ foreach ($aExpansions as $sProperty => $sExpanded) {
288
+ if (!isset($aRules[$sProperty])) {
289
+ continue;
290
+ }
291
+ $oRule = $aRules[$sProperty];
292
+ $mRuleValue = $oRule->getValue();
293
+ $aValues = [];
294
+ if (!$mRuleValue instanceof RuleValueList) {
295
+ $aValues[] = $mRuleValue;
296
+ } else {
297
+ $aValues = $mRuleValue->getListComponents();
298
+ }
299
+ $top = $right = $bottom = $left = null;
300
+ switch (count($aValues)) {
301
+ case 1:
302
+ $top = $right = $bottom = $left = $aValues[0];
303
+ break;
304
+ case 2:
305
+ $top = $bottom = $aValues[0];
306
+ $left = $right = $aValues[1];
307
+ break;
308
+ case 3:
309
+ $top = $aValues[0];
310
+ $left = $right = $aValues[1];
311
+ $bottom = $aValues[2];
312
+ break;
313
+ case 4:
314
+ $top = $aValues[0];
315
+ $right = $aValues[1];
316
+ $bottom = $aValues[2];
317
+ $left = $aValues[3];
318
+ break;
319
+ }
320
+ foreach (['top', 'right', 'bottom', 'left'] as $sPosition) {
321
+ $oNewRule = new Rule(sprintf($sExpanded, $sPosition), $oRule->getLineNo(), $oRule->getColNo());
322
+ $oNewRule->setIsImportant($oRule->getIsImportant());
323
+ $oNewRule->addValue(${$sPosition});
324
+ $this->addRule($oNewRule);
325
+ }
326
+ $this->removeRule($sProperty);
327
+ }
328
+ }
329
+
330
+ /**
331
+ * Converts shorthand font declarations
332
+ * (e.g. `font: 300 italic 11px/14px verdana, helvetica, sans-serif;`)
333
+ * into their constituent parts.
334
+ *
335
+ * @return void
336
+ */
337
+ public function expandFontShorthand()
338
+ {
339
+ $aRules = $this->getRulesAssoc();
340
+ if (!isset($aRules['font'])) {
341
+ return;
342
+ }
343
+ $oRule = $aRules['font'];
344
+ // reset properties to 'normal' per http://www.w3.org/TR/21/fonts.html#font-shorthand
345
+ $aFontProperties = [
346
+ 'font-style' => 'normal',
347
+ 'font-variant' => 'normal',
348
+ 'font-weight' => 'normal',
349
+ 'font-size' => 'normal',
350
+ 'line-height' => 'normal',
351
+ ];
352
+ $mRuleValue = $oRule->getValue();
353
+ $aValues = [];
354
+ if (!$mRuleValue instanceof RuleValueList) {
355
+ $aValues[] = $mRuleValue;
356
+ } else {
357
+ $aValues = $mRuleValue->getListComponents();
358
+ }
359
+ foreach ($aValues as $mValue) {
360
+ if (!$mValue instanceof Value) {
361
+ $mValue = mb_strtolower($mValue);
362
+ }
363
+ if (in_array($mValue, ['normal', 'inherit'])) {
364
+ foreach (['font-style', 'font-weight', 'font-variant'] as $sProperty) {
365
+ if (!isset($aFontProperties[$sProperty])) {
366
+ $aFontProperties[$sProperty] = $mValue;
367
+ }
368
+ }
369
+ } elseif (in_array($mValue, ['italic', 'oblique'])) {
370
+ $aFontProperties['font-style'] = $mValue;
371
+ } elseif ($mValue == 'small-caps') {
372
+ $aFontProperties['font-variant'] = $mValue;
373
+ } elseif (
374
+ in_array($mValue, ['bold', 'bolder', 'lighter'])
375
+ || ($mValue instanceof Size
376
+ && in_array($mValue->getSize(), range(100, 900, 100)))
377
+ ) {
378
+ $aFontProperties['font-weight'] = $mValue;
379
+ } elseif ($mValue instanceof RuleValueList && $mValue->getListSeparator() == '/') {
380
+ list($oSize, $oHeight) = $mValue->getListComponents();
381
+ $aFontProperties['font-size'] = $oSize;
382
+ $aFontProperties['line-height'] = $oHeight;
383
+ } elseif ($mValue instanceof Size && $mValue->getUnit() !== null) {
384
+ $aFontProperties['font-size'] = $mValue;
385
+ } else {
386
+ $aFontProperties['font-family'] = $mValue;
387
+ }
388
+ }
389
+ foreach ($aFontProperties as $sProperty => $mValue) {
390
+ $oNewRule = new Rule($sProperty, $oRule->getLineNo(), $oRule->getColNo());
391
+ $oNewRule->addValue($mValue);
392
+ $oNewRule->setIsImportant($oRule->getIsImportant());
393
+ $this->addRule($oNewRule);
394
+ }
395
+ $this->removeRule('font');
396
+ }
397
+
398
+ /**
399
+ * Converts shorthand background declarations
400
+ * (e.g. `background: url("chess.png") gray 50% repeat fixed;`)
401
+ * into their constituent parts.
402
+ *
403
+ * @see http://www.w3.org/TR/21/colors.html#propdef-background
404
+ *
405
+ * @return void
406
+ */
407
+ public function expandBackgroundShorthand()
408
+ {
409
+ $aRules = $this->getRulesAssoc();
410
+ if (!isset($aRules['background'])) {
411
+ return;
412
+ }
413
+ $oRule = $aRules['background'];
414
+ $aBgProperties = [
415
+ 'background-color' => ['transparent'],
416
+ 'background-image' => ['none'],
417
+ 'background-repeat' => ['repeat'],
418
+ 'background-attachment' => ['scroll'],
419
+ 'background-position' => [
420
+ new Size(0, '%', null, false, $this->iLineNo),
421
+ new Size(0, '%', null, false, $this->iLineNo),
422
+ ],
423
+ ];
424
+ $mRuleValue = $oRule->getValue();
425
+ $aValues = [];
426
+ if (!$mRuleValue instanceof RuleValueList) {
427
+ $aValues[] = $mRuleValue;
428
+ } else {
429
+ $aValues = $mRuleValue->getListComponents();
430
+ }
431
+ if (count($aValues) == 1 && $aValues[0] == 'inherit') {
432
+ foreach ($aBgProperties as $sProperty => $mValue) {
433
+ $oNewRule = new Rule($sProperty, $oRule->getLineNo(), $oRule->getColNo());
434
+ $oNewRule->addValue('inherit');
435
+ $oNewRule->setIsImportant($oRule->getIsImportant());
436
+ $this->addRule($oNewRule);
437
+ }
438
+ $this->removeRule('background');
439
+ return;
440
+ }
441
+ $iNumBgPos = 0;
442
+ foreach ($aValues as $mValue) {
443
+ if (!$mValue instanceof Value) {
444
+ $mValue = mb_strtolower($mValue);
445
+ }
446
+ if ($mValue instanceof URL) {
447
+ $aBgProperties['background-image'] = $mValue;
448
+ } elseif ($mValue instanceof Color) {
449
+ $aBgProperties['background-color'] = $mValue;
450
+ } elseif (in_array($mValue, ['scroll', 'fixed'])) {
451
+ $aBgProperties['background-attachment'] = $mValue;
452
+ } elseif (in_array($mValue, ['repeat', 'no-repeat', 'repeat-x', 'repeat-y'])) {
453
+ $aBgProperties['background-repeat'] = $mValue;
454
+ } elseif (
455
+ in_array($mValue, ['left', 'center', 'right', 'top', 'bottom'])
456
+ || $mValue instanceof Size
457
+ ) {
458
+ if ($iNumBgPos == 0) {
459
+ $aBgProperties['background-position'][0] = $mValue;
460
+ $aBgProperties['background-position'][1] = 'center';
461
+ } else {
462
+ $aBgProperties['background-position'][$iNumBgPos] = $mValue;
463
+ }
464
+ $iNumBgPos++;
465
+ }
466
+ }
467
+ foreach ($aBgProperties as $sProperty => $mValue) {
468
+ $oNewRule = new Rule($sProperty, $oRule->getLineNo(), $oRule->getColNo());
469
+ $oNewRule->setIsImportant($oRule->getIsImportant());
470
+ $oNewRule->addValue($mValue);
471
+ $this->addRule($oNewRule);
472
+ }
473
+ $this->removeRule('background');
474
+ }
475
+
476
+ /**
477
+ * @return void
478
+ */
479
+ public function expandListStyleShorthand()
480
+ {
481
+ $aListProperties = [
482
+ 'list-style-type' => 'disc',
483
+ 'list-style-position' => 'outside',
484
+ 'list-style-image' => 'none',
485
+ ];
486
+ $aListStyleTypes = [
487
+ 'none',
488
+ 'disc',
489
+ 'circle',
490
+ 'square',
491
+ 'decimal-leading-zero',
492
+ 'decimal',
493
+ 'lower-roman',
494
+ 'upper-roman',
495
+ 'lower-greek',
496
+ 'lower-alpha',
497
+ 'lower-latin',
498
+ 'upper-alpha',
499
+ 'upper-latin',
500
+ 'hebrew',
501
+ 'armenian',
502
+ 'georgian',
503
+ 'cjk-ideographic',
504
+ 'hiragana',
505
+ 'hira-gana-iroha',
506
+ 'katakana-iroha',
507
+ 'katakana',
508
+ ];
509
+ $aListStylePositions = [
510
+ 'inside',
511
+ 'outside',
512
+ ];
513
+ $aRules = $this->getRulesAssoc();
514
+ if (!isset($aRules['list-style'])) {
515
+ return;
516
+ }
517
+ $oRule = $aRules['list-style'];
518
+ $mRuleValue = $oRule->getValue();
519
+ $aValues = [];
520
+ if (!$mRuleValue instanceof RuleValueList) {
521
+ $aValues[] = $mRuleValue;
522
+ } else {
523
+ $aValues = $mRuleValue->getListComponents();
524
+ }
525
+ if (count($aValues) == 1 && $aValues[0] == 'inherit') {
526
+ foreach ($aListProperties as $sProperty => $mValue) {
527
+ $oNewRule = new Rule($sProperty, $oRule->getLineNo(), $oRule->getColNo());
528
+ $oNewRule->addValue('inherit');
529
+ $oNewRule->setIsImportant($oRule->getIsImportant());
530
+ $this->addRule($oNewRule);
531
+ }
532
+ $this->removeRule('list-style');
533
+ return;
534
+ }
535
+ foreach ($aValues as $mValue) {
536
+ if (!$mValue instanceof Value) {
537
+ $mValue = mb_strtolower($mValue);
538
+ }
539
+ if ($mValue instanceof Url) {
540
+ $aListProperties['list-style-image'] = $mValue;
541
+ } elseif (in_array($mValue, $aListStyleTypes)) {
542
+ $aListProperties['list-style-types'] = $mValue;
543
+ } elseif (in_array($mValue, $aListStylePositions)) {
544
+ $aListProperties['list-style-position'] = $mValue;
545
+ }
546
+ }
547
+ foreach ($aListProperties as $sProperty => $mValue) {
548
+ $oNewRule = new Rule($sProperty, $oRule->getLineNo(), $oRule->getColNo());
549
+ $oNewRule->setIsImportant($oRule->getIsImportant());
550
+ $oNewRule->addValue($mValue);
551
+ $this->addRule($oNewRule);
552
+ }
553
+ $this->removeRule('list-style');
554
+ }
555
+
556
+ /**
557
+ * @param array<array-key, string> $aProperties
558
+ * @param string $sShorthand
559
+ *
560
+ * @return void
561
+ */
562
+ public function createShorthandProperties(array $aProperties, $sShorthand)
563
+ {
564
+ $aRules = $this->getRulesAssoc();
565
+ $aNewValues = [];
566
+ foreach ($aProperties as $sProperty) {
567
+ if (!isset($aRules[$sProperty])) {
568
+ continue;
569
+ }
570
+ $oRule = $aRules[$sProperty];
571
+ if (!$oRule->getIsImportant()) {
572
+ $mRuleValue = $oRule->getValue();
573
+ $aValues = [];
574
+ if (!$mRuleValue instanceof RuleValueList) {
575
+ $aValues[] = $mRuleValue;
576
+ } else {
577
+ $aValues = $mRuleValue->getListComponents();
578
+ }
579
+ foreach ($aValues as $mValue) {
580
+ $aNewValues[] = $mValue;
581
+ }
582
+ $this->removeRule($sProperty);
583
+ }
584
+ }
585
+ if (count($aNewValues)) {
586
+ $oNewRule = new Rule($sShorthand, $oRule->getLineNo(), $oRule->getColNo());
587
+ foreach ($aNewValues as $mValue) {
588
+ $oNewRule->addValue($mValue);
589
+ }
590
+ $this->addRule($oNewRule);
591
+ }
592
+ }
593
+
594
+ /**
595
+ * @return void
596
+ */
597
+ public function createBackgroundShorthand()
598
+ {
599
+ $aProperties = [
600
+ 'background-color',
601
+ 'background-image',
602
+ 'background-repeat',
603
+ 'background-position',
604
+ 'background-attachment',
605
+ ];
606
+ $this->createShorthandProperties($aProperties, 'background');
607
+ }
608
+
609
+ /**
610
+ * @return void
611
+ */
612
+ public function createListStyleShorthand()
613
+ {
614
+ $aProperties = [
615
+ 'list-style-type',
616
+ 'list-style-position',
617
+ 'list-style-image',
618
+ ];
619
+ $this->createShorthandProperties($aProperties, 'list-style');
620
+ }
621
+
622
+ /**
623
+ * Combines `border-color`, `border-style` and `border-width` into `border`.
624
+ *
625
+ * Should be run after `create_dimensions_shorthand`!
626
+ *
627
+ * @return void
628
+ */
629
+ public function createBorderShorthand()
630
+ {
631
+ $aProperties = [
632
+ 'border-width',
633
+ 'border-style',
634
+ 'border-color',
635
+ ];
636
+ $this->createShorthandProperties($aProperties, 'border');
637
+ }
638
+
639
+ /**
640
+ * Looks for long format CSS dimensional properties
641
+ * (margin, padding, border-color, border-style and border-width)
642
+ * and converts them into shorthand CSS properties.
643
+ *
644
+ * @return void
645
+ */
646
+ public function createDimensionsShorthand()
647
+ {
648
+ $aPositions = ['top', 'right', 'bottom', 'left'];
649
+ $aExpansions = [
650
+ 'margin' => 'margin-%s',
651
+ 'padding' => 'padding-%s',
652
+ 'border-color' => 'border-%s-color',
653
+ 'border-style' => 'border-%s-style',
654
+ 'border-width' => 'border-%s-width',
655
+ ];
656
+ $aRules = $this->getRulesAssoc();
657
+ foreach ($aExpansions as $sProperty => $sExpanded) {
658
+ $aFoldable = [];
659
+ foreach ($aRules as $sRuleName => $oRule) {
660
+ foreach ($aPositions as $sPosition) {
661
+ if ($sRuleName == sprintf($sExpanded, $sPosition)) {
662
+ $aFoldable[$sRuleName] = $oRule;
663
+ }
664
+ }
665
+ }
666
+ // All four dimensions must be present
667
+ if (count($aFoldable) == 4) {
668
+ $aValues = [];
669
+ foreach ($aPositions as $sPosition) {
670
+ $oRule = $aRules[sprintf($sExpanded, $sPosition)];
671
+ $mRuleValue = $oRule->getValue();
672
+ $aRuleValues = [];
673
+ if (!$mRuleValue instanceof RuleValueList) {
674
+ $aRuleValues[] = $mRuleValue;
675
+ } else {
676
+ $aRuleValues = $mRuleValue->getListComponents();
677
+ }
678
+ $aValues[$sPosition] = $aRuleValues;
679
+ }
680
+ $oNewRule = new Rule($sProperty, $oRule->getLineNo(), $oRule->getColNo());
681
+ if ((string)$aValues['left'][0] == (string)$aValues['right'][0]) {
682
+ if ((string)$aValues['top'][0] == (string)$aValues['bottom'][0]) {
683
+ if ((string)$aValues['top'][0] == (string)$aValues['left'][0]) {
684
+ // All 4 sides are equal
685
+ $oNewRule->addValue($aValues['top']);
686
+ } else {
687
+ // Top and bottom are equal, left and right are equal
688
+ $oNewRule->addValue($aValues['top']);
689
+ $oNewRule->addValue($aValues['left']);
690
+ }
691
+ } else {
692
+ // Only left and right are equal
693
+ $oNewRule->addValue($aValues['top']);
694
+ $oNewRule->addValue($aValues['left']);
695
+ $oNewRule->addValue($aValues['bottom']);
696
+ }
697
+ } else {
698
+ // No sides are equal
699
+ $oNewRule->addValue($aValues['top']);
700
+ $oNewRule->addValue($aValues['left']);
701
+ $oNewRule->addValue($aValues['bottom']);
702
+ $oNewRule->addValue($aValues['right']);
703
+ }
704
+ $this->addRule($oNewRule);
705
+ foreach ($aPositions as $sPosition) {
706
+ $this->removeRule(sprintf($sExpanded, $sPosition));
707
+ }
708
+ }
709
+ }
710
+ }
711
+
712
+ /**
713
+ * Looks for long format CSS font properties (e.g. `font-weight`) and
714
+ * tries to convert them into a shorthand CSS `font` property.
715
+ *
716
+ * At least `font-size` AND `font-family` must be present in order to create a shorthand declaration.
717
+ *
718
+ * @return void
719
+ */
720
+ public function createFontShorthand()
721
+ {
722
+ $aFontProperties = [
723
+ 'font-style',
724
+ 'font-variant',
725
+ 'font-weight',
726
+ 'font-size',
727
+ 'line-height',
728
+ 'font-family',
729
+ ];
730
+ $aRules = $this->getRulesAssoc();
731
+ if (!isset($aRules['font-size']) || !isset($aRules['font-family'])) {
732
+ return;
733
+ }
734
+ $oOldRule = isset($aRules['font-size']) ? $aRules['font-size'] : $aRules['font-family'];
735
+ $oNewRule = new Rule('font', $oOldRule->getLineNo(), $oOldRule->getColNo());
736
+ unset($oOldRule);
737
+ foreach (['font-style', 'font-variant', 'font-weight'] as $sProperty) {
738
+ if (isset($aRules[$sProperty])) {
739
+ $oRule = $aRules[$sProperty];
740
+ $mRuleValue = $oRule->getValue();
741
+ $aValues = [];
742
+ if (!$mRuleValue instanceof RuleValueList) {
743
+ $aValues[] = $mRuleValue;
744
+ } else {
745
+ $aValues = $mRuleValue->getListComponents();
746
+ }
747
+ if ($aValues[0] !== 'normal') {
748
+ $oNewRule->addValue($aValues[0]);
749
+ }
750
+ }
751
+ }
752
+ // Get the font-size value
753
+ $oRule = $aRules['font-size'];
754
+ $mRuleValue = $oRule->getValue();
755
+ $aFSValues = [];
756
+ if (!$mRuleValue instanceof RuleValueList) {
757
+ $aFSValues[] = $mRuleValue;
758
+ } else {
759
+ $aFSValues = $mRuleValue->getListComponents();
760
+ }
761
+ // But wait to know if we have line-height to add it
762
+ if (isset($aRules['line-height'])) {
763
+ $oRule = $aRules['line-height'];
764
+ $mRuleValue = $oRule->getValue();
765
+ $aLHValues = [];
766
+ if (!$mRuleValue instanceof RuleValueList) {
767
+ $aLHValues[] = $mRuleValue;
768
+ } else {
769
+ $aLHValues = $mRuleValue->getListComponents();
770
+ }
771
+ if ($aLHValues[0] !== 'normal') {
772
+ $val = new RuleValueList('/', $this->iLineNo);
773
+ $val->addListComponent($aFSValues[0]);
774
+ $val->addListComponent($aLHValues[0]);
775
+ $oNewRule->addValue($val);
776
+ }
777
+ } else {
778
+ $oNewRule->addValue($aFSValues[0]);
779
+ }
780
+ $oRule = $aRules['font-family'];
781
+ $mRuleValue = $oRule->getValue();
782
+ $aFFValues = [];
783
+ if (!$mRuleValue instanceof RuleValueList) {
784
+ $aFFValues[] = $mRuleValue;
785
+ } else {
786
+ $aFFValues = $mRuleValue->getListComponents();
787
+ }
788
+ $oFFValue = new RuleValueList(',', $this->iLineNo);
789
+ $oFFValue->setListComponents($aFFValues);
790
+ $oNewRule->addValue($oFFValue);
791
+
792
+ $this->addRule($oNewRule);
793
+ foreach ($aFontProperties as $sProperty) {
794
+ $this->removeRule($sProperty);
795
+ }
796
+ }
797
+
798
+ /**
799
+ * @return string
800
+ *
801
+ * @throws OutputException
802
+ */
803
+ public function __toString()
804
+ {
805
+ return $this->render(new OutputFormat());
806
+ }
807
+
808
+ /**
809
+ * @return string
810
+ *
811
+ * @throws OutputException
812
+ */
813
+ public function render(OutputFormat $oOutputFormat)
814
+ {
815
+ if (count($this->aSelectors) === 0) {
816
+ // If all the selectors have been removed, this declaration block becomes invalid
817
+ throw new OutputException("Attempt to print declaration block with missing selector", $this->iLineNo);
818
+ }
819
+ $sResult = $oOutputFormat->sBeforeDeclarationBlock;
820
+ $sResult .= $oOutputFormat->implode(
821
+ $oOutputFormat->spaceBeforeSelectorSeparator() . ',' . $oOutputFormat->spaceAfterSelectorSeparator(),
822
+ $this->aSelectors
823
+ );
824
+ $sResult .= $oOutputFormat->sAfterDeclarationBlockSelectors;
825
+ $sResult .= $oOutputFormat->spaceBeforeOpeningBrace() . '{';
826
+ $sResult .= parent::render($oOutputFormat);
827
+ $sResult .= '}';
828
+ $sResult .= $oOutputFormat->sAfterDeclarationBlock;
829
+ return $sResult;
830
+ }
831
+ }
vendor/sabberworm/php-css-parser/src/RuleSet/RuleSet.php ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\RuleSet;
4
+
5
+ use Sabberworm\CSS\Comment\Comment;
6
+ use Sabberworm\CSS\Comment\Commentable;
7
+ use Sabberworm\CSS\OutputFormat;
8
+ use Sabberworm\CSS\Parsing\ParserState;
9
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
10
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
11
+ use Sabberworm\CSS\Renderable;
12
+ use Sabberworm\CSS\Rule\Rule;
13
+
14
+ /**
15
+ * RuleSet is a generic superclass denoting rules. The typical example for rule sets are declaration block.
16
+ * However, unknown At-Rules (like `@font-face`) are also rule sets.
17
+ */
18
+ abstract class RuleSet implements Renderable, Commentable
19
+ {
20
+ /**
21
+ * @var array<string, Rule>
22
+ */
23
+ private $aRules;
24
+
25
+ /**
26
+ * @var int
27
+ */
28
+ protected $iLineNo;
29
+
30
+ /**
31
+ * @var array<array-key, Comment>
32
+ */
33
+ protected $aComments;
34
+
35
+ /**
36
+ * @param int $iLineNo
37
+ */
38
+ public function __construct($iLineNo = 0)
39
+ {
40
+ $this->aRules = [];
41
+ $this->iLineNo = $iLineNo;
42
+ $this->aComments = [];
43
+ }
44
+
45
+ /**
46
+ * @return void
47
+ *
48
+ * @throws UnexpectedTokenException
49
+ * @throws UnexpectedEOFException
50
+ */
51
+ public static function parseRuleSet(ParserState $oParserState, RuleSet $oRuleSet)
52
+ {
53
+ while ($oParserState->comes(';')) {
54
+ $oParserState->consume(';');
55
+ }
56
+ while (!$oParserState->comes('}')) {
57
+ $oRule = null;
58
+ if ($oParserState->getSettings()->bLenientParsing) {
59
+ try {
60
+ $oRule = Rule::parse($oParserState);
61
+ } catch (UnexpectedTokenException $e) {
62
+ try {
63
+ $sConsume = $oParserState->consumeUntil(["\n", ";", '}'], true);
64
+ // We need to “unfind” the matches to the end of the ruleSet as this will be matched later
65
+ if ($oParserState->streql(substr($sConsume, -1), '}')) {
66
+ $oParserState->backtrack(1);
67
+ } else {
68
+ while ($oParserState->comes(';')) {
69
+ $oParserState->consume(';');
70
+ }
71
+ }
72
+ } catch (UnexpectedTokenException $e) {
73
+ // We’ve reached the end of the document. Just close the RuleSet.
74
+ return;
75
+ }
76
+ }
77
+ } else {
78
+ $oRule = Rule::parse($oParserState);
79
+ }
80
+ if ($oRule) {
81
+ $oRuleSet->addRule($oRule);
82
+ }
83
+ }
84
+ $oParserState->consume('}');
85
+ }
86
+
87
+ /**
88
+ * @return int
89
+ */
90
+ public function getLineNo()
91
+ {
92
+ return $this->iLineNo;
93
+ }
94
+
95
+ /**
96
+ * @param Rule|null $oSibling
97
+ *
98
+ * @return void
99
+ */
100
+ public function addRule(Rule $oRule, Rule $oSibling = null)
101
+ {
102
+ $sRule = $oRule->getRule();
103
+ if (!isset($this->aRules[$sRule])) {
104
+ $this->aRules[$sRule] = [];
105
+ }
106
+
107
+ $iPosition = count($this->aRules[$sRule]);
108
+
109
+ if ($oSibling !== null) {
110
+ $iSiblingPos = array_search($oSibling, $this->aRules[$sRule], true);
111
+ if ($iSiblingPos !== false) {
112
+ $iPosition = $iSiblingPos;
113
+ $oRule->setPosition($oSibling->getLineNo(), $oSibling->getColNo() - 1);
114
+ }
115
+ }
116
+ if ($oRule->getLineNo() === 0 && $oRule->getColNo() === 0) {
117
+ //this node is added manually, give it the next best line
118
+ $rules = $this->getRules();
119
+ $pos = count($rules);
120
+ if ($pos > 0) {
121
+ $last = $rules[$pos - 1];
122
+ $oRule->setPosition($last->getLineNo() + 1, 0);
123
+ }
124
+ }
125
+
126
+ array_splice($this->aRules[$sRule], $iPosition, 0, [$oRule]);
127
+ }
128
+
129
+ /**
130
+ * Returns all rules matching the given rule name
131
+ *
132
+ * @example $oRuleSet->getRules('font') // returns array(0 => $oRule, …) or array().
133
+ *
134
+ * @example $oRuleSet->getRules('font-')
135
+ * //returns an array of all rules either beginning with font- or matching font.
136
+ *
137
+ * @param Rule|string|null $mRule
138
+ * Pattern to search for. If null, returns all rules.
139
+ * If the pattern ends with a dash, all rules starting with the pattern are returned
140
+ * as well as one matching the pattern with the dash excluded.
141
+ * Passing a Rule behaves like calling `getRules($mRule->getRule())`.
142
+ *
143
+ * @return array<int, Rule>
144
+ */
145
+ public function getRules($mRule = null)
146
+ {
147
+ if ($mRule instanceof Rule) {
148
+ $mRule = $mRule->getRule();
149
+ }
150
+ /** @var array<int, Rule> $aResult */
151
+ $aResult = [];
152
+ foreach ($this->aRules as $sName => $aRules) {
153
+ // Either no search rule is given or the search rule matches the found rule exactly
154
+ // or the search rule ends in “-” and the found rule starts with the search rule.
155
+ if (
156
+ !$mRule || $sName === $mRule
157
+ || (
158
+ strrpos($mRule, '-') === strlen($mRule) - strlen('-')
159
+ && (strpos($sName, $mRule) === 0 || $sName === substr($mRule, 0, -1))
160
+ )
161
+ ) {
162
+ $aResult = array_merge($aResult, $aRules);
163
+ }
164
+ }
165
+ usort($aResult, function (Rule $first, Rule $second) {
166
+ if ($first->getLineNo() === $second->getLineNo()) {
167
+ return $first->getColNo() - $second->getColNo();
168
+ }
169
+ return $first->getLineNo() - $second->getLineNo();
170
+ });
171
+ return $aResult;
172
+ }
173
+
174
+ /**
175
+ * Overrides all the rules of this set.
176
+ *
177
+ * @param array<array-key, Rule> $aRules The rules to override with.
178
+ *
179
+ * @return void
180
+ */
181
+ public function setRules(array $aRules)
182
+ {
183
+ $this->aRules = [];
184
+ foreach ($aRules as $rule) {
185
+ $this->addRule($rule);
186
+ }
187
+ }
188
+
189
+ /**
190
+ * Returns all rules matching the given pattern and returns them in an associative array with the rule’s name
191
+ * as keys. This method exists mainly for backwards-compatibility and is really only partially useful.
192
+ *
193
+ * Note: This method loses some information: Calling this (with an argument of `background-`) on a declaration block
194
+ * like `{ background-color: green; background-color; rgba(0, 127, 0, 0.7); }` will only yield an associative array
195
+ * containing the rgba-valued rule while `getRules()` would yield an indexed array containing both.
196
+ *
197
+ * @param Rule|string|null $mRule $mRule
198
+ * Pattern to search for. If null, returns all rules. If the pattern ends with a dash,
199
+ * all rules starting with the pattern are returned as well as one matching the pattern with the dash
200
+ * excluded. Passing a Rule behaves like calling `getRules($mRule->getRule())`.
201
+ *
202
+ * @return array<string, Rule>
203
+ */
204
+ public function getRulesAssoc($mRule = null)
205
+ {
206
+ /** @var array<string, Rule> $aResult */
207
+ $aResult = [];
208
+ foreach ($this->getRules($mRule) as $oRule) {
209
+ $aResult[$oRule->getRule()] = $oRule;
210
+ }
211
+ return $aResult;
212
+ }
213
+
214
+ /**
215
+ * Removes a rule from this RuleSet. This accepts all the possible values that `getRules()` accepts.
216
+ *
217
+ * If given a Rule, it will only remove this particular rule (by identity).
218
+ * If given a name, it will remove all rules by that name.
219
+ *
220
+ * Note: this is different from pre-v.2.0 behaviour of PHP-CSS-Parser, where passing a Rule instance would
221
+ * remove all rules with the same name. To get the old behaviour, use `removeRule($oRule->getRule())`.
222
+ *
223
+ * @param Rule|string|null $mRule
224
+ * pattern to remove. If $mRule is null, all rules are removed. If the pattern ends in a dash,
225
+ * all rules starting with the pattern are removed as well as one matching the pattern with the dash
226
+ * excluded. Passing a Rule behaves matches by identity.
227
+ *
228
+ * @return void
229
+ */
230
+ public function removeRule($mRule)
231
+ {
232
+ if ($mRule instanceof Rule) {
233
+ $sRule = $mRule->getRule();
234
+ if (!isset($this->aRules[$sRule])) {
235
+ return;
236
+ }
237
+ foreach ($this->aRules[$sRule] as $iKey => $oRule) {
238
+ if ($oRule === $mRule) {
239
+ unset($this->aRules[$sRule][$iKey]);
240
+ }
241
+ }
242
+ } else {
243
+ foreach ($this->aRules as $sName => $aRules) {
244
+ // Either no search rule is given or the search rule matches the found rule exactly
245
+ // or the search rule ends in “-” and the found rule starts with the search rule or equals it
246
+ // (without the trailing dash).
247
+ if (
248
+ !$mRule || $sName === $mRule
249
+ || (strrpos($mRule, '-') === strlen($mRule) - strlen('-')
250
+ && (strpos($sName, $mRule) === 0 || $sName === substr($mRule, 0, -1)))
251
+ ) {
252
+ unset($this->aRules[$sName]);
253
+ }
254
+ }
255
+ }
256
+ }
257
+
258
+ /**
259
+ * @return string
260
+ */
261
+ public function __toString()
262
+ {
263
+ return $this->render(new OutputFormat());
264
+ }
265
+
266
+ /**
267
+ * @return string
268
+ */
269
+ public function render(OutputFormat $oOutputFormat)
270
+ {
271
+ $sResult = '';
272
+ $bIsFirst = true;
273
+ foreach ($this->aRules as $aRules) {
274
+ foreach ($aRules as $oRule) {
275
+ $sRendered = $oOutputFormat->safely(function () use ($oRule, $oOutputFormat) {
276
+ return $oRule->render($oOutputFormat->nextLevel());
277
+ });
278
+ if ($sRendered === null) {
279
+ continue;
280
+ }
281
+ if ($bIsFirst) {
282
+ $bIsFirst = false;
283
+ $sResult .= $oOutputFormat->nextLevel()->spaceBeforeRules();
284
+ } else {
285
+ $sResult .= $oOutputFormat->nextLevel()->spaceBetweenRules();
286
+ }
287
+ $sResult .= $sRendered;
288
+ }
289
+ }
290
+
291
+ if (!$bIsFirst) {
292
+ // Had some output
293
+ $sResult .= $oOutputFormat->spaceAfterRules();
294
+ }
295
+
296
+ return $oOutputFormat->removeLastSemicolon($sResult);
297
+ }
298
+
299
+ /**
300
+ * @param array<string, Comment> $aComments
301
+ *
302
+ * @return void
303
+ */
304
+ public function addComments(array $aComments)
305
+ {
306
+ $this->aComments = array_merge($this->aComments, $aComments);
307
+ }
308
+
309
+ /**
310
+ * @return array<string, Comment>
311
+ */
312
+ public function getComments()
313
+ {
314
+ return $this->aComments;
315
+ }
316
+
317
+ /**
318
+ * @param array<string, Comment> $aComments
319
+ *
320
+ * @return void
321
+ */
322
+ public function setComments(array $aComments)
323
+ {
324
+ $this->aComments = $aComments;
325
+ }
326
+ }
vendor/sabberworm/php-css-parser/src/Settings.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS;
4
+
5
+ /**
6
+ * Parser settings class.
7
+ *
8
+ * Configure parser behaviour here.
9
+ */
10
+ class Settings
11
+ {
12
+ /**
13
+ * Multi-byte string support.
14
+ * If true (mbstring extension must be enabled), will use (slower) `mb_strlen`, `mb_convert_case`, `mb_substr`
15
+ * and `mb_strpos` functions. Otherwise, the normal (ASCII-Only) functions will be used.
16
+ *
17
+ * @var bool
18
+ */
19
+ public $bMultibyteSupport;
20
+
21
+ /**
22
+ * The default charset for the CSS if no `@charset` rule is found. Defaults to utf-8.
23
+ *
24
+ * @var string
25
+ */
26
+ public $sDefaultCharset = 'utf-8';
27
+
28
+ /**
29
+ * Lenient parsing. When used (which is true by default), the parser will not choke
30
+ * on unexpected tokens but simply ignore them.
31
+ *
32
+ * @var bool
33
+ */
34
+ public $bLenientParsing = true;
35
+
36
+ private function __construct()
37
+ {
38
+ $this->bMultibyteSupport = extension_loaded('mbstring');
39
+ }
40
+
41
+ /**
42
+ * @return self new instance
43
+ */
44
+ public static function create()
45
+ {
46
+ return new Settings();
47
+ }
48
+
49
+ /**
50
+ * @param bool $bMultibyteSupport
51
+ *
52
+ * @return self fluent interface
53
+ */
54
+ public function withMultibyteSupport($bMultibyteSupport = true)
55
+ {
56
+ $this->bMultibyteSupport = $bMultibyteSupport;
57
+ return $this;
58
+ }
59
+
60
+ /**
61
+ * @param string $sDefaultCharset
62
+ *
63
+ * @return self fluent interface
64
+ */
65
+ public function withDefaultCharset($sDefaultCharset)
66
+ {
67
+ $this->sDefaultCharset = $sDefaultCharset;
68
+ return $this;
69
+ }
70
+
71
+ /**
72
+ * @param bool $bLenientParsing
73
+ *
74
+ * @return self fluent interface
75
+ */
76
+ public function withLenientParsing($bLenientParsing = true)
77
+ {
78
+ $this->bLenientParsing = $bLenientParsing;
79
+ return $this;
80
+ }
81
+
82
+ /**
83
+ * @return self fluent interface
84
+ */
85
+ public function beStrict()
86
+ {
87
+ return $this->withLenientParsing(false);
88
+ }
89
+ }
vendor/sabberworm/php-css-parser/src/Value/CSSFunction.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+
7
+ class CSSFunction extends ValueList
8
+ {
9
+ /**
10
+ * @var string
11
+ */
12
+ protected $sName;
13
+
14
+ /**
15
+ * @param string $sName
16
+ * @param RuleValueList|array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string> $aArguments
17
+ * @param string $sSeparator
18
+ * @param int $iLineNo
19
+ */
20
+ public function __construct($sName, $aArguments, $sSeparator = ',', $iLineNo = 0)
21
+ {
22
+ if ($aArguments instanceof RuleValueList) {
23
+ $sSeparator = $aArguments->getListSeparator();
24
+ $aArguments = $aArguments->getListComponents();
25
+ }
26
+ $this->sName = $sName;
27
+ $this->iLineNo = $iLineNo;
28
+ parent::__construct($aArguments, $sSeparator, $iLineNo);
29
+ }
30
+
31
+ /**
32
+ * @return string
33
+ */
34
+ public function getName()
35
+ {
36
+ return $this->sName;
37
+ }
38
+
39
+ /**
40
+ * @param string $sName
41
+ *
42
+ * @return void
43
+ */
44
+ public function setName($sName)
45
+ {
46
+ $this->sName = $sName;
47
+ }
48
+
49
+ /**
50
+ * @return array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string>
51
+ */
52
+ public function getArguments()
53
+ {
54
+ return $this->aComponents;
55
+ }
56
+
57
+ /**
58
+ * @return string
59
+ */
60
+ public function __toString()
61
+ {
62
+ return $this->render(new OutputFormat());
63
+ }
64
+
65
+ /**
66
+ * @return string
67
+ */
68
+ public function render(OutputFormat $oOutputFormat)
69
+ {
70
+ $aArguments = parent::render($oOutputFormat);
71
+ return "{$this->sName}({$aArguments})";
72
+ }
73
+ }
vendor/sabberworm/php-css-parser/src/Value/CSSString.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+ use Sabberworm\CSS\Parsing\ParserState;
7
+ use Sabberworm\CSS\Parsing\SourceException;
8
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
9
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
10
+
11
+ class CSSString extends PrimitiveValue
12
+ {
13
+ /**
14
+ * @var string
15
+ */
16
+ private $sString;
17
+
18
+ /**
19
+ * @param string $sString
20
+ * @param int $iLineNo
21
+ */
22
+ public function __construct($sString, $iLineNo = 0)
23
+ {
24
+ $this->sString = $sString;
25
+ parent::__construct($iLineNo);
26
+ }
27
+
28
+ /**
29
+ * @return CSSString
30
+ *
31
+ * @throws SourceException
32
+ * @throws UnexpectedEOFException
33
+ * @throws UnexpectedTokenException
34
+ */
35
+ public static function parse(ParserState $oParserState)
36
+ {
37
+ $sBegin = $oParserState->peek();
38
+ $sQuote = null;
39
+ if ($sBegin === "'") {
40
+ $sQuote = "'";
41
+ } elseif ($sBegin === '"') {
42
+ $sQuote = '"';
43
+ }
44
+ if ($sQuote !== null) {
45
+ $oParserState->consume($sQuote);
46
+ }
47
+ $sResult = "";
48
+ $sContent = null;
49
+ if ($sQuote === null) {
50
+ // Unquoted strings end in whitespace or with braces, brackets, parentheses
51
+ while (!preg_match('/[\\s{}()<>\\[\\]]/isu', $oParserState->peek())) {
52
+ $sResult .= $oParserState->parseCharacter(false);
53
+ }
54
+ } else {
55
+ while (!$oParserState->comes($sQuote)) {
56
+ $sContent = $oParserState->parseCharacter(false);
57
+ if ($sContent === null) {
58
+ throw new SourceException(
59
+ "Non-well-formed quoted string {$oParserState->peek(3)}",
60
+ $oParserState->currentLine()
61
+ );
62
+ }
63
+ $sResult .= $sContent;
64
+ }
65
+ $oParserState->consume($sQuote);
66
+ }
67
+ return new CSSString($sResult, $oParserState->currentLine());
68
+ }
69
+
70
+ /**
71
+ * @param string $sString
72
+ *
73
+ * @return void
74
+ */
75
+ public function setString($sString)
76
+ {
77
+ $this->sString = $sString;
78
+ }
79
+
80
+ /**
81
+ * @return string
82
+ */
83
+ public function getString()
84
+ {
85
+ return $this->sString;
86
+ }
87
+
88
+ /**
89
+ * @return string
90
+ */
91
+ public function __toString()
92
+ {
93
+ return $this->render(new OutputFormat());
94
+ }
95
+
96
+ /**
97
+ * @return string
98
+ */
99
+ public function render(OutputFormat $oOutputFormat)
100
+ {
101
+ $sString = addslashes($this->sString);
102
+ $sString = str_replace("\n", '\A', $sString);
103
+ return $oOutputFormat->getStringQuotingType() . $sString . $oOutputFormat->getStringQuotingType();
104
+ }
105
+ }
vendor/sabberworm/php-css-parser/src/Value/CalcFunction.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ use Sabberworm\CSS\Parsing\ParserState;
6
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
7
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
8
+
9
+ class CalcFunction extends CSSFunction
10
+ {
11
+ /**
12
+ * @var int
13
+ */
14
+ const T_OPERAND = 1;
15
+
16
+ /**
17
+ * @var int
18
+ */
19
+ const T_OPERATOR = 2;
20
+
21
+ /**
22
+ * @return CalcFunction
23
+ *
24
+ * @throws UnexpectedTokenException
25
+ * @throws UnexpectedEOFException
26
+ */
27
+ public static function parse(ParserState $oParserState)
28
+ {
29
+ $aOperators = ['+', '-', '*', '/'];
30
+ $sFunction = trim($oParserState->consumeUntil('(', false, true));
31
+ $oCalcList = new CalcRuleValueList($oParserState->currentLine());
32
+ $oList = new RuleValueList(',', $oParserState->currentLine());
33
+ $iNestingLevel = 0;
34
+ $iLastComponentType = null;
35
+ while (!$oParserState->comes(')') || $iNestingLevel > 0) {
36
+ $oParserState->consumeWhiteSpace();
37
+ if ($oParserState->comes('(')) {
38
+ $iNestingLevel++;
39
+ $oCalcList->addListComponent($oParserState->consume(1));
40
+ $oParserState->consumeWhiteSpace();
41
+ continue;
42
+ } elseif ($oParserState->comes(')')) {
43
+ $iNestingLevel--;
44
+ $oCalcList->addListComponent($oParserState->consume(1));
45
+ $oParserState->consumeWhiteSpace();
46
+ continue;
47
+ }
48
+ if ($iLastComponentType != CalcFunction::T_OPERAND) {
49
+ $oVal = Value::parsePrimitiveValue($oParserState);
50
+ $oCalcList->addListComponent($oVal);
51
+ $iLastComponentType = CalcFunction::T_OPERAND;
52
+ } else {
53
+ if (in_array($oParserState->peek(), $aOperators)) {
54
+ if (($oParserState->comes('-') || $oParserState->comes('+'))) {
55
+ if (
56
+ $oParserState->peek(1, -1) != ' '
57
+ || !($oParserState->comes('- ')
58
+ || $oParserState->comes('+ '))
59
+ ) {
60
+ throw new UnexpectedTokenException(
61
+ " {$oParserState->peek()} ",
62
+ $oParserState->peek(1, -1) . $oParserState->peek(2),
63
+ 'literal',
64
+ $oParserState->currentLine()
65
+ );
66
+ }
67
+ }
68
+ $oCalcList->addListComponent($oParserState->consume(1));
69
+ $iLastComponentType = CalcFunction::T_OPERATOR;
70
+ } else {
71
+ throw new UnexpectedTokenException(
72
+ sprintf(
73
+ 'Next token was expected to be an operand of type %s. Instead "%s" was found.',
74
+ implode(', ', $aOperators),
75
+ $oVal
76
+ ),
77
+ '',
78
+ 'custom',
79
+ $oParserState->currentLine()
80
+ );
81
+ }
82
+ }
83
+ $oParserState->consumeWhiteSpace();
84
+ }
85
+ $oList->addListComponent($oCalcList);
86
+ $oParserState->consume(')');
87
+ return new CalcFunction($sFunction, $oList, ',', $oParserState->currentLine());
88
+ }
89
+ }
vendor/sabberworm/php-css-parser/src/Value/CalcRuleValueList.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+
7
+ class CalcRuleValueList extends RuleValueList
8
+ {
9
+ /**
10
+ * @param int $iLineNo
11
+ */
12
+ public function __construct($iLineNo = 0)
13
+ {
14
+ parent::__construct(',', $iLineNo);
15
+ }
16
+
17
+ /**
18
+ * @return string
19
+ */
20
+ public function render(OutputFormat $oOutputFormat)
21
+ {
22
+ return $oOutputFormat->implode(' ', $this->aComponents);
23
+ }
24
+ }
vendor/sabberworm/php-css-parser/src/Value/Color.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+ use Sabberworm\CSS\Parsing\ParserState;
7
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
8
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
9
+
10
+ class Color extends CSSFunction
11
+ {
12
+ /**
13
+ * @param array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string> $aColor
14
+ * @param int $iLineNo
15
+ */
16
+ public function __construct(array $aColor, $iLineNo = 0)
17
+ {
18
+ parent::__construct(implode('', array_keys($aColor)), $aColor, ',', $iLineNo);
19
+ }
20
+
21
+ /**
22
+ * @return Color|CSSFunction
23
+ *
24
+ * @throws UnexpectedEOFException
25
+ * @throws UnexpectedTokenException
26
+ */
27
+ public static function parse(ParserState $oParserState)
28
+ {
29
+ $aColor = [];
30
+ if ($oParserState->comes('#')) {
31
+ $oParserState->consume('#');
32
+ $sValue = $oParserState->parseIdentifier(false);
33
+ if ($oParserState->strlen($sValue) === 3) {
34
+ $sValue = $sValue[0] . $sValue[0] . $sValue[1] . $sValue[1] . $sValue[2] . $sValue[2];
35
+ } elseif ($oParserState->strlen($sValue) === 4) {
36
+ $sValue = $sValue[0] . $sValue[0] . $sValue[1] . $sValue[1] . $sValue[2] . $sValue[2] . $sValue[3]
37
+ . $sValue[3];
38
+ }
39
+
40
+ if ($oParserState->strlen($sValue) === 8) {
41
+ $aColor = [
42
+ 'r' => new Size(intval($sValue[0] . $sValue[1], 16), null, true, $oParserState->currentLine()),
43
+ 'g' => new Size(intval($sValue[2] . $sValue[3], 16), null, true, $oParserState->currentLine()),
44
+ 'b' => new Size(intval($sValue[4] . $sValue[5], 16), null, true, $oParserState->currentLine()),
45
+ 'a' => new Size(
46
+ round(self::mapRange(intval($sValue[6] . $sValue[7], 16), 0, 255, 0, 1), 2),
47
+ null,
48
+ true,
49
+ $oParserState->currentLine()
50
+ ),
51
+ ];
52
+ } else {
53
+ $aColor = [
54
+ 'r' => new Size(intval($sValue[0] . $sValue[1], 16), null, true, $oParserState->currentLine()),
55
+ 'g' => new Size(intval($sValue[2] . $sValue[3], 16), null, true, $oParserState->currentLine()),
56
+ 'b' => new Size(intval($sValue[4] . $sValue[5], 16), null, true, $oParserState->currentLine()),
57
+ ];
58
+ }
59
+ } else {
60
+ $sColorMode = $oParserState->parseIdentifier(true);
61
+ $oParserState->consumeWhiteSpace();
62
+ $oParserState->consume('(');
63
+
64
+ $bContainsVar = false;
65
+ $iLength = $oParserState->strlen($sColorMode);
66
+ for ($i = 0; $i < $iLength; ++$i) {
67
+ $oParserState->consumeWhiteSpace();
68
+ if ($oParserState->comes('var')) {
69
+ $aColor[$sColorMode[$i]] = CSSFunction::parseIdentifierOrFunction($oParserState);
70
+ $bContainsVar = true;
71
+ } else {
72
+ $aColor[$sColorMode[$i]] = Size::parse($oParserState, true);
73
+ }
74
+
75
+ if ($bContainsVar && $oParserState->comes(')')) {
76
+ // With a var argument the function can have fewer arguments
77
+ break;
78
+ }
79
+
80
+ $oParserState->consumeWhiteSpace();
81
+ if ($i < ($iLength - 1)) {
82
+ $oParserState->consume(',');
83
+ }
84
+ }
85
+ $oParserState->consume(')');
86
+
87
+ if ($bContainsVar) {
88
+ return new CSSFunction($sColorMode, array_values($aColor), ',', $oParserState->currentLine());
89
+ }
90
+ }
91
+ return new Color($aColor, $oParserState->currentLine());
92
+ }
93
+
94
+ /**
95
+ * @param float $fVal
96
+ * @param float $fFromMin
97
+ * @param float $fFromMax
98
+ * @param float $fToMin
99
+ * @param float $fToMax
100
+ *
101
+ * @return float
102
+ */
103
+ private static function mapRange($fVal, $fFromMin, $fFromMax, $fToMin, $fToMax)
104
+ {
105
+ $fFromRange = $fFromMax - $fFromMin;
106
+ $fToRange = $fToMax - $fToMin;
107
+ $fMultiplier = $fToRange / $fFromRange;
108
+ $fNewVal = $fVal - $fFromMin;
109
+ $fNewVal *= $fMultiplier;
110
+ return $fNewVal + $fToMin;
111
+ }
112
+
113
+ /**
114
+ * @return array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string>
115
+ */
116
+ public function getColor()
117
+ {
118
+ return $this->aComponents;
119
+ }
120
+
121
+ /**
122
+ * @param array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string> $aColor
123
+ *
124
+ * @return void
125
+ */
126
+ public function setColor(array $aColor)
127
+ {
128
+ $this->setName(implode('', array_keys($aColor)));
129
+ $this->aComponents = $aColor;
130
+ }
131
+
132
+ /**
133
+ * @return string
134
+ */
135
+ public function getColorDescription()
136
+ {
137
+ return $this->getName();
138
+ }
139
+
140
+ /**
141
+ * @return string
142
+ */
143
+ public function __toString()
144
+ {
145
+ return $this->render(new OutputFormat());
146
+ }
147
+
148
+ /**
149
+ * @return string
150
+ */
151
+ public function render(OutputFormat $oOutputFormat)
152
+ {
153
+ // Shorthand RGB color values
154
+ if ($oOutputFormat->getRGBHashNotation() && implode('', array_keys($this->aComponents)) === 'rgb') {
155
+ $sResult = sprintf(
156
+ '%02x%02x%02x',
157
+ $this->aComponents['r']->getSize(),
158
+ $this->aComponents['g']->getSize(),
159
+ $this->aComponents['b']->getSize()
160
+ );
161
+ return '#' . (($sResult[0] == $sResult[1]) && ($sResult[2] == $sResult[3]) && ($sResult[4] == $sResult[5])
162
+ ? "$sResult[0]$sResult[2]$sResult[4]" : $sResult);
163
+ }
164
+ return parent::render($oOutputFormat);
165
+ }
166
+ }
vendor/sabberworm/php-css-parser/src/Value/LineName.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+ use Sabberworm\CSS\Parsing\ParserState;
7
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
8
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
9
+
10
+ class LineName extends ValueList
11
+ {
12
+ /**
13
+ * @param array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string> $aComponents
14
+ * @param int $iLineNo
15
+ */
16
+ public function __construct(array $aComponents = [], $iLineNo = 0)
17
+ {
18
+ parent::__construct($aComponents, ' ', $iLineNo);
19
+ }
20
+
21
+ /**
22
+ * @return LineName
23
+ *
24
+ * @throws UnexpectedTokenException
25
+ * @throws UnexpectedEOFException
26
+ */
27
+ public static function parse(ParserState $oParserState)
28
+ {
29
+ $oParserState->consume('[');
30
+ $oParserState->consumeWhiteSpace();
31
+ $aNames = [];
32
+ do {
33
+ if ($oParserState->getSettings()->bLenientParsing) {
34
+ try {
35
+ $aNames[] = $oParserState->parseIdentifier();
36
+ } catch (UnexpectedTokenException $e) {
37
+ if (!$oParserState->comes(']')) {
38
+ throw $e;
39
+ }
40
+ }
41
+ } else {
42
+ $aNames[] = $oParserState->parseIdentifier();
43
+ }
44
+ $oParserState->consumeWhiteSpace();
45
+ } while (!$oParserState->comes(']'));
46
+ $oParserState->consume(']');
47
+ return new LineName($aNames, $oParserState->currentLine());
48
+ }
49
+
50
+ /**
51
+ * @return string
52
+ */
53
+ public function __toString()
54
+ {
55
+ return $this->render(new OutputFormat());
56
+ }
57
+
58
+ /**
59
+ * @return string
60
+ */
61
+ public function render(OutputFormat $oOutputFormat)
62
+ {
63
+ return '[' . parent::render(OutputFormat::createCompact()) . ']';
64
+ }
65
+ }
vendor/sabberworm/php-css-parser/src/Value/PrimitiveValue.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ abstract class PrimitiveValue extends Value
6
+ {
7
+ /**
8
+ * @param int $iLineNo
9
+ */
10
+ public function __construct($iLineNo = 0)
11
+ {
12
+ parent::__construct($iLineNo);
13
+ }
14
+ }
vendor/sabberworm/php-css-parser/src/Value/RuleValueList.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ class RuleValueList extends ValueList
6
+ {
7
+ /**
8
+ * @param string $sSeparator
9
+ * @param int $iLineNo
10
+ */
11
+ public function __construct($sSeparator = ',', $iLineNo = 0)
12
+ {
13
+ parent::__construct([], $sSeparator, $iLineNo);
14
+ }
15
+ }
vendor/sabberworm/php-css-parser/src/Value/Size.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+ use Sabberworm\CSS\Parsing\ParserState;
7
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
8
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
9
+
10
+ class Size extends PrimitiveValue
11
+ {
12
+ /**
13
+ * vh/vw/vm(ax)/vmin/rem are absolute insofar as they don’t scale to the immediate parent (only the viewport)
14
+ *
15
+ * @var array<int, string>
16
+ */
17
+ const ABSOLUTE_SIZE_UNITS = ['px', 'cm', 'mm', 'mozmm', 'in', 'pt', 'pc', 'vh', 'vw', 'vmin', 'vmax', 'rem'];
18
+
19
+ /**
20
+ * @var array<int, string>
21
+ */
22
+ const RELATIVE_SIZE_UNITS = ['%', 'em', 'ex', 'ch', 'fr'];
23
+
24
+ /**
25
+ * @var array<int, string>
26
+ */
27
+ const NON_SIZE_UNITS = ['deg', 'grad', 'rad', 's', 'ms', 'turns', 'Hz', 'kHz'];
28
+
29
+ /**
30
+ * @var array<int, array<string, string>>|null
31
+ */
32
+ private static $SIZE_UNITS = null;
33
+
34
+ /**
35
+ * @var float
36
+ */
37
+ private $fSize;
38
+
39
+ /**
40
+ * @var string|null
41
+ */
42
+ private $sUnit;
43
+
44
+ /**
45
+ * @var bool
46
+ */
47
+ private $bIsColorComponent;
48
+
49
+ /**
50
+ * @param float|int|string $fSize
51
+ * @param string|null $sUnit
52
+ * @param bool $bIsColorComponent
53
+ * @param int $iLineNo
54
+ */
55
+ public function __construct($fSize, $sUnit = null, $bIsColorComponent = false, $iLineNo = 0)
56
+ {
57
+ parent::__construct($iLineNo);
58
+ $this->fSize = (float)$fSize;
59
+ $this->sUnit = $sUnit;
60
+ $this->bIsColorComponent = $bIsColorComponent;
61
+ }
62
+
63
+ /**
64
+ * @param bool $bIsColorComponent
65
+ *
66
+ * @return Size
67
+ *
68
+ * @throws UnexpectedEOFException
69
+ * @throws UnexpectedTokenException
70
+ */
71
+ public static function parse(ParserState $oParserState, $bIsColorComponent = false)
72
+ {
73
+ $sSize = '';
74
+ if ($oParserState->comes('-')) {
75
+ $sSize .= $oParserState->consume('-');
76
+ }
77
+ while (is_numeric($oParserState->peek()) || $oParserState->comes('.')) {
78
+ if ($oParserState->comes('.')) {
79
+ $sSize .= $oParserState->consume('.');
80
+ } else {
81
+ $sSize .= $oParserState->consume(1);
82
+ }
83
+ }
84
+
85
+ $sUnit = null;
86
+ $aSizeUnits = self::getSizeUnits();
87
+ foreach ($aSizeUnits as $iLength => &$aValues) {
88
+ $sKey = strtolower($oParserState->peek($iLength));
89
+ if (array_key_exists($sKey, $aValues)) {
90
+ if (($sUnit = $aValues[$sKey]) !== null) {
91
+ $oParserState->consume($iLength);
92
+ break;
93
+ }
94
+ }
95
+ }
96
+ return new Size((float)$sSize, $sUnit, $bIsColorComponent, $oParserState->currentLine());
97
+ }
98
+
99
+ /**
100
+ * @return array<int, array<string, string>>
101
+ */
102
+ private static function getSizeUnits()
103
+ {
104
+ if (!is_array(self::$SIZE_UNITS)) {
105
+ self::$SIZE_UNITS = [];
106
+ foreach (array_merge(self::ABSOLUTE_SIZE_UNITS, self::RELATIVE_SIZE_UNITS, self::NON_SIZE_UNITS) as $val) {
107
+ $iSize = strlen($val);
108
+ if (!isset(self::$SIZE_UNITS[$iSize])) {
109
+ self::$SIZE_UNITS[$iSize] = [];
110
+ }
111
+ self::$SIZE_UNITS[$iSize][strtolower($val)] = $val;
112
+ }
113
+
114
+ krsort(self::$SIZE_UNITS, SORT_NUMERIC);
115
+ }
116
+
117
+ return self::$SIZE_UNITS;
118
+ }
119
+
120
+ /**
121
+ * @param string $sUnit
122
+ *
123
+ * @return void
124
+ */
125
+ public function setUnit($sUnit)
126
+ {
127
+ $this->sUnit = $sUnit;
128
+ }
129
+
130
+ /**
131
+ * @return string|null
132
+ */
133
+ public function getUnit()
134
+ {
135
+ return $this->sUnit;
136
+ }
137
+
138
+ /**
139
+ * @param float|int|string $fSize
140
+ */
141
+ public function setSize($fSize)
142
+ {
143
+ $this->fSize = (float)$fSize;
144
+ }
145
+
146
+ /**
147
+ * @return float
148
+ */
149
+ public function getSize()
150
+ {
151
+ return $this->fSize;
152
+ }
153
+
154
+ /**
155
+ * @return bool
156
+ */
157
+ public function isColorComponent()
158
+ {
159
+ return $this->bIsColorComponent;
160
+ }
161
+
162
+ /**
163
+ * Returns whether the number stored in this Size really represents a size (as in a length of something on screen).
164
+ *
165
+ * @return false if the unit an angle, a duration, a frequency or the number is a component in a Color object.
166
+ */
167
+ public function isSize()
168
+ {
169
+ if (in_array($this->sUnit, self::NON_SIZE_UNITS, true)) {
170
+ return false;
171
+ }
172
+ return !$this->isColorComponent();
173
+ }
174
+
175
+ /**
176
+ * @return bool
177
+ */
178
+ public function isRelative()
179
+ {
180
+ if (in_array($this->sUnit, self::RELATIVE_SIZE_UNITS, true)) {
181
+ return true;
182
+ }
183
+ if ($this->sUnit === null && $this->fSize != 0) {
184
+ return true;
185
+ }
186
+ return false;
187
+ }
188
+
189
+ /**
190
+ * @return string
191
+ */
192
+ public function __toString()
193
+ {
194
+ return $this->render(new OutputFormat());
195
+ }
196
+
197
+ /**
198
+ * @return string
199
+ */
200
+ public function render(OutputFormat $oOutputFormat)
201
+ {
202
+ $l = localeconv();
203
+ $sPoint = preg_quote($l['decimal_point'], '/');
204
+ $sSize = preg_match("/[\d\.]+e[+-]?\d+/i", (string)$this->fSize)
205
+ ? preg_replace("/$sPoint?0+$/", "", sprintf("%f", $this->fSize)) : $this->fSize;
206
+ return preg_replace(["/$sPoint/", "/^(-?)0\./"], ['.', '$1.'], $sSize)
207
+ . ($this->sUnit === null ? '' : $this->sUnit);
208
+ }
209
+ }
vendor/sabberworm/php-css-parser/src/Value/URL.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+ use Sabberworm\CSS\Parsing\ParserState;
7
+ use Sabberworm\CSS\Parsing\SourceException;
8
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
9
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
10
+
11
+ class URL extends PrimitiveValue
12
+ {
13
+ /**
14
+ * @var CSSString
15
+ */
16
+ private $oURL;
17
+
18
+ /**
19
+ * @param int $iLineNo
20
+ */
21
+ public function __construct(CSSString $oURL, $iLineNo = 0)
22
+ {
23
+ parent::__construct($iLineNo);
24
+ $this->oURL = $oURL;
25
+ }
26
+
27
+ /**
28
+ * @return URL
29
+ *
30
+ * @throws SourceException
31
+ * @throws UnexpectedEOFException
32
+ * @throws UnexpectedTokenException
33
+ */
34
+ public static function parse(ParserState $oParserState)
35
+ {
36
+ $bUseUrl = $oParserState->comes('url', true);
37
+ if ($bUseUrl) {
38
+ $oParserState->consume('url');
39
+ $oParserState->consumeWhiteSpace();
40
+ $oParserState->consume('(');
41
+ }
42
+ $oParserState->consumeWhiteSpace();
43
+ $oResult = new URL(CSSString::parse($oParserState), $oParserState->currentLine());
44
+ if ($bUseUrl) {
45
+ $oParserState->consumeWhiteSpace();
46
+ $oParserState->consume(')');
47
+ }
48
+ return $oResult;
49
+ }
50
+
51
+ /**
52
+ * @return void
53
+ */
54
+ public function setURL(CSSString $oURL)
55
+ {
56
+ $this->oURL = $oURL;
57
+ }
58
+
59
+ /**
60
+ * @return CSSString
61
+ */
62
+ public function getURL()
63
+ {
64
+ return $this->oURL;
65
+ }
66
+
67
+ /**
68
+ * @return string
69
+ */
70
+ public function __toString()
71
+ {
72
+ return $this->render(new OutputFormat());
73
+ }
74
+
75
+ /**
76
+ * @return string
77
+ */
78
+ public function render(OutputFormat $oOutputFormat)
79
+ {
80
+ return "url({$this->oURL->render($oOutputFormat)})";
81
+ }
82
+ }
vendor/sabberworm/php-css-parser/src/Value/Value.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ use Sabberworm\CSS\Parsing\ParserState;
6
+ use Sabberworm\CSS\Parsing\SourceException;
7
+ use Sabberworm\CSS\Parsing\UnexpectedEOFException;
8
+ use Sabberworm\CSS\Parsing\UnexpectedTokenException;
9
+ use Sabberworm\CSS\Renderable;
10
+
11
+ abstract class Value implements Renderable
12
+ {
13
+ /**
14
+ * @var int
15
+ */
16
+ protected $iLineNo;
17
+
18
+ /**
19
+ * @param int $iLineNo
20
+ */
21
+ public function __construct($iLineNo = 0)
22
+ {
23
+ $this->iLineNo = $iLineNo;
24
+ }
25
+
26
+ /**
27
+ * @param array<array-key, string> $aListDelimiters
28
+ *
29
+ * @return RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string
30
+ *
31
+ * @throws UnexpectedTokenException
32
+ * @throws UnexpectedEOFException
33
+ */
34
+ public static function parseValue(ParserState $oParserState, array $aListDelimiters = [])
35
+ {
36
+ /** @var array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string> $aStack */
37
+ $aStack = [];
38
+ $oParserState->consumeWhiteSpace();
39
+ //Build a list of delimiters and parsed values
40
+ while (
41
+ !($oParserState->comes('}') || $oParserState->comes(';') || $oParserState->comes('!')
42
+ || $oParserState->comes(')')
43
+ || $oParserState->comes('\\'))
44
+ ) {
45
+ if (count($aStack) > 0) {
46
+ $bFoundDelimiter = false;
47
+ foreach ($aListDelimiters as $sDelimiter) {
48
+ if ($oParserState->comes($sDelimiter)) {
49
+ array_push($aStack, $oParserState->consume($sDelimiter));
50
+ $oParserState->consumeWhiteSpace();
51
+ $bFoundDelimiter = true;
52
+ break;
53
+ }
54
+ }
55
+ if (!$bFoundDelimiter) {
56
+ //Whitespace was the list delimiter
57
+ array_push($aStack, ' ');
58
+ }
59
+ }
60
+ array_push($aStack, self::parsePrimitiveValue($oParserState));
61
+ $oParserState->consumeWhiteSpace();
62
+ }
63
+ // Convert the list to list objects
64
+ foreach ($aListDelimiters as $sDelimiter) {
65
+ if (count($aStack) === 1) {
66
+ return $aStack[0];
67
+ }
68
+ $iStartPosition = null;
69
+ while (($iStartPosition = array_search($sDelimiter, $aStack, true)) !== false) {
70
+ $iLength = 2; //Number of elements to be joined
71
+ for ($i = $iStartPosition + 2; $i < count($aStack); $i += 2, ++$iLength) {
72
+ if ($sDelimiter !== $aStack[$i]) {
73
+ break;
74
+ }
75
+ }
76
+ $oList = new RuleValueList($sDelimiter, $oParserState->currentLine());
77
+ for ($i = $iStartPosition - 1; $i - $iStartPosition + 1 < $iLength * 2; $i += 2) {
78
+ $oList->addListComponent($aStack[$i]);
79
+ }
80
+ array_splice($aStack, $iStartPosition - 1, $iLength * 2 - 1, [$oList]);
81
+ }
82
+ }
83
+ if (!isset($aStack[0])) {
84
+ throw new UnexpectedTokenException(
85
+ " {$oParserState->peek()} ",
86
+ $oParserState->peek(1, -1) . $oParserState->peek(2),
87
+ 'literal',
88
+ $oParserState->currentLine()
89
+ );
90
+ }
91
+ return $aStack[0];
92
+ }
93
+
94
+ /**
95
+ * @param bool $bIgnoreCase
96
+ *
97
+ * @return CSSFunction|string
98
+ *
99
+ * @throws UnexpectedEOFException
100
+ * @throws UnexpectedTokenException
101
+ */
102
+ public static function parseIdentifierOrFunction(ParserState $oParserState, $bIgnoreCase = false)
103
+ {
104
+ $sResult = $oParserState->parseIdentifier($bIgnoreCase);
105
+
106
+ if ($oParserState->comes('(')) {
107
+ $oParserState->consume('(');
108
+ $aArguments = Value::parseValue($oParserState, ['=', ' ', ',']);
109
+ $sResult = new CSSFunction($sResult, $aArguments, ',', $oParserState->currentLine());
110
+ $oParserState->consume(')');
111
+ }
112
+
113
+ return $sResult;
114
+ }
115
+
116
+ /**
117
+ * @return CSSFunction|CSSString|LineName|Size|URL|string
118
+ *
119
+ * @throws UnexpectedEOFException
120
+ * @throws UnexpectedTokenException
121
+ * @throws SourceException
122
+ */
123
+ public static function parsePrimitiveValue(ParserState $oParserState)
124
+ {
125
+ $oValue = null;
126
+ $oParserState->consumeWhiteSpace();
127
+ if (
128
+ is_numeric($oParserState->peek())
129
+ || ($oParserState->comes('-.')
130
+ && is_numeric($oParserState->peek(1, 2)))
131
+ || (($oParserState->comes('-') || $oParserState->comes('.')) && is_numeric($oParserState->peek(1, 1)))
132
+ ) {
133
+ $oValue = Size::parse($oParserState);
134
+ } elseif ($oParserState->comes('#') || $oParserState->comes('rgb', true) || $oParserState->comes('hsl', true)) {
135
+ $oValue = Color::parse($oParserState);
136
+ } elseif ($oParserState->comes('url', true)) {
137
+ $oValue = URL::parse($oParserState);
138
+ } elseif (
139
+ $oParserState->comes('calc', true) || $oParserState->comes('-webkit-calc', true)
140
+ || $oParserState->comes('-moz-calc', true)
141
+ ) {
142
+ $oValue = CalcFunction::parse($oParserState);
143
+ } elseif ($oParserState->comes("'") || $oParserState->comes('"')) {
144
+ $oValue = CSSString::parse($oParserState);
145
+ } elseif ($oParserState->comes("progid:") && $oParserState->getSettings()->bLenientParsing) {
146
+ $oValue = self::parseMicrosoftFilter($oParserState);
147
+ } elseif ($oParserState->comes("[")) {
148
+ $oValue = LineName::parse($oParserState);
149
+ } elseif ($oParserState->comes("U+")) {
150
+ $oValue = self::parseUnicodeRangeValue($oParserState);
151
+ } else {
152
+ $oValue = self::parseIdentifierOrFunction($oParserState);
153
+ }
154
+ $oParserState->consumeWhiteSpace();
155
+ return $oValue;
156
+ }
157
+
158
+ /**
159
+ * @return CSSFunction
160
+ *
161
+ * @throws UnexpectedEOFException
162
+ * @throws UnexpectedTokenException
163
+ */
164
+ private static function parseMicrosoftFilter(ParserState $oParserState)
165
+ {
166
+ $sFunction = $oParserState->consumeUntil('(', false, true);
167
+ $aArguments = Value::parseValue($oParserState, [',', '=']);
168
+ return new CSSFunction($sFunction, $aArguments, ',', $oParserState->currentLine());
169
+ }
170
+
171
+ /**
172
+ * @return string
173
+ *
174
+ * @throws UnexpectedEOFException
175
+ * @throws UnexpectedTokenException
176
+ */
177
+ private static function parseUnicodeRangeValue(ParserState $oParserState)
178
+ {
179
+ $iCodepointMaxLength = 6; // Code points outside BMP can use up to six digits
180
+ $sRange = "";
181
+ $oParserState->consume("U+");
182
+ do {
183
+ if ($oParserState->comes('-')) {
184
+ $iCodepointMaxLength = 13; // Max length is 2 six digit code points + the dash(-) between them
185
+ }
186
+ $sRange .= $oParserState->consume(1);
187
+ } while (strlen($sRange) < $iCodepointMaxLength && preg_match("/[A-Fa-f0-9\?-]/", $oParserState->peek()));
188
+ return "U+{$sRange}";
189
+ }
190
+
191
+ /**
192
+ * @return int
193
+ */
194
+ public function getLineNo()
195
+ {
196
+ return $this->iLineNo;
197
+ }
198
+ }
vendor/sabberworm/php-css-parser/src/Value/ValueList.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sabberworm\CSS\Value;
4
+
5
+ use Sabberworm\CSS\OutputFormat;
6
+
7
+ abstract class ValueList extends Value
8
+ {
9
+ /**
10
+ * @var array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string>
11
+ */
12
+ protected $aComponents;
13
+
14
+ /**
15
+ * @var string
16
+ */
17
+ protected $sSeparator;
18
+
19
+ /**
20
+ * phpcs:ignore Generic.Files.LineLength
21
+ * @param array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string>|RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string $aComponents
22
+ * @param string $sSeparator
23
+ * @param int $iLineNo
24
+ */
25
+ public function __construct($aComponents = [], $sSeparator = ',', $iLineNo = 0)
26
+ {
27
+ parent::__construct($iLineNo);
28
+ if (!is_array($aComponents)) {
29
+ $aComponents = [$aComponents];
30
+ }
31
+ $this->aComponents = $aComponents;
32
+ $this->sSeparator = $sSeparator;
33
+ }
34
+
35
+ /**
36
+ * @param RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string $mComponent
37
+ *
38
+ * @return void
39
+ */
40
+ public function addListComponent($mComponent)
41
+ {
42
+ $this->aComponents[] = $mComponent;
43
+ }
44
+
45
+ /**
46
+ * @return array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string>
47
+ */
48
+ public function getListComponents()
49
+ {
50
+ return $this->aComponents;
51
+ }
52
+
53
+ /**
54
+ * @param array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string> $aComponents
55
+ *
56
+ * @return void
57
+ */
58
+ public function setListComponents(array $aComponents)
59
+ {
60
+ $this->aComponents = $aComponents;
61
+ }
62
+
63
+ /**
64
+ * @return string
65
+ */
66
+ public function getListSeparator()
67
+ {
68
+ return $this->sSeparator;
69
+ }
70
+
71
+ /**
72
+ * @param string $sSeparator
73
+ *
74
+ * @return void
75
+ */
76
+ public function setListSeparator($sSeparator)
77
+ {
78
+ $this->sSeparator = $sSeparator;
79
+ }
80
+
81
+ /**
82
+ * @return string
83
+ */
84
+ public function __toString()
85
+ {
86
+ return $this->render(new OutputFormat());
87
+ }
88
+
89
+ /**
90
+ * @return string
91
+ */
92
+ public function render(OutputFormat $oOutputFormat)
93
+ {
94
+ return $oOutputFormat->implode(
95
+ $oOutputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator
96
+ . $oOutputFormat->spaceAfterListArgumentSeparator($this->sSeparator),
97
+ $this->aComponents
98
+ );
99
+ }
100
+ }
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/CSSList/AtRuleBlockListTest.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\CSSList;
4
-
5
- use Sabberworm\CSS\Parser;
6
-
7
- class AtRuleBlockListTest extends \PHPUnit_Framework_TestCase {
8
-
9
- public function testMediaQueries() {
10
- $sCss = '@media(min-width: 768px){.class{color:red}}';
11
- $oParser = new Parser($sCss);
12
- $oDoc = $oParser->parse();
13
- $aContents = $oDoc->getContents();
14
- $oMediaQuery = $aContents[0];
15
- $this->assertSame('media', $oMediaQuery->atRuleName(), 'Does not interpret the type as a function');
16
- $this->assertSame('(min-width: 768px)', $oMediaQuery->atRuleArgs(), 'The media query is the value');
17
-
18
- $sCss = '@media (min-width: 768px) {.class{color:red}}';
19
- $oParser = new Parser($sCss);
20
- $oDoc = $oParser->parse();
21
- $aContents = $oDoc->getContents();
22
- $oMediaQuery = $aContents[0];
23
- $this->assertSame('media', $oMediaQuery->atRuleName(), 'Does not interpret the type as a function');
24
- $this->assertSame('(min-width: 768px)', $oMediaQuery->atRuleArgs(), 'The media query is the value');
25
- }
26
-
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/CSSList/DocumentTest.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\CSSList;
4
-
5
- use Sabberworm\CSS\Parser;
6
-
7
- class DocumentTest extends \PHPUnit_Framework_TestCase {
8
-
9
- public function testOverrideContents() {
10
- $sCss = '.thing { left: 10px; }';
11
- $oParser = new Parser($sCss);
12
- $oDoc = $oParser->parse();
13
- $aContents = $oDoc->getContents();
14
- $this->assertCount(1, $aContents);
15
-
16
- $sCss2 = '.otherthing { right: 10px; }';
17
- $oParser2 = new Parser($sCss);
18
- $oDoc2 = $oParser2->parse();
19
- $aContents2 = $oDoc2->getContents();
20
-
21
- $oDoc->setContents(array($aContents[0], $aContents2[0]));
22
- $aFinalContents = $oDoc->getContents();
23
- $this->assertCount(2, $aFinalContents);
24
- }
25
-
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/OutputFormatTest.php DELETED
@@ -1,170 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS;
4
-
5
- use Sabberworm\CSS\Parser;
6
- use Sabberworm\CSS\OutputFormat;
7
-
8
- global $TEST_CSS;
9
-
10
- $TEST_CSS = <<<EOT
11
-
12
- .main, .test {
13
- font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;
14
- background: white;
15
- }
16
-
17
- @media screen {
18
- .main {
19
- background-size: 100% 100%;
20
- font-size: 1.3em;
21
- background-color: #fff;
22
- }
23
- }
24
-
25
- EOT;
26
-
27
- class OutputFormatTest extends \PHPUnit_Framework_TestCase {
28
- private $oParser;
29
- private $oDocument;
30
-
31
- function setUp() {
32
- global $TEST_CSS;
33
- $this->oParser = new Parser($TEST_CSS);
34
- $this->oDocument = $this->oParser->parse();
35
- }
36
-
37
- public function testPlain() {
38
- $this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
39
- @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render());
40
- }
41
-
42
- public function testCompact() {
43
- $this->assertSame('.main,.test{font:italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background:white;}@media screen{.main{background-size:100% 100%;font-size:1.3em;background-color:#fff;}}', $this->oDocument->render(OutputFormat::createCompact()));
44
- }
45
-
46
- public function testPretty() {
47
- global $TEST_CSS;
48
- $this->assertSame($TEST_CSS, $this->oDocument->render(OutputFormat::createPretty()));
49
- }
50
-
51
- public function testSpaceAfterListArgumentSeparator() {
52
- $this->assertSame('.main, .test {font: italic normal bold 16px/ 1.2 "Helvetica", Verdana, sans-serif;background: white;}
53
- @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceAfterListArgumentSeparator(" ")));
54
- }
55
-
56
- public function testSpaceAfterListArgumentSeparatorComplex() {
57
- $this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;background: white;}
58
- @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceAfterListArgumentSeparator(array('default' => ' ', ',' => "\t", '/' => '', ' ' => ''))));
59
- }
60
-
61
- public function testSpaceAfterSelectorSeparator() {
62
- $this->assertSame('.main,
63
- .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
64
- @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceAfterSelectorSeparator("\n")));
65
- }
66
-
67
- public function testStringQuotingType() {
68
- $this->assertSame('.main, .test {font: italic normal bold 16px/1.2 \'Helvetica\',Verdana,sans-serif;background: white;}
69
- @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setStringQuotingType("'")));
70
- }
71
-
72
- public function testRGBHashNotation() {
73
- $this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
74
- @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: rgb(255,255,255);}}', $this->oDocument->render(OutputFormat::create()->setRGBHashNotation(false)));
75
- }
76
-
77
- public function testSemicolonAfterLastRule() {
78
- $this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white}
79
- @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff}}', $this->oDocument->render(OutputFormat::create()->setSemicolonAfterLastRule(false)));
80
- }
81
-
82
- public function testSpaceAfterRuleName() {
83
- $this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
84
- @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceAfterRuleName("\t")));
85
- }
86
-
87
- public function testSpaceRules() {
88
- $this->assertSame('.main, .test {
89
- font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
90
- background: white;
91
- }
92
- @media screen {.main {
93
- background-size: 100% 100%;
94
- font-size: 1.3em;
95
- background-color: #fff;
96
- }}', $this->oDocument->render(OutputFormat::create()->set('Space*Rules', "\n")));
97
- }
98
-
99
- public function testSpaceBlocks() {
100
- $this->assertSame('
101
- .main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
102
- @media screen {
103
- .main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}
104
- }
105
- ', $this->oDocument->render(OutputFormat::create()->set('Space*Blocks', "\n")));
106
- }
107
-
108
- public function testSpaceBoth() {
109
- $this->assertSame('
110
- .main, .test {
111
- font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
112
- background: white;
113
- }
114
- @media screen {
115
- .main {
116
- background-size: 100% 100%;
117
- font-size: 1.3em;
118
- background-color: #fff;
119
- }
120
- }
121
- ', $this->oDocument->render(OutputFormat::create()->set('Space*Rules', "\n")->set('Space*Blocks', "\n")));
122
- }
123
-
124
- public function testSpaceBetweenBlocks() {
125
- $this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceBetweenBlocks('')));
126
- }
127
-
128
- public function testIndentation() {
129
- $this->assertSame('
130
- .main, .test {
131
- font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
132
- background: white;
133
- }
134
- @media screen {
135
- .main {
136
- background-size: 100% 100%;
137
- font-size: 1.3em;
138
- background-color: #fff;
139
- }
140
- }
141
- ', $this->oDocument->render(OutputFormat::create()->set('Space*Rules', "\n")->set('Space*Blocks', "\n")->setIndentation('')));
142
- }
143
-
144
- public function testSpaceBeforeBraces() {
145
- $this->assertSame('.main, .test{font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
146
- @media screen{.main{background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceBeforeOpeningBrace('')));
147
- }
148
-
149
- /**
150
- * @expectedException Sabberworm\CSS\Parsing\OutputException
151
- */
152
- public function testIgnoreExceptionsOff() {
153
- $aBlocks = $this->oDocument->getAllDeclarationBlocks();
154
- $oFirstBlock = $aBlocks[0];
155
- $oFirstBlock->removeSelector('.main');
156
- $this->assertSame('.test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
157
- @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setIgnoreExceptions(false)));
158
- $oFirstBlock->removeSelector('.test');
159
- $this->oDocument->render(OutputFormat::create()->setIgnoreExceptions(false));
160
- }
161
-
162
- public function testIgnoreExceptionsOn() {
163
- $aBlocks = $this->oDocument->getAllDeclarationBlocks();
164
- $oFirstBlock = $aBlocks[0];
165
- $oFirstBlock->removeSelector('.main');
166
- $oFirstBlock->removeSelector('.test');
167
- $this->assertSame('@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setIgnoreExceptions(true)));
168
- }
169
-
170
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/ParserTest.php DELETED
@@ -1,714 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS;
4
-
5
- use Sabberworm\CSS\CSSList\KeyFrame;
6
- use Sabberworm\CSS\Value\Size;
7
- use Sabberworm\CSS\Property\Selector;
8
- use Sabberworm\CSS\RuleSet\DeclarationBlock;
9
- use Sabberworm\CSS\Property\AtRule;
10
- use Sabberworm\CSS\Value\URL;
11
- use Sabberworm\CSS\Parsing\UnexpectedTokenException;
12
-
13
- class ParserTest extends \PHPUnit_Framework_TestCase {
14
-
15
- function testFiles() {
16
- $sDirectory = dirname(__FILE__) . '/../../files';
17
- if ($rHandle = opendir($sDirectory)) {
18
- /* This is the correct way to loop over the directory. */
19
- while (false !== ($sFileName = readdir($rHandle))) {
20
- if (strpos($sFileName, '.') === 0) {
21
- continue;
22
- }
23
- if (strrpos($sFileName, '.css') !== strlen($sFileName) - strlen('.css')) {
24
- continue;
25
- }
26
- if (strpos($sFileName, '-') === 0) {
27
- //Either a file which SHOULD fail (at least in strict mode) or a future test of a as-of-now missing feature
28
- continue;
29
- }
30
- $oParser = new Parser(file_get_contents($sDirectory . DIRECTORY_SEPARATOR . $sFileName));
31
- try {
32
- $this->assertNotEquals('', $oParser->parse()->render());
33
- } catch (\Exception $e) {
34
- $this->fail($e);
35
- }
36
- }
37
- closedir($rHandle);
38
- }
39
- }
40
-
41
- /**
42
- * @depends testFiles
43
- */
44
- function testColorParsing() {
45
- $oDoc = $this->parsedStructureForFile('colortest');
46
- foreach ($oDoc->getAllRuleSets() as $oRuleSet) {
47
- if (!$oRuleSet instanceof DeclarationBlock) {
48
- continue;
49
- }
50
- $sSelector = $oRuleSet->getSelectors();
51
- $sSelector = $sSelector[0]->getSelector();
52
- if ($sSelector === '#mine') {
53
- $aColorRule = $oRuleSet->getRules('color');
54
- $oColor = $aColorRule[0]->getValue();
55
- $this->assertSame('red', $oColor);
56
- $aColorRule = $oRuleSet->getRules('background-');
57
- $oColor = $aColorRule[0]->getValue();
58
- $this->assertEquals(array('r' => new Size(35.0, null, true, $oColor->getLineNo()), 'g' => new Size(35.0, null, true, $oColor->getLineNo()), 'b' => new Size(35.0, null, true, $oColor->getLineNo())), $oColor->getColor());
59
- $aColorRule = $oRuleSet->getRules('border-color');
60
- $oColor = $aColorRule[0]->getValue();
61
- $this->assertEquals(array('r' => new Size(10.0, null, true, $oColor->getLineNo()), 'g' => new Size(100.0, null, true, $oColor->getLineNo()), 'b' => new Size(230.0, null, true, $oColor->getLineNo())), $oColor->getColor());
62
- $oColor = $aColorRule[1]->getValue();
63
- $this->assertEquals(array('r' => new Size(10.0, null, true, $oColor->getLineNo()), 'g' => new Size(100.0, null, true, $oColor->getLineNo()), 'b' => new Size(231.0, null, true, $oColor->getLineNo()), 'a' => new Size("0000.3", null, true, $oColor->getLineNo())), $oColor->getColor());
64
- $aColorRule = $oRuleSet->getRules('outline-color');
65
- $oColor = $aColorRule[0]->getValue();
66
- $this->assertEquals(array('r' => new Size(34.0, null, true, $oColor->getLineNo()), 'g' => new Size(34.0, null, true, $oColor->getLineNo()), 'b' => new Size(34.0, null, true, $oColor->getLineNo())), $oColor->getColor());
67
- } else if($sSelector === '#yours') {
68
- $aColorRule = $oRuleSet->getRules('background-color');
69
- $oColor = $aColorRule[0]->getValue();
70
- $this->assertEquals(array('h' => new Size(220.0, null, true, $oColor->getLineNo()), 's' => new Size(10.0, '%', true, $oColor->getLineNo()), 'l' => new Size(220.0, '%', true, $oColor->getLineNo())), $oColor->getColor());
71
- $oColor = $aColorRule[1]->getValue();
72
- $this->assertEquals(array('h' => new Size(220.0, null, true, $oColor->getLineNo()), 's' => new Size(10.0, '%', true, $oColor->getLineNo()), 'l' => new Size(220.0, '%', true, $oColor->getLineNo()), 'a' => new Size(0000.3, null, true, $oColor->getLineNo())), $oColor->getColor());
73
- }
74
- }
75
- foreach ($oDoc->getAllValues('color') as $sColor) {
76
- $this->assertSame('red', $sColor);
77
- }
78
- $this->assertSame('#mine {color: red;border-color: #0a64e6;border-color: rgba(10,100,231,.3);outline-color: #222;background-color: #232323;}
79
- #yours {background-color: hsl(220,10%,220%);background-color: hsla(220,10%,220%,.3);}', $oDoc->render());
80
- }
81
-
82
- function testUnicodeParsing() {
83
- $oDoc = $this->parsedStructureForFile('unicode');
84
- foreach ($oDoc->getAllDeclarationBlocks() as $oRuleSet) {
85
- $sSelector = $oRuleSet->getSelectors();
86
- $sSelector = $sSelector[0]->getSelector();
87
- if (substr($sSelector, 0, strlen('.test-')) !== '.test-') {
88
- continue;
89
- }
90
- $aContentRules = $oRuleSet->getRules('content');
91
- $aContents = $aContentRules[0]->getValues();
92
- $sString = $aContents[0][0]->__toString();
93
- if ($sSelector == '.test-1') {
94
- $this->assertSame('" "', $sString);
95
- }
96
- if ($sSelector == '.test-2') {
97
- $this->assertSame('"é"', $sString);
98
- }
99
- if ($sSelector == '.test-3') {
100
- $this->assertSame('" "', $sString);
101
- }
102
- if ($sSelector == '.test-4') {
103
- $this->assertSame('"𝄞"', $sString);
104
- }
105
- if ($sSelector == '.test-5') {
106
- $this->assertSame('"水"', $sString);
107
- }
108
- if ($sSelector == '.test-6') {
109
- $this->assertSame('"¥"', $sString);
110
- }
111
- if ($sSelector == '.test-7') {
112
- $this->assertSame('"\A"', $sString);
113
- }
114
- if ($sSelector == '.test-8') {
115
- $this->assertSame('"\"\""', $sString);
116
- }
117
- if ($sSelector == '.test-9') {
118
- $this->assertSame('"\"\\\'"', $sString);
119
- }
120
- if ($sSelector == '.test-10') {
121
- $this->assertSame('"\\\'\\\\"', $sString);
122
- }
123
- if ($sSelector == '.test-11') {
124
- $this->assertSame('"test"', $sString);
125
- }
126
- }
127
- }
128
-
129
- function testUnicodeRangeParsing() {
130
- $oDoc = $this->parsedStructureForFile('unicode-range');
131
- $sExpected = "@font-face {unicode-range: U+0100-024F,U+0259,U+1E??-2EFF,U+202F;}";
132
- $this->assertSame($sExpected, $oDoc->render());
133
- }
134
-
135
- function testSpecificity() {
136
- $oDoc = $this->parsedStructureForFile('specificity');
137
- $oDeclarationBlock = $oDoc->getAllDeclarationBlocks();
138
- $oDeclarationBlock = $oDeclarationBlock[0];
139
- $aSelectors = $oDeclarationBlock->getSelectors();
140
- foreach ($aSelectors as $oSelector) {
141
- switch ($oSelector->getSelector()) {
142
- case "#test .help":
143
- $this->assertSame(110, $oSelector->getSpecificity());
144
- break;
145
- case "#file":
146
- $this->assertSame(100, $oSelector->getSpecificity());
147
- break;
148
- case ".help:hover":
149
- $this->assertSame(20, $oSelector->getSpecificity());
150
- break;
151
- case "ol li::before":
152
- $this->assertSame(3, $oSelector->getSpecificity());
153
- break;
154
- case "li.green":
155
- $this->assertSame(11, $oSelector->getSpecificity());
156
- break;
157
- default:
158
- $this->fail("specificity: untested selector " . $oSelector->getSelector());
159
- }
160
- }
161
- $this->assertEquals(array(new Selector('#test .help', true)), $oDoc->getSelectorsBySpecificity('> 100'));
162
- $this->assertEquals(array(new Selector('#test .help', true), new Selector('#file', true)), $oDoc->getSelectorsBySpecificity('>= 100'));
163
- $this->assertEquals(array(new Selector('#file', true)), $oDoc->getSelectorsBySpecificity('=== 100'));
164
- $this->assertEquals(array(new Selector('#file', true)), $oDoc->getSelectorsBySpecificity('== 100'));
165
- $this->assertEquals(array(new Selector('#file', true), new Selector('.help:hover', true), new Selector('li.green', true), new Selector('ol li::before', true)), $oDoc->getSelectorsBySpecificity('<= 100'));
166
- $this->assertEquals(array(new Selector('.help:hover', true), new Selector('li.green', true), new Selector('ol li::before', true)), $oDoc->getSelectorsBySpecificity('< 100'));
167
- $this->assertEquals(array(new Selector('li.green', true)), $oDoc->getSelectorsBySpecificity('11'));
168
- $this->assertEquals(array(new Selector('ol li::before', true)), $oDoc->getSelectorsBySpecificity(3));
169
- }
170
-
171
- function testManipulation() {
172
- $oDoc = $this->parsedStructureForFile('atrules');
173
- $this->assertSame('@charset "utf-8";
174
- @font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}
175
- html, body {font-size: -.6em;}
176
- @keyframes mymove {from {top: 0px;}
177
- to {top: 200px;}}
178
- @-moz-keyframes some-move {from {top: 0px;}
179
- to {top: 200px;}}
180
- @supports ( (perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px) ) {body {font-family: "Helvetica";}}
181
- @page :pseudo-class {margin: 2in;}
182
- @-moz-document url(http://www.w3.org/),
183
- url-prefix(http://www.w3.org/Style/),
184
- domain(mozilla.org),
185
- regexp("https:.*") {body {color: purple;background: yellow;}}
186
- @media screen and (orientation: landscape) {@-ms-viewport {width: 1024px;height: 768px;}}
187
- @region-style #intro {p {color: blue;}}', $oDoc->render());
188
- foreach ($oDoc->getAllDeclarationBlocks() as $oBlock) {
189
- foreach ($oBlock->getSelectors() as $oSelector) {
190
- //Loop over all selector parts (the comma-separated strings in a selector) and prepend the id
191
- $oSelector->setSelector('#my_id ' . $oSelector->getSelector());
192
- }
193
- }
194
- $this->assertSame('@charset "utf-8";
195
- @font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}
196
- #my_id html, #my_id body {font-size: -.6em;}
197
- @keyframes mymove {from {top: 0px;}
198
- to {top: 200px;}}
199
- @-moz-keyframes some-move {from {top: 0px;}
200
- to {top: 200px;}}
201
- @supports ( (perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px) ) {#my_id body {font-family: "Helvetica";}}
202
- @page :pseudo-class {margin: 2in;}
203
- @-moz-document url(http://www.w3.org/),
204
- url-prefix(http://www.w3.org/Style/),
205
- domain(mozilla.org),
206
- regexp("https:.*") {#my_id body {color: purple;background: yellow;}}
207
- @media screen and (orientation: landscape) {@-ms-viewport {width: 1024px;height: 768px;}}
208
- @region-style #intro {#my_id p {color: blue;}}', $oDoc->render());
209
-
210
- $oDoc = $this->parsedStructureForFile('values');
211
- $this->assertSame('#header {margin: 10px 2em 1cm 2%;font-family: Verdana,Helvetica,"Gill Sans",sans-serif;font-size: 10px;color: red !important;background-color: green;background-color: rgba(0,128,0,.7);frequency: 30Hz;}
212
- body {color: green;font: 75% "Lucida Grande","Trebuchet MS",Verdana,sans-serif;}', $oDoc->render());
213
- foreach ($oDoc->getAllRuleSets() as $oRuleSet) {
214
- $oRuleSet->removeRule('font-');
215
- }
216
- $this->assertSame('#header {margin: 10px 2em 1cm 2%;color: red !important;background-color: green;background-color: rgba(0,128,0,.7);frequency: 30Hz;}
217
- body {color: green;}', $oDoc->render());
218
- foreach ($oDoc->getAllRuleSets() as $oRuleSet) {
219
- $oRuleSet->removeRule('background-');
220
- }
221
- $this->assertSame('#header {margin: 10px 2em 1cm 2%;color: red !important;frequency: 30Hz;}
222
- body {color: green;}', $oDoc->render());
223
- }
224
-
225
- function testRuleGetters() {
226
- $oDoc = $this->parsedStructureForFile('values');
227
- $aBlocks = $oDoc->getAllDeclarationBlocks();
228
- $oHeaderBlock = $aBlocks[0];
229
- $oBodyBlock = $aBlocks[1];
230
- $aHeaderRules = $oHeaderBlock->getRules('background-');
231
- $this->assertSame(2, count($aHeaderRules));
232
- $this->assertSame('background-color', $aHeaderRules[0]->getRule());
233
- $this->assertSame('background-color', $aHeaderRules[1]->getRule());
234
- $aHeaderRules = $oHeaderBlock->getRulesAssoc('background-');
235
- $this->assertSame(1, count($aHeaderRules));
236
- $this->assertSame(true, $aHeaderRules['background-color']->getValue() instanceof \Sabberworm\CSS\Value\Color);
237
- $this->assertSame('rgba', $aHeaderRules['background-color']->getValue()->getColorDescription());
238
- $oHeaderBlock->removeRule($aHeaderRules['background-color']);
239
- $aHeaderRules = $oHeaderBlock->getRules('background-');
240
- $this->assertSame(1, count($aHeaderRules));
241
- $this->assertSame('green', $aHeaderRules[0]->getValue());
242
- }
243
-
244
- function testSlashedValues() {
245
- $oDoc = $this->parsedStructureForFile('slashed');
246
- $this->assertSame('.test {font: 12px/1.5 Verdana,Arial,sans-serif;border-radius: 5px 10px 5px 10px/10px 5px 10px 5px;}', $oDoc->render());
247
- foreach ($oDoc->getAllValues(null) as $mValue) {
248
- if ($mValue instanceof Size && $mValue->isSize() && !$mValue->isRelative()) {
249
- $mValue->setSize($mValue->getSize() * 3);
250
- }
251
- }
252
- foreach ($oDoc->getAllDeclarationBlocks() as $oBlock) {
253
- $oRule = $oBlock->getRules('font');
254
- $oRule = $oRule[0];
255
- $oSpaceList = $oRule->getValue();
256
- $this->assertEquals(' ', $oSpaceList->getListSeparator());
257
- $oSlashList = $oSpaceList->getListComponents();
258
- $oCommaList = $oSlashList[1];
259
- $oSlashList = $oSlashList[0];
260
- $this->assertEquals(',', $oCommaList->getListSeparator());
261
- $this->assertEquals('/', $oSlashList->getListSeparator());
262
- $oRule = $oBlock->getRules('border-radius');
263
- $oRule = $oRule[0];
264
- $oSlashList = $oRule->getValue();
265
- $this->assertEquals('/', $oSlashList->getListSeparator());
266
- $oSpaceList1 = $oSlashList->getListComponents();
267
- $oSpaceList2 = $oSpaceList1[1];
268
- $oSpaceList1 = $oSpaceList1[0];
269
- $this->assertEquals(' ', $oSpaceList1->getListSeparator());
270
- $this->assertEquals(' ', $oSpaceList2->getListSeparator());
271
- }
272
- $this->assertSame('.test {font: 36px/1.5 Verdana,Arial,sans-serif;border-radius: 15px 30px 15px 30px/30px 15px 30px 15px;}', $oDoc->render());
273
- }
274
-
275
- function testFunctionSyntax() {
276
- $oDoc = $this->parsedStructureForFile('functions');
277
- $sExpected = 'div.main {background-image: linear-gradient(#000,#fff);}
278
- .collapser::before, .collapser::-moz-before, .collapser::-webkit-before {content: "»";font-size: 1.2em;margin-right: .2em;-moz-transition-property: -moz-transform;-moz-transition-duration: .2s;-moz-transform-origin: center 60%;}
279
- .collapser.expanded::before, .collapser.expanded::-moz-before, .collapser.expanded::-webkit-before {-moz-transform: rotate(90deg);}
280
- .collapser + * {height: 0;overflow: hidden;-moz-transition-property: height;-moz-transition-duration: .3s;}
281
- .collapser.expanded + * {height: auto;}';
282
- $this->assertSame($sExpected, $oDoc->render());
283
-
284
- foreach ($oDoc->getAllValues(null, true) as $mValue) {
285
- if ($mValue instanceof Size && $mValue->isSize()) {
286
- $mValue->setSize($mValue->getSize() * 3);
287
- }
288
- }
289
- $sExpected = str_replace(array('1.2em', '.2em', '60%'), array('3.6em', '.6em', '180%'), $sExpected);
290
- $this->assertSame($sExpected, $oDoc->render());
291
-
292
- foreach ($oDoc->getAllValues(null, true) as $mValue) {
293
- if ($mValue instanceof Size && !$mValue->isRelative() && !$mValue->isColorComponent()) {
294
- $mValue->setSize($mValue->getSize() * 2);
295
- }
296
- }
297
- $sExpected = str_replace(array('.2s', '.3s', '90deg'), array('.4s', '.6s', '180deg'), $sExpected);
298
- $this->assertSame($sExpected, $oDoc->render());
299
- }
300
-
301
- function testExpandShorthands() {
302
- $oDoc = $this->parsedStructureForFile('expand-shorthands');
303
- $sExpected = 'body {font: italic 500 14px/1.618 "Trebuchet MS",Georgia,serif;border: 2px solid #f0f;background: #ccc url("/images/foo.png") no-repeat left top;margin: 1em !important;padding: 2px 6px 3px;}';
304
- $this->assertSame($sExpected, $oDoc->render());
305
- $oDoc->expandShorthands();
306
- $sExpected = 'body {margin-top: 1em !important;margin-right: 1em !important;margin-bottom: 1em !important;margin-left: 1em !important;padding-top: 2px;padding-right: 6px;padding-bottom: 3px;padding-left: 6px;border-top-color: #f0f;border-right-color: #f0f;border-bottom-color: #f0f;border-left-color: #f0f;border-top-style: solid;border-right-style: solid;border-bottom-style: solid;border-left-style: solid;border-top-width: 2px;border-right-width: 2px;border-bottom-width: 2px;border-left-width: 2px;font-style: italic;font-variant: normal;font-weight: 500;font-size: 14px;line-height: 1.618;font-family: "Trebuchet MS",Georgia,serif;background-color: #ccc;background-image: url("/images/foo.png");background-repeat: no-repeat;background-attachment: scroll;background-position: left top;}';
307
- $this->assertSame($sExpected, $oDoc->render());
308
- }
309
-
310
- function testCreateShorthands() {
311
- $oDoc = $this->parsedStructureForFile('create-shorthands');
312
- $sExpected = 'body {font-size: 2em;font-family: Helvetica,Arial,sans-serif;font-weight: bold;border-width: 2px;border-color: #999;border-style: dotted;background-color: #fff;background-image: url("foobar.png");background-repeat: repeat-y;margin-top: 2px;margin-right: 3px;margin-bottom: 4px;margin-left: 5px;}';
313
- $this->assertSame($sExpected, $oDoc->render());
314
- $oDoc->createShorthands();
315
- $sExpected = 'body {background: #fff url("foobar.png") repeat-y;margin: 2px 5px 4px 3px;border: 2px dotted #999;font: bold 2em Helvetica,Arial,sans-serif;}';
316
- $this->assertSame($sExpected, $oDoc->render());
317
- }
318
-
319
- function testNamespaces() {
320
- $oDoc = $this->parsedStructureForFile('namespaces');
321
- $sExpected = '@namespace toto "http://toto.example.org";
322
- @namespace "http://example.com/foo";
323
- @namespace foo url("http://www.example.com/");
324
- @namespace foo url("http://www.example.com/");
325
- foo|test {gaga: 1;}
326
- |test {gaga: 2;}';
327
- $this->assertSame($sExpected, $oDoc->render());
328
- }
329
-
330
- function testInnerColors() {
331
- $oDoc = $this->parsedStructureForFile('inner-color');
332
- $sExpected = 'test {background: -webkit-gradient(linear,0 0,0 bottom,from(#006cad),to(hsl(202,100%,49%)));}';
333
- $this->assertSame($sExpected, $oDoc->render());
334
- }
335
-
336
- function testPrefixedGradient() {
337
- $oDoc = $this->parsedStructureForFile('webkit');
338
- $sExpected = '.test {background: -webkit-linear-gradient(top right,white,black);}';
339
- $this->assertSame($sExpected, $oDoc->render());
340
- }
341
-
342
- function testListValueRemoval() {
343
- $oDoc = $this->parsedStructureForFile('atrules');
344
- foreach ($oDoc->getContents() as $oItem) {
345
- if ($oItem instanceof AtRule) {
346
- $oDoc->remove($oItem);
347
- continue;
348
- }
349
- }
350
- $this->assertSame('html, body {font-size: -.6em;}', $oDoc->render());
351
-
352
- $oDoc = $this->parsedStructureForFile('nested');
353
- foreach ($oDoc->getAllDeclarationBlocks() as $oBlock) {
354
- $oDoc->removeDeclarationBlockBySelector($oBlock, false);
355
- break;
356
- }
357
- $this->assertSame('html {some-other: -test(val1);}
358
- @media screen {html {some: -test(val2);}}
359
- #unrelated {other: yes;}', $oDoc->render());
360
-
361
- $oDoc = $this->parsedStructureForFile('nested');
362
- foreach ($oDoc->getAllDeclarationBlocks() as $oBlock) {
363
- $oDoc->removeDeclarationBlockBySelector($oBlock, true);
364
- break;
365
- }
366
- $this->assertSame('@media screen {html {some: -test(val2);}}
367
- #unrelated {other: yes;}', $oDoc->render());
368
- }
369
-
370
- /**
371
- * @expectedException Sabberworm\CSS\Parsing\OutputException
372
- */
373
- function testSelectorRemoval() {
374
- $oDoc = $this->parsedStructureForFile('1readme');
375
- $aBlocks = $oDoc->getAllDeclarationBlocks();
376
- $oBlock1 = $aBlocks[0];
377
- $this->assertSame(true, $oBlock1->removeSelector('html'));
378
- $sExpected = '@charset "utf-8";
379
- @font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}
380
- body {font-size: 1.6em;}';
381
- $this->assertSame($sExpected, $oDoc->render());
382
- $this->assertSame(false, $oBlock1->removeSelector('html'));
383
- $this->assertSame(true, $oBlock1->removeSelector('body'));
384
- // This tries to output a declaration block without a selector and throws.
385
- $oDoc->render();
386
- }
387
-
388
- function testComments() {
389
- $oDoc = $this->parsedStructureForFile('comments');
390
- $sExpected = '@import url("some/url.css") screen;
391
- .foo, #bar {background-color: #000;}
392
- @media screen {#foo.bar {position: absolute;}}';
393
- $this->assertSame($sExpected, $oDoc->render());
394
- }
395
-
396
- function testUrlInFile() {
397
- $oDoc = $this->parsedStructureForFile('url', Settings::create()->withMultibyteSupport(true));
398
- $sExpected = 'body {background: #fff url("http://somesite.com/images/someimage.gif") repeat top center;}
399
- body {background-url: url("http://somesite.com/images/someimage.gif");}';
400
- $this->assertSame($sExpected, $oDoc->render());
401
- }
402
-
403
- function testHexAlphaInFile() {
404
- $oDoc = $this->parsedStructureForFile('hex-alpha', Settings::create()->withMultibyteSupport(true));
405
- $sExpected = 'div {background: rgba(17,34,51,.27);}
406
- div {background: rgba(17,34,51,.27);}';
407
- $this->assertSame($sExpected, $oDoc->render());
408
- }
409
-
410
- function testCalcInFile() {
411
- $oDoc = $this->parsedStructureForFile('calc', Settings::create()->withMultibyteSupport(true));
412
- $sExpected = 'div {width: calc(100% / 4);}
413
- div {margin-top: calc(-120% - 4px);}
414
- div {height: -webkit-calc(9 / 16 * 100%) !important;width: -moz-calc(( 50px - 50% ) * 2);}';
415
- $this->assertSame($sExpected, $oDoc->render());
416
- }
417
-
418
- function testCalcNestedInFile() {
419
- $oDoc = $this->parsedStructureForFile('calc-nested', Settings::create()->withMultibyteSupport(true));
420
- $sExpected = '.test {font-size: calc(( 3 * 4px ) + -2px);top: calc(200px - calc(20 * 3px));}';
421
- $this->assertSame($sExpected, $oDoc->render());
422
- }
423
-
424
- function testGridLineNameInFile() {
425
- $oDoc = $this->parsedStructureForFile('grid-linename', Settings::create()->withMultibyteSupport(true));
426
- $sExpected = "div {grid-template-columns: [linename] 100px;}\nspan {grid-template-columns: [linename1 linename2] 100px;}";
427
- $this->assertSame($sExpected, $oDoc->render());
428
- }
429
-
430
- function testEmptyGridLineNameLenientInFile() {
431
- $oDoc = $this->parsedStructureForFile('empty-grid-linename');
432
- $sExpected = '.test {grid-template-columns: [] 100px;}';
433
- $this->assertSame($sExpected, $oDoc->render());
434
- }
435
-
436
- function testUnmatchedBracesInFile() {
437
- $oDoc = $this->parsedStructureForFile('unmatched_braces', Settings::create()->withMultibyteSupport(true));
438
- $sExpected = 'button, input, checkbox, textarea {outline: 0;margin: 0;}';
439
- $this->assertSame($sExpected, $oDoc->render());
440
- }
441
-
442
- /**
443
- * @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
444
- */
445
- function testLineNameFailure() {
446
- $this->parsedStructureForFile('-empty-grid-linename', Settings::create()->withLenientParsing(false));
447
- }
448
-
449
- /**
450
- * @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
451
- */
452
- function testCalcFailure() {
453
- $this->parsedStructureForFile('-calc-no-space-around-minus', Settings::create()->withLenientParsing(false));
454
- }
455
-
456
- function testUrlInFileMbOff() {
457
- $oDoc = $this->parsedStructureForFile('url', Settings::create()->withMultibyteSupport(false));
458
- $sExpected = 'body {background: #fff url("http://somesite.com/images/someimage.gif") repeat top center;}
459
- body {background-url: url("http://somesite.com/images/someimage.gif");}';
460
- $this->assertSame($sExpected, $oDoc->render());
461
- }
462
-
463
- function testEmptyFile() {
464
- $oDoc = $this->parsedStructureForFile('-empty', Settings::create()->withMultibyteSupport(true));
465
- $sExpected = '';
466
- $this->assertSame($sExpected, $oDoc->render());
467
- }
468
-
469
- function testEmptyFileMbOff() {
470
- $oDoc = $this->parsedStructureForFile('-empty', Settings::create()->withMultibyteSupport(false));
471
- $sExpected = '';
472
- $this->assertSame($sExpected, $oDoc->render());
473
- }
474
-
475
- function testCharsetLenient1() {
476
- $oDoc = $this->parsedStructureForFile('-charset-after-rule', Settings::create()->withLenientParsing(true));
477
- $sExpected = '#id {prop: var(--val);}';
478
- $this->assertSame($sExpected, $oDoc->render());
479
- }
480
-
481
- function testCharsetLenient2() {
482
- $oDoc = $this->parsedStructureForFile('-charset-in-block', Settings::create()->withLenientParsing(true));
483
- $sExpected = '@media print {}';
484
- $this->assertSame($sExpected, $oDoc->render());
485
- }
486
-
487
- function testTrailingWhitespace() {
488
- $oDoc = $this->parsedStructureForFile('trailing-whitespace', Settings::create()->withLenientParsing(false));
489
- $sExpected = 'div {width: 200px;}';
490
- $this->assertSame($sExpected, $oDoc->render());
491
- }
492
-
493
- /**
494
- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
495
- */
496
- function testCharsetFailure1() {
497
- $this->parsedStructureForFile('-charset-after-rule', Settings::create()->withLenientParsing(false));
498
- }
499
-
500
- /**
501
- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
502
- */
503
- function testCharsetFailure2() {
504
- $this->parsedStructureForFile('-charset-in-block', Settings::create()->withLenientParsing(false));
505
- }
506
-
507
- /**
508
- * @expectedException \Sabberworm\CSS\Parsing\SourceException
509
- */
510
- function testUnopenedClosingBracketFailure() {
511
- $this->parsedStructureForFile('unopened-close-brackets', Settings::create()->withLenientParsing(false));
512
- }
513
-
514
- /**
515
- * Ensure that a missing property value raises an exception.
516
- *
517
- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
518
- * @covers \Sabberworm\CSS\Value\Value::parseValue()
519
- */
520
- function testMissingPropertyValueStrict() {
521
- $this->parsedStructureForFile('missing-property-value', Settings::create()->withLenientParsing(false));
522
- }
523
-
524
- /**
525
- * Ensure that a missing property value is ignored when in lenient parsing mode.
526
- *
527
- * @covers \Sabberworm\CSS\Value\Value::parseValue()
528
- */
529
- function testMissingPropertyValueLenient() {
530
- $parsed = $this->parsedStructureForFile('missing-property-value', Settings::create()->withLenientParsing(true));
531
- $rulesets = $parsed->getAllRuleSets();
532
- $this->assertCount( 1, $rulesets );
533
- $block = $rulesets[0];
534
- $this->assertTrue( $block instanceof DeclarationBlock );
535
- $this->assertEquals( array( 'div' ), $block->getSelectors() );
536
- $rules = $block->getRules();
537
- $this->assertCount( 1, $rules );
538
- $rule = $rules[0];
539
- $this->assertEquals( 'display', $rule->getRule() );
540
- $this->assertEquals( 'inline-block', $rule->getValue() );
541
- }
542
-
543
- /**
544
- * Parse structure for file.
545
- *
546
- * @param string $sFileName Filename.
547
- * @param null|obJeCt $oSettings Settings.
548
- *
549
- * @return CSSList\Document Parsed document.
550
- */
551
- function parsedStructureForFile($sFileName, $oSettings = null) {
552
- $sFile = dirname(__FILE__) . '/../../files' . DIRECTORY_SEPARATOR . "$sFileName.css";
553
- $oParser = new Parser(file_get_contents($sFile), $oSettings);
554
- return $oParser->parse();
555
- }
556
-
557
- /**
558
- * @depends testFiles
559
- */
560
- function testLineNumbersParsing() {
561
- $oDoc = $this->parsedStructureForFile('line-numbers');
562
- // array key is the expected line number
563
- $aExpected = array(
564
- 1 => array('Sabberworm\CSS\Property\Charset'),
565
- 3 => array('Sabberworm\CSS\Property\CSSNamespace'),
566
- 5 => array('Sabberworm\CSS\RuleSet\AtRuleSet'),
567
- 11 => array('Sabberworm\CSS\RuleSet\DeclarationBlock'),
568
- // Line Numbers of the inner declaration blocks
569
- 17 => array('Sabberworm\CSS\CSSList\KeyFrame', 18, 20),
570
- 23 => array('Sabberworm\CSS\Property\Import'),
571
- 25 => array('Sabberworm\CSS\RuleSet\DeclarationBlock')
572
- );
573
-
574
- $aActual = array();
575
- foreach ($oDoc->getContents() as $oContent) {
576
- $aActual[$oContent->getLineNo()] = array(get_class($oContent));
577
- if ($oContent instanceof KeyFrame) {
578
- foreach ($oContent->getContents() as $block) {
579
- $aActual[$oContent->getLineNo()][] = $block->getLineNo();
580
- }
581
- }
582
- }
583
-
584
- $aUrlExpected = array(7, 26); // expected line numbers
585
- $aUrlActual = array();
586
- foreach ($oDoc->getAllValues() as $oValue) {
587
- if ($oValue instanceof URL) {
588
- $aUrlActual[] = $oValue->getLineNo();
589
- }
590
- }
591
-
592
- // Checking for the multiline color rule lines 27-31
593
- $aExpectedColorLines = array(28, 29, 30);
594
- $aDeclBlocks = $oDoc->getAllDeclarationBlocks();
595
- // Choose the 2nd one
596
- $oDeclBlock = $aDeclBlocks[1];
597
- $aRules = $oDeclBlock->getRules();
598
- // Choose the 2nd one
599
- $oColor = $aRules[1]->getValue();
600
- $this->assertEquals(27, $aRules[1]->getLineNo());
601
-
602
- foreach ($oColor->getColor() as $oSize) {
603
- $aActualColorLines[] = $oSize->getLineNo();
604
- }
605
-
606
- $this->assertEquals($aExpectedColorLines, $aActualColorLines);
607
- $this->assertEquals($aUrlExpected, $aUrlActual);
608
- $this->assertEquals($aExpected, $aActual);
609
- }
610
-
611
- /**
612
- * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
613
- * Credit: This test by @sabberworm (from https://github.com/sabberworm/PHP-CSS-Parser/pull/105#issuecomment-229643910 )
614
- */
615
- function testUnexpectedTokenExceptionLineNo() {
616
- $oParser = new Parser("\ntest: 1;", Settings::create()->beStrict());
617
- try {
618
- $oParser->parse();
619
- } catch (UnexpectedTokenException $e) {
620
- $this->assertSame(2, $e->getLineNo());
621
- throw $e;
622
- }
623
- }
624
-
625
- /**
626
- * @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
627
- */
628
- function testIeHacksStrictParsing() {
629
- // We can't strictly parse IE hacks.
630
- $this->parsedStructureForFile('ie-hacks', Settings::create()->beStrict());
631
- }
632
-
633
- function testIeHacksParsing() {
634
- $oDoc = $this->parsedStructureForFile('ie-hacks', Settings::create()->withLenientParsing(true));
635
- $sExpected = 'p {padding-right: .75rem \9;background-image: none \9;color: red \9\0;background-color: red \9\0;background-color: red \9\0 !important;content: "red \0";content: "red઼";}';
636
- $this->assertEquals($sExpected, $oDoc->render());
637
- }
638
-
639
- /**
640
- * @depends testFiles
641
- */
642
- function testCommentExtracting() {
643
- $oDoc = $this->parsedStructureForFile('comments');
644
- $aNodes = $oDoc->getContents();
645
-
646
- // Import property.
647
- $importComments = $aNodes[0]->getComments();
648
- $this->assertCount(1, $importComments);
649
- $this->assertEquals("*\n * Comments Hell.\n ", $importComments[0]->getComment());
650
-
651
- // Declaration block.
652
- $fooBarBlock = $aNodes[1];
653
- $fooBarBlockComments = $fooBarBlock->getComments();
654
- // TODO Support comments in selectors.
655
- // $this->assertCount(2, $fooBarBlockComments);
656
- // $this->assertEquals("* Number 4 *", $fooBarBlockComments[0]->getComment());
657
- // $this->assertEquals("* Number 5 *", $fooBarBlockComments[1]->getComment());
658
-
659
- // Declaration rules.
660
- $fooBarRules = $fooBarBlock->getRules();
661
- $fooBarRule = $fooBarRules[0];
662
- $fooBarRuleComments = $fooBarRule->getComments();
663
- $this->assertCount(1, $fooBarRuleComments);
664
- $this->assertEquals(" Number 6 ", $fooBarRuleComments[0]->getComment());
665
-
666
- // Media property.
667
- $mediaComments = $aNodes[2]->getComments();
668
- $this->assertCount(0, $mediaComments);
669
-
670
- // Media children.
671
- $mediaRules = $aNodes[2]->getContents();
672
- $fooBarComments = $mediaRules[0]->getComments();
673
- $this->assertCount(1, $fooBarComments);
674
- $this->assertEquals("* Number 10 *", $fooBarComments[0]->getComment());
675
-
676
- // Media -> declaration -> rule.
677
- $fooBarRules = $mediaRules[0]->getRules();
678
- $fooBarChildComments = $fooBarRules[0]->getComments();
679
- $this->assertCount(1, $fooBarChildComments);
680
- $this->assertEquals("* Number 10b *", $fooBarChildComments[0]->getComment());
681
- }
682
-
683
- function testFlatCommentExtracting() {
684
- $parser = new Parser('div {/*Find Me!*/left:10px; text-align:left;}');
685
- $doc = $parser->parse();
686
- $contents = $doc->getContents();
687
- $divRules = $contents[0]->getRules();
688
- $comments = $divRules[0]->getComments();
689
- $this->assertCount(1, $comments);
690
- $this->assertEquals("Find Me!", $comments[0]->getComment());
691
- }
692
-
693
- function testTopLevelCommentExtracting() {
694
- $parser = new Parser('/*Find Me!*/div {left:10px; text-align:left;}');
695
- $doc = $parser->parse();
696
- $contents = $doc->getContents();
697
- $comments = $contents[0]->getComments();
698
- $this->assertCount(1, $comments);
699
- $this->assertEquals("Find Me!", $comments[0]->getComment());
700
- }
701
-
702
- /**
703
- * @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
704
- */
705
- function testMicrosoftFilterStrictParsing() {
706
- $oDoc = $this->parsedStructureForFile('ms-filter', Settings::create()->beStrict());
707
- }
708
-
709
- function testMicrosoftFilterParsing() {
710
- $oDoc = $this->parsedStructureForFile('ms-filter');
711
- $sExpected = ".test {filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=\"#80000000\",endColorstr=\"#00000000\",GradientType=1);}";
712
- $this->assertSame($sExpected, $oDoc->render());
713
- }
714
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/RuleSet/DeclarationBlockTest.php DELETED
@@ -1,267 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\RuleSet;
4
-
5
- use Sabberworm\CSS\Parser;
6
- use Sabberworm\CSS\Rule\Rule;
7
- use Sabberworm\CSS\Value\Size;
8
-
9
- class DeclarationBlockTest extends \PHPUnit_Framework_TestCase {
10
-
11
- /**
12
- * @dataProvider expandBorderShorthandProvider
13
- * */
14
- public function testExpandBorderShorthand($sCss, $sExpected) {
15
- $oParser = new Parser($sCss);
16
- $oDoc = $oParser->parse();
17
- foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
18
- $oDeclaration->expandBorderShorthand();
19
- }
20
- $this->assertSame(trim((string) $oDoc), $sExpected);
21
- }
22
-
23
- public function expandBorderShorthandProvider() {
24
- return array(
25
- array('body{ border: 2px solid #000 }', 'body {border-width: 2px;border-style: solid;border-color: #000;}'),
26
- array('body{ border: none }', 'body {border-style: none;}'),
27
- array('body{ border: 2px }', 'body {border-width: 2px;}'),
28
- array('body{ border: #f00 }', 'body {border-color: #f00;}'),
29
- array('body{ border: 1em solid }', 'body {border-width: 1em;border-style: solid;}'),
30
- array('body{ margin: 1em; }', 'body {margin: 1em;}')
31
- );
32
- }
33
-
34
- /**
35
- * @dataProvider expandFontShorthandProvider
36
- * */
37
- public function testExpandFontShorthand($sCss, $sExpected) {
38
- $oParser = new Parser($sCss);
39
- $oDoc = $oParser->parse();
40
- foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
41
- $oDeclaration->expandFontShorthand();
42
- }
43
- $this->assertSame(trim((string) $oDoc), $sExpected);
44
- }
45
-
46
- public function expandFontShorthandProvider() {
47
- return array(
48
- array(
49
- 'body{ margin: 1em; }',
50
- 'body {margin: 1em;}'
51
- ),
52
- array(
53
- 'body {font: 12px serif;}',
54
- 'body {font-style: normal;font-variant: normal;font-weight: normal;font-size: 12px;line-height: normal;font-family: serif;}'
55
- ),
56
- array(
57
- 'body {font: italic 12px serif;}',
58
- 'body {font-style: italic;font-variant: normal;font-weight: normal;font-size: 12px;line-height: normal;font-family: serif;}'
59
- ),
60
- array(
61
- 'body {font: italic bold 12px serif;}',
62
- 'body {font-style: italic;font-variant: normal;font-weight: bold;font-size: 12px;line-height: normal;font-family: serif;}'
63
- ),
64
- array(
65
- 'body {font: italic bold 12px/1.6 serif;}',
66
- 'body {font-style: italic;font-variant: normal;font-weight: bold;font-size: 12px;line-height: 1.6;font-family: serif;}'
67
- ),
68
- array(
69
- 'body {font: italic small-caps bold 12px/1.6 serif;}',
70
- 'body {font-style: italic;font-variant: small-caps;font-weight: bold;font-size: 12px;line-height: 1.6;font-family: serif;}'
71
- ),
72
- );
73
- }
74
-
75
- /**
76
- * @dataProvider expandBackgroundShorthandProvider
77
- * */
78
- public function testExpandBackgroundShorthand($sCss, $sExpected) {
79
- $oParser = new Parser($sCss);
80
- $oDoc = $oParser->parse();
81
- foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
82
- $oDeclaration->expandBackgroundShorthand();
83
- }
84
- $this->assertSame(trim((string) $oDoc), $sExpected);
85
- }
86
-
87
- public function expandBackgroundShorthandProvider() {
88
- return array(
89
- array('body {border: 1px;}', 'body {border: 1px;}'),
90
- array('body {background: #f00;}', 'body {background-color: #f00;background-image: none;background-repeat: repeat;background-attachment: scroll;background-position: 0% 0%;}'),
91
- array('body {background: #f00 url("foobar.png");}', 'body {background-color: #f00;background-image: url("foobar.png");background-repeat: repeat;background-attachment: scroll;background-position: 0% 0%;}'),
92
- array('body {background: #f00 url("foobar.png") no-repeat;}', 'body {background-color: #f00;background-image: url("foobar.png");background-repeat: no-repeat;background-attachment: scroll;background-position: 0% 0%;}'),
93
- array('body {background: #f00 url("foobar.png") no-repeat center;}', 'body {background-color: #f00;background-image: url("foobar.png");background-repeat: no-repeat;background-attachment: scroll;background-position: center center;}'),
94
- array('body {background: #f00 url("foobar.png") no-repeat top left;}', 'body {background-color: #f00;background-image: url("foobar.png");background-repeat: no-repeat;background-attachment: scroll;background-position: top left;}'),
95
- );
96
- }
97
-
98
- /**
99
- * @dataProvider expandDimensionsShorthandProvider
100
- * */
101
- public function testExpandDimensionsShorthand($sCss, $sExpected) {
102
- $oParser = new Parser($sCss);
103
- $oDoc = $oParser->parse();
104
- foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
105
- $oDeclaration->expandDimensionsShorthand();
106
- }
107
- $this->assertSame(trim((string) $oDoc), $sExpected);
108
- }
109
-
110
- public function expandDimensionsShorthandProvider() {
111
- return array(
112
- array('body {border: 1px;}', 'body {border: 1px;}'),
113
- array('body {margin-top: 1px;}', 'body {margin-top: 1px;}'),
114
- array('body {margin: 1em;}', 'body {margin-top: 1em;margin-right: 1em;margin-bottom: 1em;margin-left: 1em;}'),
115
- array('body {margin: 1em 2em;}', 'body {margin-top: 1em;margin-right: 2em;margin-bottom: 1em;margin-left: 2em;}'),
116
- array('body {margin: 1em 2em 3em;}', 'body {margin-top: 1em;margin-right: 2em;margin-bottom: 3em;margin-left: 2em;}'),
117
- );
118
- }
119
-
120
- /**
121
- * @dataProvider createBorderShorthandProvider
122
- * */
123
- public function testCreateBorderShorthand($sCss, $sExpected) {
124
- $oParser = new Parser($sCss);
125
- $oDoc = $oParser->parse();
126
- foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
127
- $oDeclaration->createBorderShorthand();
128
- }
129
- $this->assertSame(trim((string) $oDoc), $sExpected);
130
- }
131
-
132
- public function createBorderShorthandProvider() {
133
- return array(
134
- array('body {border-width: 2px;border-style: solid;border-color: #000;}', 'body {border: 2px solid #000;}'),
135
- array('body {border-style: none;}', 'body {border: none;}'),
136
- array('body {border-width: 1em;border-style: solid;}', 'body {border: 1em solid;}'),
137
- array('body {margin: 1em;}', 'body {margin: 1em;}')
138
- );
139
- }
140
-
141
- /**
142
- * @dataProvider createFontShorthandProvider
143
- * */
144
- public function testCreateFontShorthand($sCss, $sExpected) {
145
- $oParser = new Parser($sCss);
146
- $oDoc = $oParser->parse();
147
- foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
148
- $oDeclaration->createFontShorthand();
149
- }
150
- $this->assertSame(trim((string) $oDoc), $sExpected);
151
- }
152
-
153
- public function createFontShorthandProvider() {
154
- return array(
155
- array('body {font-size: 12px; font-family: serif}', 'body {font: 12px serif;}'),
156
- array('body {font-size: 12px; font-family: serif; font-style: italic;}', 'body {font: italic 12px serif;}'),
157
- array('body {font-size: 12px; font-family: serif; font-style: italic; font-weight: bold;}', 'body {font: italic bold 12px serif;}'),
158
- array('body {font-size: 12px; font-family: serif; font-style: italic; font-weight: bold; line-height: 1.6;}', 'body {font: italic bold 12px/1.6 serif;}'),
159
- array('body {font-size: 12px; font-family: serif; font-style: italic; font-weight: bold; line-height: 1.6; font-variant: small-caps;}', 'body {font: italic small-caps bold 12px/1.6 serif;}'),
160
- array('body {margin: 1em;}', 'body {margin: 1em;}')
161
- );
162
- }
163
-
164
- /**
165
- * @dataProvider createDimensionsShorthandProvider
166
- * */
167
- public function testCreateDimensionsShorthand($sCss, $sExpected) {
168
- $oParser = new Parser($sCss);
169
- $oDoc = $oParser->parse();
170
- foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
171
- $oDeclaration->createDimensionsShorthand();
172
- }
173
- $this->assertSame(trim((string) $oDoc), $sExpected);
174
- }
175
-
176
- public function createDimensionsShorthandProvider() {
177
- return array(
178
- array('body {border: 1px;}', 'body {border: 1px;}'),
179
- array('body {margin-top: 1px;}', 'body {margin-top: 1px;}'),
180
- array('body {margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em;}', 'body {margin: 1em;}'),
181
- array('body {margin-top: 1em; margin-right: 2em; margin-bottom: 1em; margin-left: 2em;}', 'body {margin: 1em 2em;}'),
182
- array('body {margin-top: 1em; margin-right: 2em; margin-bottom: 3em; margin-left: 2em;}', 'body {margin: 1em 2em 3em;}'),
183
- );
184
- }
185
-
186
- /**
187
- * @dataProvider createBackgroundShorthandProvider
188
- * */
189
- public function testCreateBackgroundShorthand($sCss, $sExpected) {
190
- $oParser = new Parser($sCss);
191
- $oDoc = $oParser->parse();
192
- foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
193
- $oDeclaration->createBackgroundShorthand();
194
- }
195
- $this->assertSame(trim((string) $oDoc), $sExpected);
196
- }
197
-
198
- public function createBackgroundShorthandProvider() {
199
- return array(
200
- array('body {border: 1px;}', 'body {border: 1px;}'),
201
- array('body {background-color: #f00;}', 'body {background: #f00;}'),
202
- array('body {background-color: #f00;background-image: url(foobar.png);}', 'body {background: #f00 url("foobar.png");}'),
203
- array('body {background-color: #f00;background-image: url(foobar.png);background-repeat: no-repeat;}', 'body {background: #f00 url("foobar.png") no-repeat;}'),
204
- array('body {background-color: #f00;background-image: url(foobar.png);background-repeat: no-repeat;}', 'body {background: #f00 url("foobar.png") no-repeat;}'),
205
- array('body {background-color: #f00;background-image: url(foobar.png);background-repeat: no-repeat;background-position: center;}', 'body {background: #f00 url("foobar.png") no-repeat center;}'),
206
- array('body {background-color: #f00;background-image: url(foobar.png);background-repeat: no-repeat;background-position: top left;}', 'body {background: #f00 url("foobar.png") no-repeat top left;}'),
207
- );
208
- }
209
-
210
- public function testOverrideRules() {
211
- $sCss = '.wrapper { left: 10px; text-align: left; }';
212
- $oParser = new Parser($sCss);
213
- $oDoc = $oParser->parse();
214
- $oRule = new Rule('right');
215
- $oRule->setValue('-10px');
216
- $aContents = $oDoc->getContents();
217
- $oWrapper = $aContents[0];
218
-
219
- $this->assertCount(2, $oWrapper->getRules());
220
- $aContents[0]->setRules(array($oRule));
221
-
222
- $aRules = $oWrapper->getRules();
223
- $this->assertCount(1, $aRules);
224
- $this->assertEquals('right', $aRules[0]->getRule());
225
- $this->assertEquals('-10px', $aRules[0]->getValue());
226
- }
227
-
228
- public function testRuleInsertion() {
229
- $sCss = '.wrapper { left: 10px; text-align: left; }';
230
- $oParser = new Parser($sCss);
231
- $oDoc = $oParser->parse();
232
- $aContents = $oDoc->getContents();
233
- $oWrapper = $aContents[0];
234
-
235
- $oFirst = $oWrapper->getRules('left');
236
- $this->assertCount(1, $oFirst);
237
- $oFirst = $oFirst[0];
238
-
239
- $oSecond = $oWrapper->getRules('text-');
240
- $this->assertCount(1, $oSecond);
241
- $oSecond = $oSecond[0];
242
-
243
- $oBefore = new Rule('left');
244
- $oBefore->setValue(new Size(16, 'em'));
245
-
246
- $oMiddle = new Rule('text-align');
247
- $oMiddle->setValue(new Size(1));
248
-
249
- $oAfter = new Rule('border-bottom-width');
250
- $oAfter->setValue(new Size(1, 'px'));
251
-
252
- $oWrapper->addRule($oAfter);
253
- $oWrapper->addRule($oBefore, $oFirst);
254
- $oWrapper->addRule($oMiddle, $oSecond);
255
-
256
- $aRules = $oWrapper->getRules();
257
-
258
- $this->assertSame($oBefore, $aRules[0]);
259
- $this->assertSame($oFirst, $aRules[1]);
260
- $this->assertSame($oMiddle, $aRules[2]);
261
- $this->assertSame($oSecond, $aRules[3]);
262
- $this->assertSame($oAfter, $aRules[4]);
263
-
264
- $this->assertSame('.wrapper {left: 16em;left: 10px;text-align: 1;text-align: left;border-bottom-width: 1px;}', $oDoc->render());
265
- }
266
-
267
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/RuleSet/LenientParsingTest.php DELETED
@@ -1,76 +0,0 @@
1
- <?php
2
-
3
- namespace Sabberworm\CSS\RuleSet;
4
-
5
- use Sabberworm\CSS\Parser;
6
- use Sabberworm\CSS\Settings;
7
-
8
- class LenientParsingTest extends \PHPUnit_Framework_TestCase {
9
-
10
- /**
11
- * @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
12
- */
13
- public function testFaultToleranceOff() {
14
- $sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-fault-tolerance.css";
15
- $oParser = new Parser(file_get_contents($sFile), Settings::create()->beStrict());
16
- $oParser->parse();
17
- }
18
-
19
- public function testFaultToleranceOn() {
20
- $sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-fault-tolerance.css";
21
- $oParser = new Parser(file_get_contents($sFile), Settings::create()->withLenientParsing(true));
22
- $oResult = $oParser->parse();
23
- $this->assertSame('.test1 {}'."\n".'.test2 {hello: 2.2;hello: 2000000000000.2;}'."\n".'#test {}'."\n".'#test2 {help: none;}', $oResult->render());
24
- }
25
-
26
- /**
27
- * @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
28
- */
29
- public function testEndToken() {
30
- $sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-end-token.css";
31
- $oParser = new Parser(file_get_contents($sFile), Settings::create()->beStrict());
32
- $oParser->parse();
33
- }
34
-
35
- /**
36
- * @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
37
- */
38
- public function testEndToken2() {
39
- $sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-end-token-2.css";
40
- $oParser = new Parser(file_get_contents($sFile), Settings::create()->beStrict());
41
- $oParser->parse();
42
- }
43
-
44
- public function testEndTokenPositive() {
45
- $sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-end-token.css";
46
- $oParser = new Parser(file_get_contents($sFile), Settings::create()->withLenientParsing(true));
47
- $oResult = $oParser->parse();
48
- $this->assertSame("", $oResult->render());
49
- }
50
-
51
- public function testEndToken2Positive() {
52
- $sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-end-token-2.css";
53
- $oParser = new Parser(file_get_contents($sFile), Settings::create()->withLenientParsing(true));
54
- $oResult = $oParser->parse();
55
- $this->assertSame('#home .bg-layout {background-image: url("/bundles/main/img/bg1.png?5");}', $oResult->render());
56
- }
57
-
58
- public function testLocaleTrap() {
59
- setlocale(LC_ALL, "pt_PT", "no");
60
- $sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-fault-tolerance.css";
61
- $oParser = new Parser(file_get_contents($sFile), Settings::create()->withLenientParsing(true));
62
- $oResult = $oParser->parse();
63
- $this->assertSame('.test1 {}'."\n".'.test2 {hello: 2.2;hello: 2000000000000.2;}'."\n".'#test {}'."\n".'#test2 {help: none;}', $oResult->render());
64
- }
65
-
66
- public function testCaseInsensitivity() {
67
- $sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "case-insensitivity.css";
68
- $oParser = new Parser(file_get_contents($sFile));
69
- $oResult = $oParser->parse();
70
- $this->assertSame('@charset "utf-8";
71
- @import url("test.css");
72
- @media screen {}
73
- #myid {case: insensitive !important;frequency: 30Hz;font-size: 1em;color: #ff0;color: hsl(40,40%,30%);font-family: Arial;}', $oResult->render());
74
- }
75
-
76
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/bootstrap.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- spl_autoload_register(function($class)
4
- {
5
- $file = __DIR__.'/../lib/'.strtr($class, '\\', '/').'.php';
6
- if (file_exists($file)) {
7
- require $file;
8
- return true;
9
- }
10
- });
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/-calc-no-space-around-minus.css DELETED
@@ -1 +0,0 @@
1
- div { width: calc(50% -8px); }
 
vendor/sabberworm/php-css-parser/tests/files/-charset-after-rule.css DELETED
@@ -1,5 +0,0 @@
1
- #id {
2
- prop: var(--val);
3
- }
4
-
5
- @charset 'utf-16';
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/-charset-in-block.css DELETED
@@ -1,3 +0,0 @@
1
- @media print {
2
- @charset 'utf-16';
3
- }
 
 
 
vendor/sabberworm/php-css-parser/tests/files/-empty-grid-linename.css DELETED
@@ -1 +0,0 @@
1
- .test { grid-template-columns: [] 100px; }
 
vendor/sabberworm/php-css-parser/tests/files/-empty.css DELETED
File without changes
vendor/sabberworm/php-css-parser/tests/files/-end-token-2.css DELETED
@@ -1 +0,0 @@
1
- #home .bg-layout { background-image: url(/bundles/main/img/bg1.png?5);};
 
vendor/sabberworm/php-css-parser/tests/files/-end-token.css DELETED
@@ -1 +0,0 @@
1
- /* Test comment
 
vendor/sabberworm/php-css-parser/tests/files/-fault-tolerance.css DELETED
@@ -1,15 +0,0 @@
1
- .test1 {
2
- //gaga: hello;
3
- }
4
-
5
- .test2 {
6
- *hello: 1;
7
- hello: 2.2;
8
- hello: 2000000000000.2;
9
- }
10
-
11
- #test {
12
- #hello: 1}
13
-
14
- #test2 {
15
- help: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/-tobedone.css DELETED
@@ -1,9 +0,0 @@
1
- .some[selectors-may='contain-a-{'] {
2
-
3
- }
4
-
5
- @media only screen and (min-width: 200px) {
6
- .test {
7
- prop: val;
8
- }
9
- }
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/1readme.css DELETED
@@ -1,10 +0,0 @@
1
- @charset "utf-8";
2
-
3
- @font-face {
4
- font-family: "CrassRoots";
5
- src: url("../media/cr.ttf")
6
- }
7
-
8
- html, body {
9
- font-size: 1.6em
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/2readme.css DELETED
@@ -1,5 +0,0 @@
1
- #header {
2
- margin: 10px 2em 1cm 2%;
3
- font-family: Verdana, Helvetica, "Gill Sans", sans-serif;
4
- color: red !important;
5
- }
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/atrules.css DELETED
@@ -1,57 +0,0 @@
1
- @charset "utf-8";
2
-
3
- @font-face {
4
- font-family: "CrassRoots";
5
- src: url("../media/cr.ttf")
6
- }
7
-
8
- html, body {
9
- font-size: -0.6em
10
- }
11
-
12
- @keyframes mymove {
13
- from { top: 0px; }
14
- to { top: 200px; }
15
- }
16
-
17
- @-moz-keyframes some-move {
18
- from { top: 0px; }
19
- to { top: 200px; }
20
- }
21
-
22
- @supports ( (perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px) ) {
23
- body {
24
- font-family: 'Helvetica';
25
- }
26
- }
27
-
28
- @page :pseudo-class {
29
- margin:2in;
30
- }
31
-
32
- @-moz-document url(http://www.w3.org/),
33
- url-prefix(http://www.w3.org/Style/),
34
- domain(mozilla.org),
35
- regexp("https:.*") {
36
- /* CSS rules here apply to:
37
- + The page "http://www.w3.org/".
38
- + Any page whose URL begins with "http://www.w3.org/Style/"
39
- + Any page whose URL's host is "mozilla.org" or ends with
40
- ".mozilla.org"
41
- + Any page whose URL starts with "https:" */
42
-
43
- /* make the above-mentioned pages really ugly */
44
- body { color: purple; background: yellow; }
45
- }
46
-
47
- @media screen and (orientation: landscape) {
48
- @-ms-viewport {
49
- width: 1024px;
50
- height: 768px;
51
- }
52
- /* CSS for landscape layout goes here */
53
- }
54
-
55
- @region-style #intro {
56
- p { color: blue; }
57
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/calc-nested.css DELETED
@@ -1,4 +0,0 @@
1
- .test {
2
- font-size: calc((3 * 4px) + -2px);
3
- top: calc(200px - calc(20 * 3px));
4
- }
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/calc.css DELETED
@@ -1,6 +0,0 @@
1
- div { width: calc(100% / 4); }
2
- div { margin-top: calc(-120% - 4px); }
3
- div {
4
- height: -webkit-calc(9/16 * 100%)!important;
5
- width: -moz-calc((50px - 50%)*2);
6
- }
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/case-insensitivity.css DELETED
@@ -1,15 +0,0 @@
1
- @CharSet "utf-8";
2
- @IMPORT uRL(test.css);
3
-
4
- @MEDIA screen {
5
-
6
- }
7
-
8
- #myid {
9
- CaSe: insensitive !imPORTANT;
10
- frequency: 30hz;
11
- font-size: 1EM;
12
- color: RGB(255, 255, 0);
13
- color: hSL(40, 40%, 30%);
14
- font-Family: Arial; /* The value needs to remain capitalized */
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/colortest.css DELETED
@@ -1,12 +0,0 @@
1
- #mine {
2
- color: red;
3
- border-color: rgb(10, 100, 230);
4
- border-color: rgba(10, 100, 231, 0.3);
5
- outline-color: #222;
6
- background-color: #232323;
7
- }
8
-
9
- #yours {
10
- background-color: hsl(220, 10%, 220%);
11
- background-color: hsla(220, 10%, 220%, 0.3);
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/comments.css DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Comments Hell.
3
- */
4
- @import /* Number 1 */"some/url.css"/* Number 2 */ screen/* Number 3 */;
5
-
6
- .foo, /* Number 4 */ #bar/* Number 5 */ {
7
- background-color/* Number 6 */: #000/* Number 7 */;
8
- }
9
-
10
- @media /* Number 8 */screen /* Number 9 */{
11
- /** Number 10 **/
12
- #foo.bar {
13
- /** Number 10b **/
14
- position: absolute;/**/
15
- }
16
- }
17
- /** Number 11 **/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/create-shorthands.css DELETED
@@ -1,6 +0,0 @@
1
- body {
2
- font-size: 2em; font-family: Helvetica,Arial,sans-serif; font-weight: bold;
3
- border-width: 2px; border-color: #999; border-style: dotted;
4
- background-color: #fff; background-image: url('foobar.png'); background-repeat: repeat-y;
5
- margin-top: 2px; margin-right: 3px; margin-bottom: 4px; margin-left: 5px;
6
- }
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/docuwiki.css DELETED
@@ -1 +0,0 @@
1
- div.dokuwiki div.ajax_qsearch{position:absolute;right:237px;;width:200px;opacity:0.9;display:none;font-size:80%;line-height:1.2em;border:1px solid #8cacbb;background-color:#f7f9fa;text-align:left;padding:4px;}
 
vendor/sabberworm/php-css-parser/tests/files/empty-grid-linename.css DELETED
@@ -1 +0,0 @@
1
- .test { grid-template-columns: [] 100px; }
 
vendor/sabberworm/php-css-parser/tests/files/expand-shorthands.css DELETED
@@ -1,7 +0,0 @@
1
- body {
2
- font: italic 500 14px/1.618 "Trebuchet MS", Georgia, serif;
3
- border: 2px solid #f0f;
4
- background: #ccc url("/images/foo.png") no-repeat left top;
5
- margin: 1em !important;
6
- padding: 2px 6px 3px;
7
- }
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/functions.css DELETED
@@ -1,21 +0,0 @@
1
- div.main { background-image: linear-gradient(#000, #fff) }
2
- .collapser::before,
3
- .collapser::-moz-before,
4
- .collapser::-webkit-before {
5
- content: "»";
6
- font-size: 1.2em;
7
- margin-right: .2em;
8
- -moz-transition-property: -moz-transform;
9
- -moz-transition-duration: .2s;
10
- -moz-transform-origin: center 60%;
11
- }
12
- .collapser.expanded::before,
13
- .collapser.expanded::-moz-before,
14
- .collapser.expanded::-webkit-before { -moz-transform: rotate(90deg) }
15
- .collapser + * {
16
- height: 0;
17
- overflow: hidden;
18
- -moz-transition-property: height;
19
- -moz-transition-duration: .3s;
20
- }
21
- .collapser.expanded + * { height: auto }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/grid-linename.css DELETED
@@ -1,2 +0,0 @@
1
- div { grid-template-columns: [ linename ] 100px; }
2
- span { grid-template-columns: [ linename1 linename2 ] 100px; }
 
 
vendor/sabberworm/php-css-parser/tests/files/hex-alpha.css DELETED
@@ -1,2 +0,0 @@
1
- div { background: #1234; }
2
- div { background: #11223344; }
 
 
vendor/sabberworm/php-css-parser/tests/files/ie-hacks.css DELETED
@@ -1,9 +0,0 @@
1
- p {
2
- padding-right: .75rem \9;
3
- background-image: none \9;
4
- color:red\9\0;
5
- background-color:red \9 \0;
6
- background-color:red \9 \0 !important;
7
- content: "red \9\0";
8
- content: "red\0abc";
9
- }
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/ie.css DELETED
@@ -1,6 +0,0 @@
1
- .nav-thumb-wrapper:hover img, a.activeSlide img {
2
- filter: alpha(opacity=100);
3
- -moz-opacity: 1;
4
- -khtml-opacity: 1;
5
- opacity: 1;
6
- }
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/important.css DELETED
@@ -1,8 +0,0 @@
1
- div.rating-cancel,div.star-rating{float:left;width:17px;height:15px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
2
- div.rating-cancel,div.rating-cancel a{background:url(images/delete.gif) no-repeat 0 -16px}
3
- div.star-rating,div.star-rating a{background:url(images/star.gif) no-repeat 0 0px}
4
- div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 0px;border:0}
5
- div.star-rating-on a{background-position:0 -16px!important}
6
- div.star-rating-hover a{background-position:0 -32px}
7
- div.star-rating-readonly a{cursor:default !important}
8
- div.star-rating{background:transparent!important; overflow:hidden!important}
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/inner-color.css DELETED
@@ -1,3 +0,0 @@
1
- test {
2
- background: -webkit-gradient(linear, 0 0, 0 bottom, from(#006cad), to(hsl(202, 100%, 49%)));
3
- }
 
 
 
vendor/sabberworm/php-css-parser/tests/files/line-numbers.css DELETED
@@ -1,32 +0,0 @@
1
- @charset "utf-8"; /* line 1 */
2
-
3
- @namespace "http://toto.example.org"; /* line 3 */
4
-
5
- @font-face { /* line 5 */
6
- font-family: "CrassRoots";
7
- src: url("http://example.com/media/cr.ttf") /* line 7 */
8
- }
9
-
10
-
11
- #header { /* line 11 */
12
- margin: 10px 2em 1cm 2%;
13
- font-family: Verdana, Helvetica, "Gill Sans", sans-serif;
14
- color: red !important;
15
- }
16
-
17
- @keyframes mymove { /* line 17 */
18
- from { top: 0px; } /* line 18 */
19
-
20
- to { top: 200px; } /* line 20 */
21
- }
22
-
23
- @IMPORT uRL(test.css); /* line 23 */
24
-
25
- body {
26
- background: #FFFFFF url("http://somesite.com/images/someimage.gif") repeat top center; /* line 25 */
27
- color: rgb( /* line 27 */
28
- 233, /* line 28 */
29
- 100, /* line 29 */
30
- 450 /* line 30 */
31
- );
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/missing-property-value.css DELETED
@@ -1,4 +0,0 @@
1
- div {
2
- display: inline-block;
3
- display:
4
- }
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/ms-filter.css DELETED
@@ -1 +0,0 @@
1
- .test {filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);}
 
vendor/sabberworm/php-css-parser/tests/files/namespaces.css DELETED
@@ -1,18 +0,0 @@
1
- /* From the spec at http://www.w3.org/TR/css3-namespace/ */
2
-
3
- @namespace toto "http://toto.example.org";
4
- @namespace "http://example.com/foo";
5
-
6
-
7
- /* From an introduction at http://www.blooberry.com/indexdot/css/syntax/atrules/namespace.htm */
8
- @namespace foo url("http://www.example.com/");
9
- @namespace foo url('http://www.example.com/');
10
-
11
-
12
- foo|test {
13
- gaga: 1;
14
- }
15
-
16
- |test {
17
- gaga: 2;
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/nested.css DELETED
@@ -1,17 +0,0 @@
1
- html {
2
- some: -test(val1);
3
- }
4
-
5
- html {
6
- some-other: -test(val1);
7
- }
8
-
9
- @media screen {
10
- html {
11
- some: -test(val2);
12
- }
13
- }
14
-
15
- #unrelated {
16
- other: yes;
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/slashed.css DELETED
@@ -1,4 +0,0 @@
1
- .test {
2
- font: 12px/1.5 Verdana, Arial, sans-serif;
3
- border-radius: 5px 10px 5px 10px / 10px 5px 10px 5px;
4
- }
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/specificity.css DELETED
@@ -1,7 +0,0 @@
1
- #test .help,
2
- #file,
3
- .help:hover,
4
- li.green,
5
- ol li::before {
6
- font-family: Helvetica;
7
- }
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/trailing-whitespace.css DELETED
@@ -1,2 +0,0 @@
1
- div { width: 200px; }
2
-
 
 
vendor/sabberworm/php-css-parser/tests/files/unicode-range.css DELETED
@@ -1,3 +0,0 @@
1
- @font-face {
2
- unicode-range: U+0100-024F, U+0259, U+1E??-2EFF, U+202F;
3
- }
 
 
 
vendor/sabberworm/php-css-parser/tests/files/unicode.css DELETED
@@ -1,12 +0,0 @@
1
- .test-1 { content: "\20"; } /* Same as " " */
2
- .test-2 { content: "\E9"; } /* Same as "é" */
3
- .test-3 { content: "\0020"; } /* Same as " " */
4
- .test-5 { content: "\6C34" } /* Same as "水" */
5
- .test-6 { content: "\00A5" } /* Same as "¥" */
6
- .test-7 { content: '\a' } /* Same as "\A" (Newline) */
7
- .test-8 { content: "\"\22" } /* Same as "\"\"" */
8
- .test-9 { content: "\"\27" } /* Same as ""\"\'"" */
9
- .test-10 { content: "\'\\" } /* Same as "'\" */
10
- .test-11 { content: "\test" } /* Same as "test" */
11
-
12
- .test-4 { content: "\1D11E" } /* Beyond the Basic Multilingual Plane */
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/unmatched_braces.css DELETED
@@ -1,18 +0,0 @@
1
- button,input,checkbox,textarea {
2
- outline: 0;
3
- margin: 0;
4
- }
5
-
6
- @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio:3/@media all and (orientation:portrait) {
7
- #wrapper {
8
- max-width:640px;
9
- margin: 0 auto;
10
- }
11
- }
12
-
13
- @media all and (orientation: landscape) {
14
- #wrapper {
15
- max-width:640px;
16
- margin: 0 auto;
17
- }
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/unopened-close-brackets.css DELETED
@@ -1,3 +0,0 @@
1
- }}}.blue{
2
- background: #00F;
3
- }
 
 
 
vendor/sabberworm/php-css-parser/tests/files/url.css DELETED
@@ -1,4 +0,0 @@
1
- body { background: #FFFFFF url("http://somesite.com/images/someimage.gif") repeat top center; }
2
- body {
3
- background-url: url("http://somesite.com/images/someimage.gif");
4
- }
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/values.css DELETED
@@ -1,14 +0,0 @@
1
- #header {
2
- margin: 10px 2em 1cm 2%;
3
- font-family: Verdana, Helvetica, "Gill Sans", sans-serif;
4
- font-size: 10px;
5
- color: red !important;
6
- background-color: green;
7
- background-color: rgba(0,128,0,0.7);
8
- frequency: 30Hz;
9
- }
10
-
11
- body {
12
- color: green;
13
- font: 75% "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/sabberworm/php-css-parser/tests/files/webkit.css DELETED
@@ -1 +0,0 @@
1
- .test { background:-webkit-linear-gradient(top right, white, black)}
 
vendor/sabberworm/php-css-parser/tests/files/whitespace.css DELETED
@@ -1,3 +0,0 @@
1
- .test {
2
- background-image : url ( 4px ) ;
3
- }
 
 
 
vendor/sabberworm/php-css-parser/tests/phpunit.xml DELETED
@@ -1 +0,0 @@
1
- <phpunit bootstrap="bootstrap.php"></phpunit>
 
vendor/sabberworm/php-css-parser/tests/quickdump.php DELETED
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env php
2
- <?php
3
-
4
- require_once(dirname(__FILE__).'/bootstrap.php');
5
-
6
- $sSource = file_get_contents('php://stdin');
7
- $oParser = new Sabberworm\CSS\Parser($sSource);
8
-
9
- $oDoc = $oParser->parse();
10
- echo "\n".'#### Input'."\n\n```css\n";
11
- print $sSource;
12
-
13
- echo "\n```\n\n".'#### Structure (`var_dump()`)'."\n\n```php\n";
14
- var_dump($oDoc);
15
-
16
- echo "\n```\n\n".'#### Output (`render()`)'."\n\n```css\n";
17
- print $oDoc->render();
18
-
19
- echo "\n```\n";
20
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/scssphp/scssphp/src/Compiler.php CHANGED
@@ -137,6 +137,7 @@ class Compiler
137
  public static $emptyString = [Type::T_STRING, '"', []];
138
  public static $with = [Type::T_KEYWORD, 'with'];
139
  public static $without = [Type::T_KEYWORD, 'without'];
 
140
 
141
  /**
142
  * @var array<int, string|callable>
@@ -1587,6 +1588,8 @@ class Compiler
1587
  * @param array $withCondition
1588
  *
1589
  * @return array
 
 
1590
  */
1591
  protected function compileWith($withCondition)
1592
  {
@@ -1606,9 +1609,10 @@ class Compiler
1606
  }
1607
  }
1608
 
1609
- if ($this->mapHasKey($withCondition, static::$with)) {
 
1610
  $without = []; // cancel the default
1611
- $list = $this->coerceList($this->libMapGet([$withCondition, static::$with]));
1612
 
1613
  foreach ($list[2] as $item) {
1614
  $keyword = $this->compileStringContent($this->coerceString($item));
@@ -1617,9 +1621,10 @@ class Compiler
1617
  }
1618
  }
1619
 
1620
- if ($this->mapHasKey($withCondition, static::$without)) {
 
1621
  $without = []; // cancel the default
1622
- $list = $this->coerceList($this->libMapGet([$withCondition, static::$without]));
1623
 
1624
  foreach ($list[2] as $item) {
1625
  $keyword = $this->compileStringContent($this->coerceString($item));
@@ -6929,14 +6934,18 @@ EOL;
6929
  }
6930
 
6931
  /**
6932
- * Coerce something to map
6933
  *
6934
- * @param array|Number $item
6935
  *
6936
- * @return array|Number
6937
  */
6938
- protected function coerceMap($item)
6939
  {
 
 
 
 
6940
  if ($item[0] === Type::T_MAP) {
6941
  return $item;
6942
  }
@@ -6948,6 +6957,24 @@ EOL;
6948
  return static::$emptyMap;
6949
  }
6950
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6951
  return $item;
6952
  }
6953
 
@@ -6984,18 +7011,6 @@ EOL;
6984
  $key = $keys[$i];
6985
  $value = $values[$i];
6986
 
6987
- switch ($key[0]) {
6988
- case Type::T_LIST:
6989
- case Type::T_MAP:
6990
- case Type::T_STRING:
6991
- case Type::T_NULL:
6992
- break;
6993
-
6994
- default:
6995
- $key = [Type::T_KEYWORD, $this->compileStringContent($this->coerceString($key))];
6996
- break;
6997
- }
6998
-
6999
  $list[] = [
7000
  Type::T_LIST,
7001
  '',
@@ -7294,15 +7309,15 @@ EOL;
7294
  */
7295
  public function assertMap($value, $varName = null)
7296
  {
7297
- $value = $this->coerceMap($value);
7298
 
7299
- if ($value[0] !== Type::T_MAP) {
7300
  $value = $this->compileValue($value);
7301
 
7302
  throw SassScriptException::forArgument("$value is not a map.", $varName);
7303
  }
7304
 
7305
- return $value;
7306
  }
7307
 
7308
  /**
@@ -8696,23 +8711,72 @@ will be an error in future versions of Sass.\n on line $line of $fname";
8696
  return $list;
8697
  }
8698
 
8699
- protected static $libMapGet = ['map', 'key'];
8700
  protected function libMapGet($args)
8701
  {
8702
  $map = $this->assertMap($args[0], 'map');
8703
- $key = $args[1];
 
 
 
 
 
 
 
 
 
 
8704
 
8705
- if (! \is_null($key)) {
8706
- $key = $this->compileStringContent($this->coerceString($key));
8707
 
8708
- for ($i = \count($map[1]) - 1; $i >= 0; $i--) {
8709
- if ($key === $this->compileStringContent($this->coerceString($map[1][$i]))) {
8710
- return $map[2][$i];
8711
- }
8712
  }
 
 
8713
  }
8714
 
8715
- return static::$null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8716
  }
8717
 
8718
  protected static $libMapKeys = ['map'];
@@ -8762,12 +8826,28 @@ will be an error in future versions of Sass.\n on line $line of $fname";
8762
  return $map;
8763
  }
8764
 
8765
- protected static $libMapHasKey = ['map', 'key'];
8766
  protected function libMapHasKey($args)
8767
  {
8768
  $map = $this->assertMap($args[0], 'map');
 
 
 
 
 
 
 
 
 
 
 
 
 
8769
 
8770
- return $this->toBool($this->mapHasKey($map, $args[1]));
 
 
 
8771
  }
8772
 
8773
  /**
@@ -8790,24 +8870,127 @@ will be an error in future versions of Sass.\n on line $line of $fname";
8790
 
8791
  protected static $libMapMerge = [
8792
  ['map1', 'map2'],
8793
- ['map-1', 'map-2']
 
8794
  ];
8795
  protected function libMapMerge($args)
8796
  {
8797
  $map1 = $this->assertMap($args[0], 'map1');
8798
- $map2 = $this->assertMap($args[1], 'map2');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8799
 
 
 
 
 
 
 
 
 
 
 
8800
  foreach ($map2[1] as $i2 => $key2) {
8801
- $key = $this->compileStringContent($this->coerceString($key2));
8802
 
8803
- foreach ($map1[1] as $i1 => $key1) {
8804
- if ($key === $this->compileStringContent($this->coerceString($key1))) {
8805
- $map1[2][$i1] = $map2[2][$i2];
8806
- continue 2;
8807
- }
8808
  }
8809
 
8810
- $map1[1][] = $map2[1][$i2];
8811
  $map1[2][] = $map2[2][$i2];
8812
  }
8813
 
137
  public static $emptyString = [Type::T_STRING, '"', []];
138
  public static $with = [Type::T_KEYWORD, 'with'];
139
  public static $without = [Type::T_KEYWORD, 'without'];
140
+ private static $emptyArgumentList = [Type::T_LIST, '', [], []];
141
 
142
  /**
143
  * @var array<int, string|callable>
1588
  * @param array $withCondition
1589
  *
1590
  * @return array
1591
+ *
1592
+ * @phpstan-return array{array<string, bool>, array<string, bool>}
1593
  */
1594
  protected function compileWith($withCondition)
1595
  {
1609
  }
1610
  }
1611
 
1612
+ $withConfig = $this->mapGet($withCondition, static::$with);
1613
+ if ($withConfig !== null) {
1614
  $without = []; // cancel the default
1615
+ $list = $this->coerceList($withConfig);
1616
 
1617
  foreach ($list[2] as $item) {
1618
  $keyword = $this->compileStringContent($this->coerceString($item));
1621
  }
1622
  }
1623
 
1624
+ $withoutConfig = $this->mapGet($withCondition, static::$without);
1625
+ if ($withoutConfig !== null) {
1626
  $without = []; // cancel the default
1627
+ $list = $this->coerceList($withoutConfig);
1628
 
1629
  foreach ($list[2] as $item) {
1630
  $keyword = $this->compileStringContent($this->coerceString($item));
6934
  }
6935
 
6936
  /**
6937
+ * Tries to convert an item to a Sass map
6938
  *
6939
+ * @param Number|array $item
6940
  *
6941
+ * @return array|null
6942
  */
6943
+ private function tryMap($item)
6944
  {
6945
+ if ($item instanceof Number) {
6946
+ return null;
6947
+ }
6948
+
6949
  if ($item[0] === Type::T_MAP) {
6950
  return $item;
6951
  }
6957
  return static::$emptyMap;
6958
  }
6959
 
6960
+ return null;
6961
+ }
6962
+
6963
+ /**
6964
+ * Coerce something to map
6965
+ *
6966
+ * @param array|Number $item
6967
+ *
6968
+ * @return array|Number
6969
+ */
6970
+ protected function coerceMap($item)
6971
+ {
6972
+ $map = $this->tryMap($item);
6973
+
6974
+ if ($map !== null) {
6975
+ return $map;
6976
+ }
6977
+
6978
  return $item;
6979
  }
6980
 
7011
  $key = $keys[$i];
7012
  $value = $values[$i];
7013
 
 
 
 
 
 
 
 
 
 
 
 
 
7014
  $list[] = [
7015
  Type::T_LIST,
7016
  '',
7309
  */
7310
  public function assertMap($value, $varName = null)
7311
  {
7312
+ $map = $this->tryMap($value);
7313
 
7314
+ if ($map === null) {
7315
  $value = $this->compileValue($value);
7316
 
7317
  throw SassScriptException::forArgument("$value is not a map.", $varName);
7318
  }
7319
 
7320
+ return $map;
7321
  }
7322
 
7323
  /**
8711
  return $list;
8712
  }
8713
 
8714
+ protected static $libMapGet = ['map', 'key', 'keys...'];
8715
  protected function libMapGet($args)
8716
  {
8717
  $map = $this->assertMap($args[0], 'map');
8718
+ if (!isset($args[2])) {
8719
+ // BC layer for usages of the function from PHP code rather than from the Sass function
8720
+ $args[2] = self::$emptyArgumentList;
8721
+ }
8722
+ $keys = array_merge([$args[1]], $args[2][2]);
8723
+ $value = static::$null;
8724
+
8725
+ foreach ($keys as $key) {
8726
+ if (!\is_array($map) || $map[0] !== Type::T_MAP) {
8727
+ return static::$null;
8728
+ }
8729
 
8730
+ $map = $this->mapGet($map, $key);
 
8731
 
8732
+ if ($map === null) {
8733
+ return static::$null;
 
 
8734
  }
8735
+
8736
+ $value = $map;
8737
  }
8738
 
8739
+ return $value;
8740
+ }
8741
+
8742
+ /**
8743
+ * Gets the value corresponding to that key in the map
8744
+ *
8745
+ * @param array $map
8746
+ * @param Number|array $key
8747
+ *
8748
+ * @return Number|array|null
8749
+ */
8750
+ private function mapGet(array $map, $key)
8751
+ {
8752
+ $index = $this->mapGetEntryIndex($map, $key);
8753
+
8754
+ if ($index !== null) {
8755
+ return $map[2][$index];
8756
+ }
8757
+
8758
+ return null;
8759
+ }
8760
+
8761
+ /**
8762
+ * Gets the index corresponding to that key in the map entries
8763
+ *
8764
+ * @param array $map
8765
+ * @param Number|array $key
8766
+ *
8767
+ * @return int|null
8768
+ */
8769
+ private function mapGetEntryIndex(array $map, $key)
8770
+ {
8771
+ $key = $this->compileStringContent($this->coerceString($key));
8772
+
8773
+ for ($i = \count($map[1]) - 1; $i >= 0; $i--) {
8774
+ if ($key === $this->compileStringContent($this->coerceString($map[1][$i]))) {
8775
+ return $i;
8776
+ }
8777
+ }
8778
+
8779
+ return null;
8780
  }
8781
 
8782
  protected static $libMapKeys = ['map'];
8826
  return $map;
8827
  }
8828
 
8829
+ protected static $libMapHasKey = ['map', 'key', 'keys...'];
8830
  protected function libMapHasKey($args)
8831
  {
8832
  $map = $this->assertMap($args[0], 'map');
8833
+ if (!isset($args[2])) {
8834
+ // BC layer for usages of the function from PHP code rather than from the Sass function
8835
+ $args[2] = self::$emptyArgumentList;
8836
+ }
8837
+ $keys = array_merge([$args[1]], $args[2][2]);
8838
+ $lastKey = array_pop($keys);
8839
+
8840
+ foreach ($keys as $key) {
8841
+ $value = $this->mapGet($map, $key);
8842
+
8843
+ if ($value === null || $value instanceof Number || $value[0] !== Type::T_MAP) {
8844
+ return self::$false;
8845
+ }
8846
 
8847
+ $map = $value;
8848
+ }
8849
+
8850
+ return $this->toBool($this->mapHasKey($map, $lastKey));
8851
  }
8852
 
8853
  /**
8870
 
8871
  protected static $libMapMerge = [
8872
  ['map1', 'map2'],
8873
+ ['map-1', 'map-2'],
8874
+ ['map1', 'args...']
8875
  ];
8876
  protected function libMapMerge($args)
8877
  {
8878
  $map1 = $this->assertMap($args[0], 'map1');
8879
+ $map2 = $args[1];
8880
+ $keys = [];
8881
+ if ($map2[0] === Type::T_LIST && isset($map2[3]) && \is_array($map2[3])) {
8882
+ // This is an argument list for the variadic signature
8883
+ if (\count($map2[2]) === 0) {
8884
+ throw new SassScriptException('Expected $args to contain a key.');
8885
+ }
8886
+ if (\count($map2[2]) === 1) {
8887
+ throw new SassScriptException('Expected $args to contain a value.');
8888
+ }
8889
+ $keys = $map2[2];
8890
+ $map2 = array_pop($keys);
8891
+ }
8892
+ $map2 = $this->assertMap($map2, 'map2');
8893
+
8894
+ return $this->modifyMap($map1, $keys, function ($oldValue) use ($map2) {
8895
+ $nestedMap = $this->tryMap($oldValue);
8896
+
8897
+ if ($nestedMap === null) {
8898
+ return $map2;
8899
+ }
8900
+
8901
+ return $this->mergeMaps($nestedMap, $map2);
8902
+ });
8903
+ }
8904
+
8905
+ /**
8906
+ * @param array $map
8907
+ * @param array $keys
8908
+ * @param callable $modify
8909
+ * @param bool $addNesting
8910
+ *
8911
+ * @return Number|array
8912
+ *
8913
+ * @phpstan-param array<Number|array> $keys
8914
+ * @phpstan-param callable(Number|array): (Number|array) $modify
8915
+ */
8916
+ private function modifyMap(array $map, array $keys, callable $modify, $addNesting = true)
8917
+ {
8918
+ if ($keys === []) {
8919
+ return $modify($map);
8920
+ }
8921
+
8922
+ return $this->modifyNestedMap($map, $keys, $modify, $addNesting);
8923
+ }
8924
+
8925
+ /**
8926
+ * @param array $map
8927
+ * @param array $keys
8928
+ * @param callable $modify
8929
+ * @param bool $addNesting
8930
+ *
8931
+ * @return array
8932
+ *
8933
+ * @phpstan-param non-empty-array<Number|array> $keys
8934
+ * @phpstan-param callable(Number|array): (Number|array) $modify
8935
+ */
8936
+ private function modifyNestedMap(array $map, array $keys, callable $modify, $addNesting)
8937
+ {
8938
+ $key = array_shift($keys);
8939
+
8940
+ $nestedValueIndex = $this->mapGetEntryIndex($map, $key);
8941
+
8942
+ if ($keys === []) {
8943
+ if ($nestedValueIndex !== null) {
8944
+ $map[2][$nestedValueIndex] = $modify($map[2][$nestedValueIndex]);
8945
+ } else {
8946
+ $map[1][] = $key;
8947
+ $map[2][] = $modify(self::$null);
8948
+ }
8949
+
8950
+ return $map;
8951
+ }
8952
+
8953
+ $nestedMap = $nestedValueIndex !== null ? $this->tryMap($map[2][$nestedValueIndex]) : null;
8954
+
8955
+ if ($nestedMap === null && !$addNesting) {
8956
+ return $map;
8957
+ }
8958
+
8959
+ if ($nestedMap === null) {
8960
+ $nestedMap = self::$emptyMap;
8961
+ }
8962
+
8963
+ $newNestedMap = $this->modifyNestedMap($nestedMap, $keys, $modify, $addNesting);
8964
+
8965
+ if ($nestedValueIndex !== null) {
8966
+ $map[2][$nestedValueIndex] = $newNestedMap;
8967
+ } else {
8968
+ $map[1][] = $key;
8969
+ $map[2][] = $newNestedMap;
8970
+ }
8971
+
8972
+ return $map;
8973
+ }
8974
 
8975
+ /**
8976
+ * Merges 2 Sass maps together
8977
+ *
8978
+ * @param array $map1
8979
+ * @param array $map2
8980
+ *
8981
+ * @return array
8982
+ */
8983
+ private function mergeMaps(array $map1, array $map2)
8984
+ {
8985
  foreach ($map2[1] as $i2 => $key2) {
8986
+ $map1EntryIndex = $this->mapGetEntryIndex($map1, $key2);
8987
 
8988
+ if ($map1EntryIndex !== null) {
8989
+ $map1[2][$map1EntryIndex] = $map2[2][$i2];
8990
+ continue;
 
 
8991
  }
8992
 
8993
+ $map1[1][] = $key2;
8994
  $map1[2][] = $map2[2][$i2];
8995
  }
8996
 
vendor/scssphp/scssphp/src/Version.php CHANGED
@@ -19,5 +19,5 @@ namespace ScssPhp\ScssPhp;
19
  */
20
  class Version
21
  {
22
- const VERSION = '1.8.1';
23
  }
19
  */
20
  class Version
21
  {
22
+ const VERSION = '1.9.0';
23
  }