Instant Articles for WP - Version 2.9

Version Description

Download this release

Release Info

Developer diegoquinteiro
Plugin Icon 128x128 Instant Articles for WP
Version 2.9
Comparing to
See all releases

Code changes from version 2.8 to 2.9

Files changed (104) hide show
  1. class-instant-articles-post.php +2 -0
  2. class-instant-articles-publisher.php +10 -1
  3. facebook-instant-articles.php +2 -2
  4. readme.txt +1 -1
  5. rules-configuration.json +0 -22
  6. settings/template-settings-info.php +6 -1
  7. vendor/composer/installed.json +8 -10
  8. vendor/facebook/facebook-instant-articles-sdk-php/composer.json +7 -2
  9. vendor/facebook/facebook-instant-articles-sdk-php/composer.lock +3 -3
  10. vendor/facebook/facebook-instant-articles-sdk-php/phpunit.xml +5 -1
  11. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Client/Client.php +0 -1
  12. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Client/Helper.php +0 -1
  13. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Audible.php +0 -1
  14. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Author.php +4 -4
  15. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/InstantArticle.php +1 -1
  16. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/ListItem.php +0 -5
  17. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/RelatedArticles.php +1 -1
  18. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/AbstractGetter.php +0 -2
  19. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/ChildrenGetter.php +0 -2
  20. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/ExistsGetter.php +0 -1
  21. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/IntegerGetter.php +0 -1
  22. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/NextSiblingGetter.php +0 -1
  23. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/StringGetter.php +0 -1
  24. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/XpathGetter.php +0 -1
  25. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/AdRule.php +0 -4
  26. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/AnalyticsRule.php +0 -4
  27. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/AnchorRule.php +0 -3
  28. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/AudioRule.php +0 -4
  29. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/AuthorRule.php +0 -3
  30. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/BlockquoteRule.php +0 -3
  31. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/BoldRule.php +0 -3
  32. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/CaptionCreditRule.php +0 -3
  33. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/CaptionRule.php +0 -4
  34. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ConfigurationSelectorRule.php +38 -3
  35. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/FooterRelatedArticlesRule.php +0 -3
  36. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/FooterRule.php +0 -4
  37. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/GeoTagRule.php +0 -2
  38. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/H1Rule.php +0 -3
  39. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/H2Rule.php +0 -3
  40. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderAdRule.php +0 -4
  41. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderImageRule.php +0 -4
  42. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderKickerRule.php +0 -3
  43. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderRule.php +0 -4
  44. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderSubTitleRule.php +0 -3
  45. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderTitleRule.php +0 -3
  46. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/IgnoreRule.php +0 -3
  47. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ImageRule.php +0 -4
  48. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InstantArticleRule.php +0 -4
  49. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InteractiveRule.php +0 -1
  50. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ItalicRule.php +0 -3
  51. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/LineBreakRule.php +0 -3
  52. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ListElementRule.php +0 -3
  53. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ListItemRule.php +0 -3
  54. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/MapRule.php +0 -1
  55. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ParagraphFooterRule.php +0 -3
  56. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ParagraphRule.php +0 -5
  57. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/PassThroughRule.php +0 -3
  58. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/PullquoteCiteRule.php +0 -3
  59. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/PullquoteRule.php +0 -3
  60. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/RelatedArticlesRule.php +0 -3
  61. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/RelatedItemRule.php +0 -3
  62. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/SlideshowImageRule.php +0 -3
  63. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/SlideshowRule.php +0 -3
  64. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/SocialEmbedRule.php +0 -1
  65. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/TextNodeRule.php +0 -3
  66. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/TimeRule.php +0 -3
  67. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/VideoRule.php +0 -4
  68. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Transformer.php +88 -8
  69. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Validators/Type.php +2 -2
  70. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Client/ClientTest.php +1 -1
  71. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Client/HelperTest.php +1 -3
  72. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/AdTest.php +1 -2
  73. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/AnalyticsTest.php +1 -2
  74. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/AudioTest.php +1 -2
  75. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/AuthorTest.php +1 -2
  76. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/BlockquoteTest.php +1 -2
  77. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/CaptionTest.php +1 -2
  78. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/CiteTest.php +1 -5
  79. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/FooterTest.php +1 -4
  80. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/GeoTagTest.php +1 -3
  81. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/H1Test.php +1 -5
  82. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/H2Test.php +1 -5
  83. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/HeaderTest.php +0 -7
  84. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/ImageTest.php +1 -4
  85. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/InstantArticleTest.php +1 -14
  86. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/InteractiveTest.php +1 -1
  87. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/ListElementTest.php +1 -2
  88. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/MapTest.php +1 -4
  89. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/ParagraphTest.php +1 -6
  90. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/PullquoteTest.php +1 -2
  91. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/RelatedArticlesTest.php +1 -3
  92. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/SlideshowTest.php +1 -5
  93. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/SocialEmbedTest.php +1 -3
  94. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/TimeTest.php +1 -2
  95. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/Validators/TypeTest.php +0 -2
  96. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/VideoTest.php +1 -3
  97. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Example/SimpleTransformerTest.php +2 -22
  98. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Example/simple-ia.xml +2 -2
  99. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Rules/AuthorRuleTest.php +1 -2
  100. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Rules/PullquoteRuleTest.php +1 -3
  101. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/TransformerTest.php +3 -21
  102. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Warnings/InvalidSelectorTest.php +1 -1
  103. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/instant-article-example.html +2 -2
  104. vendor/facebook/facebook-instant-articles-sdk-php/tests/bootstrap.php +0 -3
class-instant-articles-post.php CHANGED
@@ -663,6 +663,8 @@ class Instant_Articles_Post {
663
  // DOMDocument isn’t handling encodings too well, so let’s help it a little.
664
  if ( function_exists( 'mb_convert_encoding' ) ) {
665
  $content = mb_convert_encoding( $content, 'HTML-ENTITIES', get_option( 'blog_charset' ) );
 
 
666
  }
667
 
668
  $result = $document->loadHTML( '<!doctype html><html><body>' . $content . '</body></html>' );
663
  // DOMDocument isn’t handling encodings too well, so let’s help it a little.
664
  if ( function_exists( 'mb_convert_encoding' ) ) {
665
  $content = mb_convert_encoding( $content, 'HTML-ENTITIES', get_option( 'blog_charset' ) );
666
+ } else {
667
+ $content = htmlspecialchars_decode( utf8_decode( htmlentities( $content, ENT_COMPAT, 'utf-8', false ) ) );
668
  }
669
 
670
  $result = $document->loadHTML( '<!doctype html><html><body>' . $content . '</body></html>' );
class-instant-articles-publisher.php CHANGED
@@ -38,14 +38,23 @@ class Instant_Articles_Publisher {
38
  }
39
 
40
  // Don't process if this post is not published
41
- if ('publish' !== $post->post_status) {
42
  return;
43
  }
44
 
45
  // Transform the post to an Instant Article.
46
  $adapter = new Instant_Articles_Post( $post );
 
47
  $article = $adapter->to_instant_article();
48
 
 
 
 
 
 
 
 
 
49
  // Instantiate an API client.
50
  try {
51
  $fb_app_settings = Instant_Articles_Option_FB_App::get_option_decoded();
38
  }
39
 
40
  // Don't process if this post is not published
41
+ if ( 'publish' !== $post->post_status ) {
42
  return;
43
  }
44
 
45
  // Transform the post to an Instant Article.
46
  $adapter = new Instant_Articles_Post( $post );
47
+
48
  $article = $adapter->to_instant_article();
49
 
50
+ // Skip empty articles or articles missing title.
51
+ // This is important because the save_post action is also triggered by bulk updates, but in this case
52
+ // WordPress does not load the content field from DB for performance reasons. In this case, articles
53
+ // will be empty here, despite of them actually having content.
54
+ if ( count($article->getChildren()) === 0 || ! $article->getHeader() || ! $article->getHeader()->getTitle() ) {
55
+ return;
56
+ }
57
+
58
  // Instantiate an API client.
59
  try {
60
  $fb_app_settings = Instant_Articles_Option_FB_App::get_option_decoded();
facebook-instant-articles.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: Add support for Instant Articles for Facebook to your WordPress site.
5
  * Author: Automattic, Dekode, Facebook
6
  * Author URI: https://vip.wordpress.com/plugins/instant-articles/
7
- * Version: 2.8
8
  * Text Domain: instant-articles
9
  * License: GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -67,7 +67,7 @@ if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
67
 
68
  defined( 'ABSPATH' ) || die( 'Shame on you' );
69
 
70
- define( 'IA_PLUGIN_VERSION', '2.8' );
71
  define( 'IA_PLUGIN_PATH_FULL', __FILE__ );
72
  define( 'IA_PLUGIN_PATH', plugin_basename( __FILE__ ) );
73
  define( 'IA_PLUGIN_FILE_BASENAME', pathinfo( __FILE__, PATHINFO_FILENAME ) );
4
  * Description: Add support for Instant Articles for Facebook to your WordPress site.
5
  * Author: Automattic, Dekode, Facebook
6
  * Author URI: https://vip.wordpress.com/plugins/instant-articles/
7
+ * Version: 2.9
8
  * Text Domain: instant-articles
9
  * License: GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
67
 
68
  defined( 'ABSPATH' ) || die( 'Shame on you' );
69
 
70
+ define( 'IA_PLUGIN_VERSION', '2.9' );
71
  define( 'IA_PLUGIN_PATH_FULL', __FILE__ );
72
  define( 'IA_PLUGIN_PATH', plugin_basename( __FILE__ ) );
73
  define( 'IA_PLUGIN_FILE_BASENAME', pathinfo( __FILE__, PATHINFO_FILENAME ) );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: trrine, olethomas, bjornjohansen, dekode, automattic, facebook
3
  Tags: instant articles, facebook, mobile
4
  Requires at least: 4.3
5
  Tested up to: 4.5
6
- Stable tag: 2.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
3
  Tags: instant articles, facebook, mobile
4
  Requires at least: 4.3
5
  Tested up to: 4.5
6
+ Stable tag: 2.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
rules-configuration.json CHANGED
@@ -67,10 +67,6 @@
67
  "type": "string",
68
  "selector": "img",
69
  "attribute": "src"
70
- },
71
- "image.caption": {
72
- "type": "element",
73
- "selector": "img"
74
  }
75
  }
76
  },{
@@ -81,20 +77,6 @@
81
  "type": "string",
82
  "selector": "img",
83
  "attribute": "src"
84
- },
85
- "image.caption": {
86
- "type": "element",
87
- "selector": "img[@alt]"
88
- }
89
- }
90
- }, {
91
- "class": "CaptionRule",
92
- "selector": "img",
93
- "properties": {
94
- "caption.default": {
95
- "type": "string",
96
- "selector": "img",
97
- "attribute": "alt"
98
  }
99
  }
100
  }, {
@@ -217,10 +199,6 @@
217
  "type": "string",
218
  "selector": "img",
219
  "attribute": "src"
220
- },
221
- "image.caption": {
222
- "type": "element",
223
- "selector": "img[@alt]"
224
  }
225
  }
226
  }, {
67
  "type": "string",
68
  "selector": "img",
69
  "attribute": "src"
 
 
 
 
70
  }
71
  }
72
  },{
77
  "type": "string",
78
  "selector": "img",
79
  "attribute": "src"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
81
  }
82
  }, {
199
  "type": "string",
200
  "selector": "img",
201
  "attribute": "src"
 
 
 
 
202
  }
203
  }
204
  }, {
settings/template-settings-info.php CHANGED
@@ -20,7 +20,12 @@
20
  <?php endif; ?>
21
  <li>Install the Pages Manager app to preview your articles and styles on <a href="http://itunes.apple.com/app/facebook-pages-manager/id514643583?ls=1&mt=8&ign-mscache=1" target="_blank">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.facebook.pages.app" target="_blank">Android</a>.
22
  <li>Create a style template for your articles, using the Style Editor. Be sure to provide the name of the template you want to use in the Plugin Configuration settings below.
23
- <li>[Optional] Enable Audience Network, if you choose. Learn more about <a href="https://fbinstantarticles.files.wordpress.com/2016/03/audience-network_wp_instant-articles-2-2-web_self-serve.pdf" target="_blank">Audience Network</a> for Instant Articles and <a href="" target="_blank">sign up here</a>.
 
 
 
 
 
24
  <li>[Optional] Set up your ads and analytics, including Audience Network, in the Configuration area, below.
25
  <?php if ( isset( $fb_page_settings['page_id'] ) && ! empty ( $fb_page_settings['page_id'] ) ) : ?>
26
  <li>
20
  <?php endif; ?>
21
  <li>Install the Pages Manager app to preview your articles and styles on <a href="http://itunes.apple.com/app/facebook-pages-manager/id514643583?ls=1&mt=8&ign-mscache=1" target="_blank">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.facebook.pages.app" target="_blank">Android</a>.
22
  <li>Create a style template for your articles, using the Style Editor. Be sure to provide the name of the template you want to use in the Plugin Configuration settings below.
23
+ <li>[Optional] Enable Audience Network, if you choose. Learn more about <a href="https://fbinstantarticles.files.wordpress.com/2016/03/audience-network_wp_instant-articles-2-2-web_self-serve.pdf" target="_blank">Audience Network</a> for Instant Articles.
24
+ <?php if ( isset( $fb_page_settings['page_id'] ) && ! empty ( $fb_page_settings['page_id'] ) ) : ?>
25
+ Sign up for Audience Network
26
+ <a
27
+ href="https://www.facebook.com/<?php echo esc_attr( $fb_page_settings['page_id'] ); ?>/settings/?tab=instant_articles#Audience-Network" target="_blank">here</a>.
28
+ <?php endif; ?>
29
  <li>[Optional] Set up your ads and analytics, including Audience Network, in the Configuration area, below.
30
  <?php if ( isset( $fb_page_settings['page_id'] ) && ! empty ( $fb_page_settings['page_id'] ) ) : ?>
31
  <li>
vendor/composer/installed.json CHANGED
@@ -145,36 +145,34 @@
145
  },
146
  {
147
  "name": "facebook/facebook-instant-articles-sdk-php",
148
- "version": "v1.0.5",
149
- "version_normalized": "1.0.5.0",
150
  "source": {
151
  "type": "git",
152
  "url": "https://github.com/facebook/facebook-instant-articles-sdk-php.git",
153
- "reference": "0ef500ab82a54dbc8e13faed107ee6beed017107"
154
  },
155
  "dist": {
156
  "type": "zip",
157
- "url": "https://api.github.com/repos/facebook/facebook-instant-articles-sdk-php/zipball/0ef500ab82a54dbc8e13faed107ee6beed017107",
158
- "reference": "0ef500ab82a54dbc8e13faed107ee6beed017107",
159
  "shasum": ""
160
  },
161
  "require": {
162
  "apache/log4php": "2.3.0",
163
  "facebook/php-sdk-v4": "~5.0",
164
- "php": ">=5.4",
165
  "symfony/css-selector": "2.8.*"
166
  },
167
  "require-dev": {
168
  "phpunit/phpunit": "^4.8"
169
  },
170
- "time": "2016-04-14 22:49:19",
171
  "type": "library",
172
  "installation-source": "dist",
173
  "autoload": {
174
  "psr-4": {
175
- "Facebook\\InstantArticles\\": [
176
- "src/Facebook/InstantArticles/"
177
- ]
178
  }
179
  },
180
  "notification-url": "https://packagist.org/downloads/",
145
  },
146
  {
147
  "name": "facebook/facebook-instant-articles-sdk-php",
148
+ "version": "v1.0.6",
149
+ "version_normalized": "1.0.6.0",
150
  "source": {
151
  "type": "git",
152
  "url": "https://github.com/facebook/facebook-instant-articles-sdk-php.git",
153
+ "reference": "576395bbf3fc7b9ca444bef3469f7d9f781153f6"
154
  },
155
  "dist": {
156
  "type": "zip",
157
+ "url": "https://api.github.com/repos/facebook/facebook-instant-articles-sdk-php/zipball/576395bbf3fc7b9ca444bef3469f7d9f781153f6",
158
+ "reference": "576395bbf3fc7b9ca444bef3469f7d9f781153f6",
159
  "shasum": ""
160
  },
161
  "require": {
162
  "apache/log4php": "2.3.0",
163
  "facebook/php-sdk-v4": "~5.0",
164
+ "php": "^5.4 || ^7.0",
165
  "symfony/css-selector": "2.8.*"
166
  },
167
  "require-dev": {
168
  "phpunit/phpunit": "^4.8"
169
  },
170
+ "time": "2016-04-19 16:57:18",
171
  "type": "library",
172
  "installation-source": "dist",
173
  "autoload": {
174
  "psr-4": {
175
+ "Facebook\\InstantArticles\\": "src/Facebook/InstantArticles/"
 
 
176
  }
177
  },
178
  "notification-url": "https://packagist.org/downloads/",
vendor/facebook/facebook-instant-articles-sdk-php/composer.json CHANGED
@@ -10,7 +10,7 @@
10
  "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-php/contributors"
11
  }],
12
  "require": {
13
- "php": ">=5.4",
14
  "symfony/css-selector": "2.8.*",
15
  "facebook/php-sdk-v4": "~5.0",
16
  "apache/log4php": "2.3.0"
@@ -20,7 +20,12 @@
20
  },
21
  "autoload": {
22
  "psr-4": {
23
- "Facebook\\InstantArticles\\": ["src/Facebook/InstantArticles/"]
 
 
 
 
 
24
  }
25
  }
26
  }
10
  "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-php/contributors"
11
  }],
12
  "require": {
13
+ "php": "^5.4 || ^7.0",
14
  "symfony/css-selector": "2.8.*",
15
  "facebook/php-sdk-v4": "~5.0",
16
  "apache/log4php": "2.3.0"
20
  },
21
  "autoload": {
22
  "psr-4": {
23
+ "Facebook\\InstantArticles\\": "src/Facebook/InstantArticles/"
24
+ }
25
+ },
26
+ "autoload-dev": {
27
+ "psr-4": {
28
+ "Facebook\\InstantArticles\\": "tests/Facebook/InstantArticles/"
29
  }
30
  }
31
  }
vendor/facebook/facebook-instant-articles-sdk-php/composer.lock CHANGED
@@ -4,8 +4,8 @@
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
- "hash": "27451258fbd10b198e79d95a28d003f6",
8
- "content-hash": "d1a7e51f731a8e2756648dca0a386d0a",
9
  "packages": [
10
  {
11
  "name": "apache/log4php",
@@ -1107,7 +1107,7 @@
1107
  "prefer-stable": false,
1108
  "prefer-lowest": false,
1109
  "platform": {
1110
- "php": ">=5.4"
1111
  },
1112
  "platform-dev": []
1113
  }
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
+ "hash": "0c13e62e40fedba027d2ea28e713d382",
8
+ "content-hash": "ccec3d1767e6b90c43723a4672da4641",
9
  "packages": [
10
  {
11
  "name": "apache/log4php",
1107
  "prefer-stable": false,
1108
  "prefer-lowest": false,
1109
  "platform": {
1110
+ "php": "^5.4 || ^7.0"
1111
  },
1112
  "platform-dev": []
1113
  }
vendor/facebook/facebook-instant-articles-sdk-php/phpunit.xml CHANGED
@@ -1,5 +1,9 @@
1
  <?xml version="1.0" encoding="utf-8" ?>
2
- <phpunit bootstrap="./tests/bootstrap.php">
 
 
 
 
3
  <testsuites>
4
  <testsuite name="The project's test suite">
5
  <directory>./tests</directory>
1
  <?xml version="1.0" encoding="utf-8" ?>
2
+ <phpunit
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
5
+ bootstrap="vendor/autoload.php"
6
+ >
7
  <testsuites>
8
  <testsuite name="The project's test suite">
9
  <directory>./tests</directory>
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Client/Client.php CHANGED
@@ -11,7 +11,6 @@ namespace Facebook\InstantArticles\Client;
11
 
12
  use Facebook\Facebook;
13
  use Facebook\InstantArticles\Elements\InstantArticle;
14
- use Facebook\Authentication\AccessToken;
15
  use Facebook\InstantArticles\Validators\Type;
16
 
17
  class Client
11
 
12
  use Facebook\Facebook;
13
  use Facebook\InstantArticles\Elements\InstantArticle;
 
14
  use Facebook\InstantArticles\Validators\Type;
15
 
16
  class Client
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Client/Helper.php CHANGED
@@ -9,7 +9,6 @@
9
  namespace Facebook\InstantArticles\Client;
10
 
11
  use Facebook\Facebook;
12
- use Facebook\Exceptions\FacebookResponseException;
13
  use Facebook\Exceptions\FacebookSDKException;
14
  use Facebook\Authentication\AccessToken;
15
  use Facebook\InstantArticles\Validators\Type;
9
  namespace Facebook\InstantArticles\Client;
10
 
11
  use Facebook\Facebook;
 
12
  use Facebook\Exceptions\FacebookSDKException;
13
  use Facebook\Authentication\AccessToken;
14
  use Facebook\InstantArticles\Validators\Type;
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Audible.php CHANGED
@@ -8,7 +8,6 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Validators\Type;
12
 
13
  /**
14
  * Abstract class Audible
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  /**
13
  * Abstract class Audible
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Author.php CHANGED
@@ -119,7 +119,7 @@ class Author extends Element
119
  }
120
 
121
  /**
122
- * @param string author link url profile
123
  */
124
  public function getUrl()
125
  {
@@ -127,7 +127,7 @@ class Author extends Element
127
  }
128
 
129
  /**
130
- * @param string author name
131
  */
132
  public function getName()
133
  {
@@ -135,7 +135,7 @@ class Author extends Element
135
  }
136
 
137
  /**
138
- * @param string author small introduction biography
139
  */
140
  public function getDescription()
141
  {
@@ -143,7 +143,7 @@ class Author extends Element
143
  }
144
 
145
  /**
146
- * @param string author short text to define its contribution/role
147
  */
148
  public function getRoleContribution()
149
  {
119
  }
120
 
121
  /**
122
+ * @return string author link url profile
123
  */
124
  public function getUrl()
125
  {
127
  }
128
 
129
  /**
130
+ * @return string author name
131
  */
132
  public function getName()
133
  {
135
  }
136
 
137
  /**
138
+ * @return string author small introduction biography
139
  */
140
  public function getDescription()
141
  {
143
  }
144
 
145
  /**
146
+ * @return string author short text to define its contribution/role
147
  */
148
  public function getRoleContribution()
149
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/InstantArticle.php CHANGED
@@ -33,7 +33,7 @@ use Facebook\InstantArticles\Validators\Type;
33
  */
34
  class InstantArticle extends Element
35
  {
36
- const CURRENT_VERSION = '1.0.5';
37
 
38
  /**
39
  * The meta properties that are used on <head>
33
  */
34
  class InstantArticle extends Element
35
  {
36
+ const CURRENT_VERSION = '1.0.6';
37
 
38
  /**
39
  * The meta properties that are used on <head>
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/ListItem.php CHANGED
@@ -8,7 +8,6 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Validators\Type;
12
 
13
  /**
14
  * Class List that represents a simple HTML list
@@ -18,10 +17,6 @@ use Facebook\InstantArticles\Validators\Type;
18
  */
19
  class ListItem extends TextContainer
20
  {
21
- /**
22
- * @var TextContainer
23
- */
24
- private $text;
25
 
26
  private function __construct()
27
  {
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  /**
13
  * Class List that represents a simple HTML list
17
  */
18
  class ListItem extends TextContainer
19
  {
 
 
 
 
20
 
21
  private function __construct()
22
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/RelatedArticles.php CHANGED
@@ -90,7 +90,7 @@ class RelatedArticles extends Element
90
  }
91
 
92
  /**
93
- * @param string the name of related articles block
94
  */
95
  public function getTitle()
96
  {
90
  }
91
 
92
  /**
93
+ * @return string the name of related articles block
94
  */
95
  public function getTitle()
96
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/AbstractGetter.php CHANGED
@@ -8,8 +8,6 @@
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
- use Facebook\InstantArticles\Validators\Type;
12
- use Symfony\Component\CssSelector\CssSelectorConverter;
13
 
14
  /**
15
  * Class abstract for all getters.
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
 
 
11
 
12
  /**
13
  * Class abstract for all getters.
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/ChildrenGetter.php CHANGED
@@ -8,8 +8,6 @@
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
- use Facebook\InstantArticles\Validators\Type;
12
- use Symfony\Component\CssSelector\CssSelectorConverter;
13
 
14
  class ChildrenGetter extends ElementGetter
15
  {
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
 
 
11
 
12
  class ChildrenGetter extends ElementGetter
13
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/ExistsGetter.php CHANGED
@@ -9,7 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
  use Facebook\InstantArticles\Validators\Type;
12
- use Symfony\Component\CssSelector\CssSelectorConverter;
13
 
14
  class ExistsGetter extends StringGetter
15
  {
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
  use Facebook\InstantArticles\Validators\Type;
 
12
 
13
  class ExistsGetter extends StringGetter
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/IntegerGetter.php CHANGED
@@ -9,7 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
  use Facebook\InstantArticles\Validators\Type;
12
- use Symfony\Component\CssSelector\CssSelectorConverter;
13
 
14
  class IntegerGetter extends StringGetter
15
  {
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
  use Facebook\InstantArticles\Validators\Type;
 
12
 
13
  class IntegerGetter extends StringGetter
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/NextSiblingGetter.php CHANGED
@@ -9,7 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
  use Facebook\InstantArticles\Validators\Type;
12
- use Symfony\Component\CssSelector\CssSelectorConverter;
13
 
14
  class NextSiblingGetter extends StringGetter
15
  {
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
  use Facebook\InstantArticles\Validators\Type;
 
12
 
13
  class NextSiblingGetter extends StringGetter
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/StringGetter.php CHANGED
@@ -9,7 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
  use Facebook\InstantArticles\Validators\Type;
12
- use Symfony\Component\CssSelector\CssSelectorConverter;
13
 
14
  class StringGetter extends ChildrenGetter
15
  {
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
  use Facebook\InstantArticles\Validators\Type;
 
12
 
13
  class StringGetter extends ChildrenGetter
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/XpathGetter.php CHANGED
@@ -9,7 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
  use Facebook\InstantArticles\Validators\Type;
12
- use Symfony\Component\CssSelector\CssSelectorConverter;
13
 
14
  class XpathGetter extends ChildrenGetter
15
  {
9
  namespace Facebook\InstantArticles\Transformer\Getters;
10
 
11
  use Facebook\InstantArticles\Validators\Type;
 
12
 
13
  class XpathGetter extends ChildrenGetter
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/AdRule.php CHANGED
@@ -10,10 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Ad;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
- use Facebook\InstantArticles\Transformer\Getters\IntegerGetter;
17
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
18
 
19
  class AdRule extends ConfigurationSelectorRule
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Ad;
 
 
 
 
13
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
15
  class AdRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/AnalyticsRule.php CHANGED
@@ -10,10 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Analytics;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
- use Facebook\InstantArticles\Transformer\Getters\IntegerGetter;
17
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
18
 
19
  class AnalyticsRule extends ConfigurationSelectorRule
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Analytics;
 
 
 
 
13
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
15
  class AnalyticsRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/AnchorRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\TextContainer;
12
  use Facebook\InstantArticles\Elements\Anchor;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class AnchorRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\TextContainer;
12
  use Facebook\InstantArticles\Elements\Anchor;
 
 
 
13
 
14
  class AnchorRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/AudioRule.php CHANGED
@@ -10,11 +10,7 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Image;
12
  use Facebook\InstantArticles\Elements\Audio;
13
- use Facebook\InstantArticles\Elements\Caption;
14
  use Facebook\InstantArticles\Elements\Audible;
15
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
16
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
17
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
18
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
19
 
20
  class AudioRule extends ConfigurationSelectorRule
10
 
11
  use Facebook\InstantArticles\Elements\Image;
12
  use Facebook\InstantArticles\Elements\Audio;
 
13
  use Facebook\InstantArticles\Elements\Audible;
 
 
 
14
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
15
 
16
  class AudioRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/AuthorRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Header;
12
  use Facebook\InstantArticles\Elements\Author;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
17
 
18
  class AuthorRule extends ConfigurationSelectorRule
10
 
11
  use Facebook\InstantArticles\Elements\Header;
12
  use Facebook\InstantArticles\Elements\Author;
 
 
 
13
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
15
  class AuthorRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/BlockquoteRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Blockquote;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class BlockquoteRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Blockquote;
 
 
 
13
 
14
  class BlockquoteRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/BoldRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\TextContainer;
12
  use Facebook\InstantArticles\Elements\Bold;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class BoldRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\TextContainer;
12
  use Facebook\InstantArticles\Elements\Bold;
 
 
 
13
 
14
  class BoldRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/CaptionCreditRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Caption;
12
  use Facebook\InstantArticles\Elements\Cite;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class CaptionCreditRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\Caption;
12
  use Facebook\InstantArticles\Elements\Cite;
 
 
 
13
 
14
  class CaptionCreditRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/CaptionRule.php CHANGED
@@ -15,10 +15,6 @@ use Facebook\InstantArticles\Elements\SocialEmbed;
15
  use Facebook\InstantArticles\Elements\Video;
16
  use Facebook\InstantArticles\Elements\Image;
17
  use Facebook\InstantArticles\Elements\Caption;
18
- use Facebook\InstantArticles\Elements\InstantArticle;
19
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
20
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
21
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
22
 
23
  class CaptionRule extends ConfigurationSelectorRule
24
  {
15
  use Facebook\InstantArticles\Elements\Video;
16
  use Facebook\InstantArticles\Elements\Image;
17
  use Facebook\InstantArticles\Elements\Caption;
 
 
 
 
18
 
19
  class CaptionRule extends ConfigurationSelectorRule
20
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ConfigurationSelectorRule.php CHANGED
@@ -10,8 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Symfony\Component\CssSelector\CssSelectorConverter;
12
  use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
13
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
14
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
15
  use Facebook\InstantArticles\Validators\Type;
16
 
17
  abstract class ConfigurationSelectorRule extends Rule
@@ -54,10 +52,47 @@ abstract class ConfigurationSelectorRule extends Rule
54
 
55
  public function matchesNode($node)
56
  {
57
- if ($this->selector === 'html' && $node->nodeName === 'html') {
 
 
 
 
 
 
58
  return true;
59
  }
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  $document = $node->ownerDocument;
62
  $domXPath = new \DOMXPath($document);
63
 
10
 
11
  use Symfony\Component\CssSelector\CssSelectorConverter;
12
  use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
 
 
13
  use Facebook\InstantArticles\Validators\Type;
14
 
15
  abstract class ConfigurationSelectorRule extends Rule
52
 
53
  public function matchesNode($node)
54
  {
55
+ // Only matches DOMElements (ignore text and comments)
56
+ if (!Type::is($node, 'DOMElement')) {
57
+ return false;
58
+ }
59
+
60
+ // Handles selector = tag
61
+ if ($node->nodeName === $this->selector) {
62
  return true;
63
  }
64
 
65
+ // Handles selector = .class
66
+ if (preg_match('/^\.[a-zA-Z][a-zA-Z0-9-]*$/', $this->selector) === 1) {
67
+
68
+ // Tries every class
69
+ $classNames = explode(' ', $node->getAttribute('class'));
70
+ foreach ($classNames as $className) {
71
+ if ('.' . $className === $this->selector) {
72
+ return true;
73
+ }
74
+ }
75
+
76
+ // No match!
77
+ return false;
78
+ }
79
+
80
+ // Handles selector = tag.class
81
+ if (preg_match('/^[a-zA-Z][a-zA-Z0-9-]*(\.[a-zA-Z][a-zA-Z0-9-]*)?$/', $this->selector) === 1) {
82
+
83
+ // Tries every class
84
+ $classNames = explode(' ', $node->getAttribute('class'));
85
+ foreach ($classNames as $className) {
86
+ if ($node->nodeName . '.' . $className === $this->selector) {
87
+ return true;
88
+ }
89
+ }
90
+
91
+ // No match!
92
+ return false;
93
+ }
94
+
95
+ // Proceed with the more expensive XPath query
96
  $document = $node->ownerDocument;
97
  $domXPath = new \DOMXPath($document);
98
 
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/FooterRelatedArticlesRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\RelatedArticles;
12
  use Facebook\InstantArticles\Elements\Footer;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class FooterRelatedArticlesRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\RelatedArticles;
12
  use Facebook\InstantArticles\Elements\Footer;
 
 
 
13
 
14
  class FooterRelatedArticlesRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/FooterRule.php CHANGED
@@ -9,11 +9,7 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
- use Facebook\InstantArticles\Elements\Paragraph;
13
  use Facebook\InstantArticles\Elements\Footer;
14
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
15
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
16
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
17
 
18
  class FooterRule extends ConfigurationSelectorRule
19
  {
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
 
12
  use Facebook\InstantArticles\Elements\Footer;
 
 
 
13
 
14
  class FooterRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/GeoTagRule.php CHANGED
@@ -12,8 +12,6 @@ use Facebook\InstantArticles\Elements\Image;
12
  use Facebook\InstantArticles\Elements\Video;
13
  use Facebook\InstantArticles\Elements\Map;
14
  use Facebook\InstantArticles\Elements\GeoTag;
15
- use Facebook\InstantArticles\Elements\Caption;
16
- use Facebook\InstantArticles\Elements\InstantArticle;
17
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
18
 
19
  class GeoTagRule extends ConfigurationSelectorRule
12
  use Facebook\InstantArticles\Elements\Video;
13
  use Facebook\InstantArticles\Elements\Map;
14
  use Facebook\InstantArticles\Elements\GeoTag;
 
 
15
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
16
 
17
  class GeoTagRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/H1Rule.php CHANGED
@@ -12,9 +12,6 @@ use Facebook\InstantArticles\Elements\Caption;
12
  use Facebook\InstantArticles\Elements\H1;
13
  use Facebook\InstantArticles\Elements\Instantarticle;
14
  use Facebook\InstantArticles\Validators\Type;
15
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
16
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
17
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
18
 
19
  class H1Rule extends ConfigurationSelectorRule
20
  {
12
  use Facebook\InstantArticles\Elements\H1;
13
  use Facebook\InstantArticles\Elements\Instantarticle;
14
  use Facebook\InstantArticles\Validators\Type;
 
 
 
15
 
16
  class H1Rule extends ConfigurationSelectorRule
17
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/H2Rule.php CHANGED
@@ -12,9 +12,6 @@ use Facebook\InstantArticles\Elements\Caption;
12
  use Facebook\InstantArticles\Elements\H2;
13
  use Facebook\InstantArticles\Elements\Instantarticle;
14
  use Facebook\InstantArticles\Validators\Type;
15
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
16
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
17
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
18
 
19
  class H2Rule extends ConfigurationSelectorRule
20
  {
12
  use Facebook\InstantArticles\Elements\H2;
13
  use Facebook\InstantArticles\Elements\Instantarticle;
14
  use Facebook\InstantArticles\Validators\Type;
 
 
 
15
 
16
  class H2Rule extends ConfigurationSelectorRule
17
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderAdRule.php CHANGED
@@ -10,10 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Header;
12
  use Facebook\InstantArticles\Elements\Ad;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
- use Facebook\InstantArticles\Transformer\Getters\IntegerGetter;
17
 
18
  class HeaderAdRule extends ConfigurationSelectorRule
19
  {
10
 
11
  use Facebook\InstantArticles\Elements\Header;
12
  use Facebook\InstantArticles\Elements\Ad;
 
 
 
 
13
 
14
  class HeaderAdRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderImageRule.php CHANGED
@@ -9,11 +9,7 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Image;
12
- use Facebook\InstantArticles\Elements\Caption;
13
  use Facebook\InstantArticles\Elements\Header;
14
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
15
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
16
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
17
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
18
 
19
  class HeaderImageRule extends ConfigurationSelectorRule
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Image;
 
12
  use Facebook\InstantArticles\Elements\Header;
 
 
 
13
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
15
  class HeaderImageRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderKickerRule.php CHANGED
@@ -9,9 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Header;
12
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
13
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
14
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
15
 
16
  class HeaderKickerRule extends ConfigurationSelectorRule
17
  {
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Header;
 
 
 
12
 
13
  class HeaderKickerRule extends ConfigurationSelectorRule
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderRule.php CHANGED
@@ -9,11 +9,7 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Header;
12
- use Facebook\InstantArticles\Elements\Image;
13
- use Facebook\InstantArticles\Elements\Caption;
14
  use Facebook\InstantArticles\Elements\InstantArticle;
15
- use Facebook\InstantArticles\Validators\Type;
16
- use Facebook\InstantArticles\Transformer\Transformer;
17
 
18
  class HeaderRule extends ConfigurationSelectorRule
19
  {
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Header;
 
 
12
  use Facebook\InstantArticles\Elements\InstantArticle;
 
 
13
 
14
  class HeaderRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderSubTitleRule.php CHANGED
@@ -9,9 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Header;
12
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
13
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
14
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
15
 
16
  class HeaderSubTitleRule extends ConfigurationSelectorRule
17
  {
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Header;
 
 
 
12
 
13
  class HeaderSubTitleRule extends ConfigurationSelectorRule
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/HeaderTitleRule.php CHANGED
@@ -9,9 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Header;
12
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
13
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
14
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
15
 
16
  class HeaderTitleRule extends ConfigurationSelectorRule
17
  {
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Header;
 
 
 
12
 
13
  class HeaderTitleRule extends ConfigurationSelectorRule
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/IgnoreRule.php CHANGED
@@ -9,9 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Element;
12
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
13
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
14
- use Facebook\InstantArticles\Transformer\Getters\ElementGetter;
15
 
16
  class IgnoreRule extends ConfigurationSelectorRule
17
  {
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Element;
 
 
 
12
 
13
  class IgnoreRule extends ConfigurationSelectorRule
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ImageRule.php CHANGED
@@ -9,11 +9,7 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Image;
12
- use Facebook\InstantArticles\Elements\Caption;
13
  use Facebook\InstantArticles\Elements\InstantArticle;
14
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
15
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
16
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
17
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
18
 
19
  class ImageRule extends ConfigurationSelectorRule
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Image;
 
12
  use Facebook\InstantArticles\Elements\InstantArticle;
 
 
 
13
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
15
  class ImageRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InstantArticleRule.php CHANGED
@@ -9,11 +9,7 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Image;
12
- use Facebook\InstantArticles\Elements\Caption;
13
  use Facebook\InstantArticles\Elements\InstantArticle;
14
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
15
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
16
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
17
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
18
 
19
  class InstantArticleRule extends ConfigurationSelectorRule
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Image;
 
12
  use Facebook\InstantArticles\Elements\InstantArticle;
 
 
 
13
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
15
  class InstantArticleRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InteractiveRule.php CHANGED
@@ -9,7 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Interactive;
12
- use Facebook\InstantArticles\Elements\Caption;
13
  use Facebook\InstantArticles\Elements\InstantArticle;
14
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
15
 
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Interactive;
 
12
  use Facebook\InstantArticles\Elements\InstantArticle;
13
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ItalicRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\TextContainer;
12
  use Facebook\InstantArticles\Elements\Italic;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class ItalicRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\TextContainer;
12
  use Facebook\InstantArticles\Elements\Italic;
 
 
 
13
 
14
  class ItalicRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/LineBreakRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\TextContainer;
12
  use Facebook\InstantArticles\Elements\LineBreak;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ElementGetter;
16
 
17
  class LineBreakRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\TextContainer;
12
  use Facebook\InstantArticles\Elements\LineBreak;
 
 
 
13
 
14
  class LineBreakRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ListElementRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\ListElement;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class ListElementRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\ListElement;
 
 
 
13
 
14
  class ListElementRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ListItemRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\ListElement;
12
  use Facebook\InstantArticles\Elements\ListItem;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class ListItemRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\ListElement;
12
  use Facebook\InstantArticles\Elements\ListItem;
 
 
 
13
 
14
  class ListItemRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/MapRule.php CHANGED
@@ -9,7 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Map;
12
- use Facebook\InstantArticles\Elements\Caption;
13
  use Facebook\InstantArticles\Elements\InstantArticle;
14
 
15
  class MapRule extends ConfigurationSelectorRule
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Map;
 
12
  use Facebook\InstantArticles\Elements\InstantArticle;
13
 
14
  class MapRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ParagraphFooterRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Paragraph;
12
  use Facebook\InstantArticles\Elements\Footer;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class ParagraphFooterRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\Paragraph;
12
  use Facebook\InstantArticles\Elements\Footer;
 
 
 
13
 
14
  class ParagraphFooterRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ParagraphRule.php CHANGED
@@ -10,11 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Paragraph;
13
- use Facebook\InstantArticles\Elements\ListItem;
14
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
15
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
16
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
17
- use Facebook\InstantArticles\Validators\Type;
18
 
19
  class ParagraphRule extends ConfigurationSelectorRule
20
  {
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Paragraph;
 
 
 
 
 
13
 
14
  class ParagraphRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/PassThroughRule.php CHANGED
@@ -9,9 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Element;
12
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
13
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
14
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
15
 
16
  class PassThroughRule extends ConfigurationSelectorRule
17
  {
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Element;
 
 
 
12
 
13
  class PassThroughRule extends ConfigurationSelectorRule
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/PullquoteCiteRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Cite;
12
  use Facebook\InstantArticles\Elements\Pullquote;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class PullquoteCiteRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\Cite;
12
  use Facebook\InstantArticles\Elements\Pullquote;
 
 
 
13
 
14
  class PullquoteCiteRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/PullquoteRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Pullquote;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class PullquoteRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Pullquote;
 
 
 
13
 
14
  class PullquoteRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/RelatedArticlesRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\RelatedArticles;
12
  use Facebook\InstantArticles\Elements\InstantArticle;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class RelatedArticlesRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\RelatedArticles;
12
  use Facebook\InstantArticles\Elements\InstantArticle;
 
 
 
13
 
14
  class RelatedArticlesRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/RelatedItemRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\RelatedItem;
12
  use Facebook\InstantArticles\Elements\RelatedArticles;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
17
 
18
  class RelatedItemRule extends ConfigurationSelectorRule
10
 
11
  use Facebook\InstantArticles\Elements\RelatedItem;
12
  use Facebook\InstantArticles\Elements\RelatedArticles;
 
 
 
13
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
15
  class RelatedItemRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/SlideshowImageRule.php CHANGED
@@ -11,9 +11,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
11
  use Facebook\InstantArticles\Elements\Image;
12
  use Facebook\InstantArticles\Elements\Caption;
13
  use Facebook\InstantArticles\Elements\Slideshow;
14
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
15
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
16
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
17
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
18
 
19
  class SlideshowImageRule extends ConfigurationSelectorRule
11
  use Facebook\InstantArticles\Elements\Image;
12
  use Facebook\InstantArticles\Elements\Caption;
13
  use Facebook\InstantArticles\Elements\Slideshow;
 
 
 
14
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
15
 
16
  class SlideshowImageRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/SlideshowRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Slideshow;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
 
17
  class SlideshowRule extends ConfigurationSelectorRule
18
  {
10
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
12
  use Facebook\InstantArticles\Elements\Slideshow;
 
 
 
13
 
14
  class SlideshowRule extends ConfigurationSelectorRule
15
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/SocialEmbedRule.php CHANGED
@@ -9,7 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\SocialEmbed;
12
- use Facebook\InstantArticles\Elements\Caption;
13
  use Facebook\InstantArticles\Elements\InstantArticle;
14
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
15
 
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\SocialEmbed;
 
12
  use Facebook\InstantArticles\Elements\InstantArticle;
13
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/TextNodeRule.php CHANGED
@@ -9,9 +9,6 @@
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\TextContainer;
12
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
13
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
14
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
15
 
16
  class TextNodeRule extends Rule
17
  {
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\TextContainer;
 
 
 
12
 
13
  class TextNodeRule extends Rule
14
  {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/TimeRule.php CHANGED
@@ -10,9 +10,6 @@ namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Time;
12
  use Facebook\InstantArticles\Elements\Header;
13
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
14
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
15
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
16
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
17
 
18
  class TimeRule extends ConfigurationSelectorRule
10
 
11
  use Facebook\InstantArticles\Elements\Time;
12
  use Facebook\InstantArticles\Elements\Header;
 
 
 
13
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
15
  class TimeRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/VideoRule.php CHANGED
@@ -11,11 +11,7 @@ namespace Facebook\InstantArticles\Transformer\Rules;
11
  use Symfony\Component\CssSelector\CssSelectorConverter;
12
 
13
  use Facebook\InstantArticles\Elements\Video;
14
- use Facebook\InstantArticles\Elements\Caption;
15
  use Facebook\InstantArticles\Elements\InstantArticle;
16
- use Facebook\InstantArticles\Transformer\Getters\GetterFactory;
17
- use Facebook\InstantArticles\Transformer\Getters\StringGetter;
18
- use Facebook\InstantArticles\Transformer\Getters\ChildrenGetter;
19
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
20
 
21
  class VideoRule extends ConfigurationSelectorRule
11
  use Symfony\Component\CssSelector\CssSelectorConverter;
12
 
13
  use Facebook\InstantArticles\Elements\Video;
 
14
  use Facebook\InstantArticles\Elements\InstantArticle;
 
 
 
15
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
16
 
17
  class VideoRule extends ConfigurationSelectorRule
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Transformer.php CHANGED
@@ -17,9 +17,37 @@ class Transformer
17
  {
18
  private $rules = array();
19
  private $warnings = array();
 
20
 
21
  public $suppress_warnings = false;
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  public function getWarnings()
24
  {
25
  return $this->warnings;
@@ -28,8 +56,21 @@ class Transformer
28
  public function addRule($rule)
29
  {
30
  Type::enforce($rule, Rule::getClassName());
31
- // Adds in reversed order for bottom-top processing rules
32
- array_unshift($this->rules, $rule);
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
 
35
  public function addWarning($warning)
@@ -40,8 +81,8 @@ class Transformer
40
  public function transform($context, $node)
41
  {
42
  if (Type::is($context, InstantArticle::getClassName())) {
43
- $context->addMetaProperty('op:transformer', 'facebook-instant-articles-sdk-php');
44
- $context->addMetaProperty('op:transformer:version', InstantArticle::CURRENT_VERSION);
45
  }
46
 
47
  $log = \Logger::getLogger('facebook-instantarticles-transformer');
@@ -59,13 +100,36 @@ class Transformer
59
  foreach ($node->childNodes as $child) {
60
  $matched = false;
61
  $log->debug("===========================");
62
- foreach ($this->rules as $rule) {
63
- if ($rule->matches($context, $child)) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  $current_context = $rule->apply($this, $current_context, $child);
65
  $matched = true;
 
 
66
  break;
67
  }
68
  }
 
69
  if (!$matched &&
70
  !($child->nodeName === '#text' && trim($child->textContent) === '') &&
71
  !($child->nodeName === '#comment') &&
@@ -114,6 +178,7 @@ class Transformer
114
  public function resetRules()
115
  {
116
  $this->rules = array();
 
117
  }
118
 
119
  /**
@@ -123,7 +188,17 @@ class Transformer
123
  */
124
  public function getRules()
125
  {
126
- return $this->rules;
 
 
 
 
 
 
 
 
 
 
127
  }
128
 
129
  /**
@@ -133,7 +208,12 @@ class Transformer
133
  */
134
  public function setRules($rules)
135
  {
 
 
136
  Type::enforceArrayOf($rules, Rule::getClassName());
137
- $this->rules = $rules;
 
 
 
138
  }
139
  }
17
  {
18
  private $rules = array();
19
  private $warnings = array();
20
+ private $ruleCount = 0;
21
 
22
  public $suppress_warnings = false;
23
 
24
+ private static $allClassTypes = array();
25
+
26
+ /**
27
+ * Gets all types a given class is, including itself, parent classes and interfaces.
28
+ *
29
+ * @param string $className - the name of the className
30
+ * @return array of class names the provided class name is
31
+ */
32
+ private static function getAllClassTypes($className) {
33
+ // Memoizes
34
+ if (isset(self::$allClassTypes[$className])) {
35
+ return self::$allClassTypes[$className];
36
+ }
37
+
38
+ $classParents = class_parents($className, true);
39
+ $classInterfaces = class_implements($className, true);
40
+ $classNames = array($className);
41
+ if ($classParents) {
42
+ $classNames = array_merge($classNames, $classParents);
43
+ }
44
+ if ($classInterfaces) {
45
+ $classNames = array_merge($classNames, $classInterfaces);
46
+ }
47
+ self::$allClassTypes[$className] = $classNames;
48
+ return $classNames;
49
+ }
50
+
51
  public function getWarnings()
52
  {
53
  return $this->warnings;
56
  public function addRule($rule)
57
  {
58
  Type::enforce($rule, Rule::getClassName());
59
+
60
+ // Use context class as a key
61
+ $contexts = $rule->getContextClass();
62
+
63
+ // Handles multiple contextes
64
+ if (!is_array($contexts)) {
65
+ $contexts = array($contexts);
66
+ }
67
+
68
+ foreach ($contexts as $context) {
69
+ if (!isset($this->rules[$context])) {
70
+ $this->rules[$context] = array();
71
+ }
72
+ $this->rules[$context][$this->ruleCount++] = $rule;
73
+ }
74
  }
75
 
76
  public function addWarning($warning)
81
  public function transform($context, $node)
82
  {
83
  if (Type::is($context, InstantArticle::getClassName())) {
84
+ $context->addMetaProperty('op:generator:transformer', 'facebook-instant-articles-sdk-php');
85
+ $context->addMetaProperty('op:generator:transformer:version', InstantArticle::CURRENT_VERSION);
86
  }
87
 
88
  $log = \Logger::getLogger('facebook-instantarticles-transformer');
100
  foreach ($node->childNodes as $child) {
101
  $matched = false;
102
  $log->debug("===========================");
103
+
104
+ // Get all classes and interfaces this context extends/implements
105
+ $contextClassNames = self::getAllClassTypes($context->getClassName());
106
+
107
+ // Look for rules applying to any of them as context
108
+ $matchingContextRules = array();
109
+ foreach ($contextClassNames as $contextClassName) {
110
+ if (isset($this->rules[$contextClassName])) {
111
+ // Use array union (+) instead of merge to preserve
112
+ // indexes (as they represent the order of insertion)
113
+ $matchingContextRules = $matchingContextRules + $this->rules[$contextClassName];
114
+ }
115
+ }
116
+
117
+ // Sort by insertion order
118
+ ksort($matchingContextRules);
119
+
120
+ // Process in reverse order
121
+ $matchingContextRules = array_reverse($matchingContextRules);
122
+ foreach ($matchingContextRules as $rule) {
123
+ // We know context was matched, now check if it matches the node
124
+ if ($rule->matchesNode($child)) {
125
  $current_context = $rule->apply($this, $current_context, $child);
126
  $matched = true;
127
+
128
+ // Just a single rule for each node, so move on
129
  break;
130
  }
131
  }
132
+
133
  if (!$matched &&
134
  !($child->nodeName === '#text' && trim($child->textContent) === '') &&
135
  !($child->nodeName === '#comment') &&
178
  public function resetRules()
179
  {
180
  $this->rules = array();
181
+ $this->ruleCount = 0;
182
  }
183
 
184
  /**
188
  */
189
  public function getRules()
190
  {
191
+ // Do not expose internal map, just a simple array
192
+ // to keep the interace backwards compatible.
193
+ $flatten_rules = array();
194
+ foreach ($this->rules as $ruleset) {
195
+ foreach ($ruleset as $priority => $rule) {
196
+ $flatten_rules[$priority] = $rule;
197
+ }
198
+ }
199
+
200
+ ksort($flatten_rules);
201
+ return $flatten_rules;
202
  }
203
 
204
  /**
208
  */
209
  public function setRules($rules)
210
  {
211
+ // Do not receive internal map, just a plain list
212
+ // to keep the interace backwards compatible.
213
  Type::enforceArrayOf($rules, Rule::getClassName());
214
+ $this->resetRules();
215
+ foreach ($rules as $rule) {
216
+ $this->addRule($rule);
217
+ }
218
  }
219
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Validators/Type.php CHANGED
@@ -325,7 +325,7 @@ class Type
325
  {
326
  $within = in_array($value, $universe, true);
327
  if (!$within && $enforce) {
328
- self::throwNotWithingException($value, $universe);
329
  }
330
 
331
  return $within;
@@ -345,7 +345,7 @@ class Type
345
  return self::isWithin($value, $universe, true);
346
  }
347
 
348
- private static function throwNotWithingException($value, $universe)
349
  {
350
  // stringify the $value parameter
351
  ob_start();
325
  {
326
  $within = in_array($value, $universe, true);
327
  if (!$within && $enforce) {
328
+ self::throwNotWithinException($value, $universe);
329
  }
330
 
331
  return $within;
345
  return self::isWithin($value, $universe, true);
346
  }
347
 
348
+ private static function throwNotWithinException($value, $universe)
349
  {
350
  // stringify the $value parameter
351
  ob_start();
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Client/ClientTest.php CHANGED
@@ -18,7 +18,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
18
  private $article;
19
  private $facebook;
20
 
21
- public function setUp()
22
  {
23
  $this->facebook = $this->getMockBuilder('Facebook\Facebook')
24
  ->disableOriginalConstructor()
18
  private $article;
19
  private $facebook;
20
 
21
+ protected function setUp()
22
  {
23
  $this->facebook = $this->getMockBuilder('Facebook\Facebook')
24
  ->disableOriginalConstructor()
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Client/HelperTest.php CHANGED
@@ -9,15 +9,13 @@
9
  namespace Facebook\InstantArticles\Client;
10
 
11
  use Facebook\Facebook;
12
- use Facebook\InstantArticles\Elements\InstantArticle;
13
- use Facebook\InstantArticles\Elements\Paragraph;
14
 
15
  class HelperTest extends \PHPUnit_Framework_TestCase
16
  {
17
  private $helper;
18
  private $facebook;
19
 
20
- public function setUp()
21
  {
22
  $this->facebook = $this->getMockBuilder('Facebook\Facebook')
23
  ->disableOriginalConstructor()
9
  namespace Facebook\InstantArticles\Client;
10
 
11
  use Facebook\Facebook;
 
 
12
 
13
  class HelperTest extends \PHPUnit_Framework_TestCase
14
  {
15
  private $helper;
16
  private $facebook;
17
 
18
+ protected function setUp()
19
  {
20
  $this->facebook = $this->getMockBuilder('Facebook\Facebook')
21
  ->disableOriginalConstructor()
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/AdTest.php CHANGED
@@ -8,11 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Ad;
12
 
13
  class AdTest extends \PHPUnit_Framework_TestCase
14
  {
15
- public function setUp()
16
  {
17
  }
18
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  class AdTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/AnalyticsTest.php CHANGED
@@ -8,11 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Analytics;
12
 
13
  class AnalyticsTest extends \PHPUnit_Framework_TestCase
14
  {
15
- public function setUp()
16
  {
17
  }
18
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  class AnalyticsTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/AudioTest.php CHANGED
@@ -8,11 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Audio;
12
 
13
  class AudioTest extends \PHPUnit_Framework_TestCase
14
  {
15
- public function setUp()
16
  {
17
  }
18
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  class AudioTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/AuthorTest.php CHANGED
@@ -8,11 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Author;
12
 
13
  class AuthorTest extends \PHPUnit_Framework_TestCase
14
  {
15
- public function setUp()
16
  {
17
  }
18
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  class AuthorTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/BlockquoteTest.php CHANGED
@@ -8,11 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Blockquote;
12
 
13
  class BlockquoteTest extends \PHPUnit_Framework_TestCase
14
  {
15
- public function setUp()
16
  {
17
  }
18
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  class BlockquoteTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/CaptionTest.php CHANGED
@@ -8,11 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Caption;
12
 
13
  class CaptionTest extends \PHPUnit_Framework_TestCase
14
  {
15
- public function setUp()
16
  {
17
  }
18
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  class CaptionTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/CiteTest.php CHANGED
@@ -8,14 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Cite;
12
- use Facebook\InstantArticles\Elements\Bold;
13
- use Facebook\InstantArticles\Elements\Italic;
14
- use Facebook\InstantArticles\Elements\Anchor;
15
 
16
  class CiteTest extends \PHPUnit_Framework_TestCase
17
  {
18
- public function setUp()
19
  {
20
  }
21
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
 
 
11
 
12
  class CiteTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/FooterTest.php CHANGED
@@ -8,13 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Footer;
12
- use Facebook\InstantArticles\Elements\Paragraph;
13
- use Facebook\InstantArticles\Elements\RelatedArticles;
14
 
15
  class FooterTest extends \PHPUnit_Framework_TestCase
16
  {
17
- public function setUp()
18
  {
19
  }
20
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
 
11
 
12
  class FooterTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/GeoTagTest.php CHANGED
@@ -8,12 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\GeoTag;
12
- use Facebook\InstantArticles\Elements\Caption;
13
 
14
  class GeoTagTest extends \PHPUnit_Framework_TestCase
15
  {
16
- public function setUp()
17
  {
18
  }
19
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
11
 
12
  class GeoTagTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/H1Test.php CHANGED
@@ -8,14 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\H1;
12
- use Facebook\InstantArticles\Elements\Bold;
13
- use Facebook\InstantArticles\Elements\Italic;
14
- use Facebook\InstantArticles\Elements\Anchor;
15
 
16
  class H1Test extends \PHPUnit_Framework_TestCase
17
  {
18
- public function setUp()
19
  {
20
  }
21
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
 
 
11
 
12
  class H1Test extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/H2Test.php CHANGED
@@ -8,14 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\H2;
12
- use Facebook\InstantArticles\Elements\Bold;
13
- use Facebook\InstantArticles\Elements\Italic;
14
- use Facebook\InstantArticles\Elements\Anchor;
15
 
16
  class H2Test extends \PHPUnit_Framework_TestCase
17
  {
18
- public function setUp()
19
  {
20
  }
21
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
 
 
11
 
12
  class H2Test extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/HeaderTest.php CHANGED
@@ -8,13 +8,6 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\InstantArticle;
12
- use Facebook\InstantArticles\Elements\Header;
13
- use Facebook\InstantArticles\Elements\Time;
14
- use Facebook\InstantArticles\Elements\Author;
15
- use Facebook\InstantArticles\Elements\Image;
16
- use Facebook\InstantArticles\Elements\Caption;
17
-
18
  class HeaderTest extends \PHPUnit_Framework_TestCase
19
  {
20
  public function testCompleteHeader()
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
 
 
 
 
 
11
  class HeaderTest extends \PHPUnit_Framework_TestCase
12
  {
13
  public function testCompleteHeader()
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/ImageTest.php CHANGED
@@ -8,13 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Image;
12
- use Facebook\InstantArticles\Elements\Audio;
13
- use Facebook\InstantArticles\Elements\Caption;
14
 
15
  class ImageTest extends \PHPUnit_Framework_TestCase
16
  {
17
- public function setUp()
18
  {
19
  }
20
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
 
11
 
12
  class ImageTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/InstantArticleTest.php CHANGED
@@ -8,26 +8,13 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Element;
12
- use Facebook\InstantArticles\Elements\InstantArticle;
13
- use Facebook\InstantArticles\Elements\Header;
14
- use Facebook\InstantArticles\Elements\Time;
15
- use Facebook\InstantArticles\Elements\Author;
16
- use Facebook\InstantArticles\Elements\Image;
17
- use Facebook\InstantArticles\Elements\Caption;
18
- use Facebook\InstantArticles\Elements\Paragraph;
19
- use Facebook\InstantArticles\Elements\SlideShow;
20
- use Facebook\InstantArticles\Elements\Analytics;
21
- use Facebook\InstantArticles\Elements\Ad;
22
- use Facebook\InstantArticles\Elements\Footer;
23
-
24
  class InstantArticleTest extends \PHPUnit_Framework_TestCase
25
  {
26
  /**
27
  * @var InstantArticle
28
  */
29
  private $article;
30
- public function setUp()
31
  {
32
  date_default_timezone_set('UTC');
33
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  class InstantArticleTest extends \PHPUnit_Framework_TestCase
12
  {
13
  /**
14
  * @var InstantArticle
15
  */
16
  private $article;
17
+ protected function setUp()
18
  {
19
  date_default_timezone_set('UTC');
20
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/InteractiveTest.php CHANGED
@@ -13,7 +13,7 @@ use Facebook\InstantArticles\Elements\Interactive;
13
 
14
  class InteractiveTest extends \PHPUnit_Framework_TestCase
15
  {
16
- public function setUp()
17
  {
18
  }
19
 
13
 
14
  class InteractiveTest extends \PHPUnit_Framework_TestCase
15
  {
16
+ protected function setUp()
17
  {
18
  }
19
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/ListElementTest.php CHANGED
@@ -8,11 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\ListElement;
12
 
13
  class ListElementTest extends \PHPUnit_Framework_TestCase
14
  {
15
- public function setUp()
16
  {
17
  }
18
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  class ListElementTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/MapTest.php CHANGED
@@ -8,13 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Map;
12
- use Facebook\InstantArticles\Elements\GeoTag;
13
- use Facebook\InstantArticles\Elements\Caption;
14
 
15
  class MapTest extends \PHPUnit_Framework_TestCase
16
  {
17
- public function setUp()
18
  {
19
  }
20
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
 
11
 
12
  class MapTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/ParagraphTest.php CHANGED
@@ -8,15 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Paragraph;
12
- use Facebook\InstantArticles\Elements\Bold;
13
- use Facebook\InstantArticles\Elements\LineBreak;
14
- use Facebook\InstantArticles\Elements\Italic;
15
- use Facebook\InstantArticles\Elements\Anchor;
16
 
17
  class ParagraphTest extends \PHPUnit_Framework_TestCase
18
  {
19
- public function setUp()
20
  {
21
  }
22
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
 
 
 
11
 
12
  class ParagraphTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/PullquoteTest.php CHANGED
@@ -8,11 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Pullquote;
12
 
13
  class PullquoteTest extends \PHPUnit_Framework_TestCase
14
  {
15
- public function setUp()
16
  {
17
  }
18
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  class PullquoteTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/RelatedArticlesTest.php CHANGED
@@ -8,12 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\RelatedArticles;
12
- use Facebook\InstantArticles\Elements\RelatedItem;
13
 
14
  class RelatedArticlesTest extends \PHPUnit_Framework_TestCase
15
  {
16
- public function setUp()
17
  {
18
  }
19
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
11
 
12
  class RelatedArticlesTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/SlideshowTest.php CHANGED
@@ -8,14 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Slideshow;
12
- use Facebook\InstantArticles\Elements\Audio;
13
- use Facebook\InstantArticles\Elements\Image;
14
- use Facebook\InstantArticles\Elements\Caption;
15
 
16
  class SlideshowTest extends \PHPUnit_Framework_TestCase
17
  {
18
- public function setUp()
19
  {
20
  }
21
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
 
 
11
 
12
  class SlideshowTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/SocialEmbedTest.php CHANGED
@@ -8,12 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\SocialEmbed;
12
- use Facebook\InstantArticles\Elements\Caption;
13
 
14
  class SocialEmbedTest extends \PHPUnit_Framework_TestCase
15
  {
16
- public function setUp()
17
  {
18
  }
19
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
11
 
12
  class SocialEmbedTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/TimeTest.php CHANGED
@@ -8,13 +8,12 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Time;
12
 
13
  class TimeTest extends \PHPUnit_Framework_TestCase
14
  {
15
  private $timeDate;
16
 
17
- public function setUp()
18
  {
19
  date_default_timezone_set('UTC');
20
  $this->timeDate = \DateTime::createFromFormat(
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
11
 
12
  class TimeTest extends \PHPUnit_Framework_TestCase
13
  {
14
  private $timeDate;
15
 
16
+ protected function setUp()
17
  {
18
  date_default_timezone_set('UTC');
19
  $this->timeDate = \DateTime::createFromFormat(
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/Validators/TypeTest.php CHANGED
@@ -13,8 +13,6 @@ use Facebook\InstantArticles\Elements\Image;
13
  use Facebook\InstantArticles\Elements\Video;
14
  use Facebook\InstantArticles\Elements\InstantArticle;
15
  use Facebook\InstantArticles\Elements\AnimatedGIF;
16
- use Facebook\InstantArticles\Elements\Element;
17
- use Facebook\InstantArticles\Validators\Type;
18
 
19
  /**
20
  *
13
  use Facebook\InstantArticles\Elements\Video;
14
  use Facebook\InstantArticles\Elements\InstantArticle;
15
  use Facebook\InstantArticles\Elements\AnimatedGIF;
 
 
16
 
17
  /**
18
  *
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/VideoTest.php CHANGED
@@ -8,12 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
11
- use Facebook\InstantArticles\Elements\Video;
12
- use Facebook\InstantArticles\Elements\Caption;
13
 
14
  class VideoTest extends \PHPUnit_Framework_TestCase
15
  {
16
- public function setUp()
17
  {
18
  }
19
 
8
  */
9
  namespace Facebook\InstantArticles\Elements;
10
 
 
 
11
 
12
  class VideoTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Example/SimpleTransformerTest.php CHANGED
@@ -8,29 +8,9 @@
8
  */
9
  namespace Facebook\InstantArticles\Transformer;
10
 
11
- use Facebook\InstantArticles\Elements\Element;
12
  use Facebook\InstantArticles\Elements\InstantArticle;
13
- use Facebook\InstantArticles\Elements\Header;
14
- use Facebook\InstantArticles\Elements\Time;
15
- use Facebook\InstantArticles\Elements\Author;
16
- use Facebook\InstantArticles\Elements\Image;
17
- use Facebook\InstantArticles\Elements\Caption;
18
- use Facebook\InstantArticles\Elements\Paragraph;
19
- use Facebook\InstantArticles\Elements\SlideShow;
20
- use Facebook\InstantArticles\Elements\Analytics;
21
- use Facebook\InstantArticles\Elements\Ad;
22
- use Facebook\InstantArticles\Elements\Footer;
23
- use Facebook\InstantArticles\Elements\Bold;
24
 
25
- use Facebook\InstantArticles\Transformer\Rules\ParagraphRule;
26
- use Facebook\InstantArticles\Transformer\Rules\TextNodeRule;
27
- use Facebook\InstantArticles\Transformer\Rules\ItalicRule;
28
- use Facebook\InstantArticles\Transformer\Rules\PassThroughRule;
29
- use Facebook\InstantArticles\Transformer\Rules\BoldRule;
30
- use Facebook\InstantArticles\Transformer\Rules\ImageRule;
31
- use Facebook\InstantArticles\Transformer\Rules\AuthorRule;
32
 
33
- use Symfony\Component\CssSelector\CssSelectorConverter;
34
 
35
  class SimpleTransformerTest extends \PHPUnit_Framework_TestCase
36
  {
@@ -39,7 +19,7 @@ class SimpleTransformerTest extends \PHPUnit_Framework_TestCase
39
  */
40
  private $article;
41
  private $input;
42
- public function setUp()
43
  {
44
  \Logger::configure(
45
  array(
@@ -76,7 +56,7 @@ class SimpleTransformerTest extends \PHPUnit_Framework_TestCase
76
 
77
  $transformer->transform($instant_article, $document);
78
  $instant_article->addMetaProperty('op:generator:version', '1.0.0');
79
- $instant_article->addMetaProperty('op:transformer:version', '1.0.0');
80
  $warnings = $transformer->getWarnings();
81
  $result = $instant_article->render('', true)."\n";
82
  $expected = file_get_contents("simple-ia.xml", true);
8
  */
9
  namespace Facebook\InstantArticles\Transformer;
10
 
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
 
 
 
 
 
 
 
 
 
 
 
12
 
 
 
 
 
 
 
 
13
 
 
14
 
15
  class SimpleTransformerTest extends \PHPUnit_Framework_TestCase
16
  {
19
  */
20
  private $article;
21
  private $input;
22
+ protected function setUp()
23
  {
24
  \Logger::configure(
25
  array(
56
 
57
  $transformer->transform($instant_article, $document);
58
  $instant_article->addMetaProperty('op:generator:version', '1.0.0');
59
+ $instant_article->addMetaProperty('op:generator:transformer:version', '1.0.0');
60
  $warnings = $transformer->getWarnings();
61
  $result = $instant_article->render('', true)."\n";
62
  $expected = file_get_contents("simple-ia.xml", true);
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Example/simple-ia.xml CHANGED
@@ -4,8 +4,8 @@
4
  <meta charset="utf-8"/>
5
  <meta property="op:generator" content="facebook-instant-articles-sdk-php"/>
6
  <meta property="op:generator:version" content="1.0.0"/>
7
- <meta property="op:transformer" content="facebook-instant-articles-sdk-php"/>
8
- <meta property="op:transformer:version" content="1.0.0"/>
9
  <meta property="op:markup_version" content="v1.0"/>
10
  </head>
11
  <body>
4
  <meta charset="utf-8"/>
5
  <meta property="op:generator" content="facebook-instant-articles-sdk-php"/>
6
  <meta property="op:generator:version" content="1.0.0"/>
7
+ <meta property="op:generator:transformer" content="facebook-instant-articles-sdk-php"/>
8
+ <meta property="op:generator:transformer:version" content="1.0.0"/>
9
  <meta property="op:markup_version" content="v1.0"/>
10
  </head>
11
  <body>
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Rules/AuthorRuleTest.php CHANGED
@@ -8,11 +8,10 @@
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
- use Facebook\InstantArticles\Transformer\Rules\AuthorRule;
12
 
13
  class AuthorRuleTest extends \PHPUnit_Framework_TestCase
14
  {
15
- public function setUp()
16
  {
17
  }
18
 
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
 
11
 
12
  class AuthorRuleTest extends \PHPUnit_Framework_TestCase
13
  {
14
+ protected function setUp()
15
  {
16
  }
17
 
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Rules/PullquoteRuleTest.php CHANGED
@@ -8,14 +8,12 @@
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
- use Facebook\InstantArticles\Transformer\Rules\PullquoteRule;
12
- use Facebook\InstantArticles\Transformer\Rules\PullquoteCiteRule;
13
  use Facebook\InstantArticles\Transformer\Transformer;
14
  use Facebook\InstantArticles\Elements\InstantArticle;
15
 
16
  class PullquoteRuleTest extends \PHPUnit_Framework_TestCase
17
  {
18
- public function setUp()
19
  {
20
  \Logger::configure(
21
  array(
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
 
 
11
  use Facebook\InstantArticles\Transformer\Transformer;
12
  use Facebook\InstantArticles\Elements\InstantArticle;
13
 
14
  class PullquoteRuleTest extends \PHPUnit_Framework_TestCase
15
  {
16
+ protected function setUp()
17
  {
18
  \Logger::configure(
19
  array(
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/TransformerTest.php CHANGED
@@ -8,33 +8,15 @@
8
  */
9
  namespace Facebook\InstantArticles\Transformer;
10
 
11
- use Facebook\InstantArticles\Elements\Element;
12
  use Facebook\InstantArticles\Elements\InstantArticle;
13
- use Facebook\InstantArticles\Elements\Header;
14
- use Facebook\InstantArticles\Elements\Time;
15
- use Facebook\InstantArticles\Elements\Author;
16
- use Facebook\InstantArticles\Elements\Image;
17
- use Facebook\InstantArticles\Elements\Caption;
18
- use Facebook\InstantArticles\Elements\Paragraph;
19
- use Facebook\InstantArticles\Elements\SlideShow;
20
- use Facebook\InstantArticles\Elements\Analytics;
21
- use Facebook\InstantArticles\Elements\Ad;
22
- use Facebook\InstantArticles\Elements\Footer;
23
- use Facebook\InstantArticles\Elements\Bold;
24
 
25
  use Facebook\InstantArticles\Transformer\Rules\ParagraphRule;
26
- use Facebook\InstantArticles\Transformer\Rules\TextNodeRule;
27
  use Facebook\InstantArticles\Transformer\Rules\ItalicRule;
28
- use Facebook\InstantArticles\Transformer\Rules\PassThroughRule;
29
- use Facebook\InstantArticles\Transformer\Rules\BoldRule;
30
- use Facebook\InstantArticles\Transformer\Rules\ImageRule;
31
- use Facebook\InstantArticles\Transformer\Rules\AuthorRule;
32
 
33
- use Symfony\Component\CssSelector\CssSelectorConverter;
34
 
35
  class TransformerTest extends \PHPUnit_Framework_TestCase
36
  {
37
- public function setUp()
38
  {
39
  \Logger::configure(
40
  array(
@@ -71,7 +53,7 @@ class TransformerTest extends \PHPUnit_Framework_TestCase
71
 
72
  $transformer->transform($instant_article, $document);
73
  $instant_article->addMetaProperty('op:generator:version', '1.0.0');
74
- $instant_article->addMetaProperty('op:transformer:version', '1.0.0');
75
  $warnings = $transformer->getWarnings();
76
  $result = $instant_article->render('', true)."\n";
77
 
@@ -87,7 +69,7 @@ class TransformerTest extends \PHPUnit_Framework_TestCase
87
  $rule2 = new ItalicRule();
88
  $transformer->addRule($rule1);
89
  $transformer->addRule($rule2);
90
- $this->assertEquals(array($rule2, $rule1), $transformer->getRules());
91
  }
92
 
93
  public function testTransformerSetRules()
8
  */
9
  namespace Facebook\InstantArticles\Transformer;
10
 
 
11
  use Facebook\InstantArticles\Elements\InstantArticle;
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  use Facebook\InstantArticles\Transformer\Rules\ParagraphRule;
 
14
  use Facebook\InstantArticles\Transformer\Rules\ItalicRule;
 
 
 
 
15
 
 
16
 
17
  class TransformerTest extends \PHPUnit_Framework_TestCase
18
  {
19
+ protected function setUp()
20
  {
21
  \Logger::configure(
22
  array(
53
 
54
  $transformer->transform($instant_article, $document);
55
  $instant_article->addMetaProperty('op:generator:version', '1.0.0');
56
+ $instant_article->addMetaProperty('op:generator:transformer:version', '1.0.0');
57
  $warnings = $transformer->getWarnings();
58
  $result = $instant_article->render('', true)."\n";
59
 
69
  $rule2 = new ItalicRule();
70
  $transformer->addRule($rule1);
71
  $transformer->addRule($rule2);
72
+ $this->assertEquals(array($rule1, $rule2), $transformer->getRules());
73
  }
74
 
75
  public function testTransformerSetRules()
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Warnings/InvalidSelectorTest.php CHANGED
@@ -15,7 +15,7 @@ class InvalidSelectorTest extends \PHPUnit_Framework_TestCase
15
  {
16
  private $properties;
17
 
18
- public function setUp()
19
  {
20
 
21
  }
15
  {
16
  private $properties;
17
 
18
+ protected function setUp()
19
  {
20
 
21
  }
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/instant-article-example.html CHANGED
@@ -4,8 +4,8 @@
4
  <meta charset="utf-8"/>
5
  <meta property="op:generator" content="facebook-instant-articles-sdk-php"/>
6
  <meta property="op:generator:version" content="1.0.0"/>
7
- <meta property="op:transformer" content="facebook-instant-articles-sdk-php"/>
8
- <meta property="op:transformer:version" content="1.0.0"/>
9
  <meta property="op:markup_version" content="v1.0"/>
10
  </head>
11
  <body>
4
  <meta charset="utf-8"/>
5
  <meta property="op:generator" content="facebook-instant-articles-sdk-php"/>
6
  <meta property="op:generator:version" content="1.0.0"/>
7
+ <meta property="op:generator:transformer" content="facebook-instant-articles-sdk-php"/>
8
+ <meta property="op:generator:transformer:version" content="1.0.0"/>
9
  <meta property="op:markup_version" content="v1.0"/>
10
  </head>
11
  <body>
vendor/facebook/facebook-instant-articles-sdk-php/tests/bootstrap.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- $autoloader = require __DIR__ . '/../vendor/autoload.php';
3
- $autoloader->add('Facebook\\', __DIR__.'/../src');