Instant Articles for WP - Version 3.3.4

Version Description

Download this release

Release Info

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

Code changes from version 3.2.3 to 3.3.4

Files changed (167) hide show
  1. class-instant-articles-post.php +46 -11
  2. class-instant-articles-publisher.php +4 -3
  3. compat.php +9 -6
  4. compat/apester-rules-configuration.json +21 -0
  5. compat/class-instant-articles-apester.php +27 -0
  6. compat/class-instant-articles-jetpack.php +7 -1
  7. embeds.php +11 -1
  8. facebook-instant-articles.php +48 -15
  9. languages/de_DE.mo +0 -0
  10. languages/de_DE.po +39 -0
  11. meta-box/class-instant-articles-meta-box.php +1 -1
  12. readme.txt +1 -1
  13. release.sh +472 -0
  14. rules-configuration.json +6 -130
  15. vendor/composer/installed.json +72 -72
  16. vendor/facebook/facebook-instant-articles-sdk-php/.github/ISSUE_TEMPLATE.md +13 -0
  17. vendor/facebook/facebook-instant-articles-sdk-php/.github/PULL_REQUEST_TEMPLATE.md +9 -0
  18. vendor/facebook/facebook-instant-articles-sdk-php/.gitignore +5 -0
  19. vendor/facebook/facebook-instant-articles-sdk-php/composer.json +47 -0
  20. vendor/facebook/facebook-instant-articles-sdk-php/composer.lock +1246 -0
  21. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Client/Client.php +21 -2
  22. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Client/Helper.php +3 -2
  23. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Caption.php +18 -2
  24. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Element.php +1 -1
  25. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Footer.php +8 -4
  26. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Image.php +36 -0
  27. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/InstantArticle.php +124 -1
  28. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Small.php +53 -0
  29. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/TextContainer.php +21 -0
  30. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Video.php +37 -0
  31. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Parser/instant-articles-rules.json +18 -10
  32. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/ConstantGetter.php +42 -0
  33. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/ElementGetter.php +3 -3
  34. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/GetterFactory.php +3 -0
  35. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/StringGetter.php +53 -2
  36. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/CaptionRule.php +4 -0
  37. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/FooterRelatedArticlesRule.php +1 -14
  38. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/FooterSmallRule.php +38 -0
  39. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/H1Rule.php +1 -0
  40. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ImageInsideParagraphRule.php +4 -80
  41. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ImageRule.php +30 -5
  42. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InstantArticleRule.php +8 -1
  43. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InteractiveInsideParagraphRule.php +4 -101
  44. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InteractiveRule.php +30 -5
  45. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/RelatedArticlesRule.php +1 -2
  46. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/TimeRule.php +18 -6
  47. vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Validators/Type.php +29 -0
  48. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Client/ClientTest.php +48 -0
  49. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Client/HelperTest.php +1 -1
  50. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/CaptionTest.php +17 -1
  51. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/FooterTest.php +25 -0
  52. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/H1Test.php +18 -0
  53. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/InstantArticleTest.php +292 -0
  54. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/Validators/TypeTest.php +25 -0
  55. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Parser/instant-article-example.html +5 -1
  56. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/CustomHTMLTransformerTest.php +78 -0
  57. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Example/simple-ia.html +25 -0
  58. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Example/simple-rules.json +86 -1
  59. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Example/simple.html +25 -0
  60. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/custom-html-ia.xml +202 -0
  61. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/custom-html-rules.json +606 -0
  62. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/custom.html +221 -0
  63. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/instant-article-example-multibyte.html +1 -1
  64. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/instant-article-example-nonutf8.html +1 -1
  65. vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/instant-article-example.html +1 -1
  66. vendor/facebook/graph-sdk/LICENSE +1 -1
  67. vendor/facebook/graph-sdk/src/Facebook/Authentication/AccessToken.php +1 -1
  68. vendor/facebook/graph-sdk/src/Facebook/Authentication/AccessTokenMetadata.php +1 -1
  69. vendor/facebook/graph-sdk/src/Facebook/Authentication/OAuth2Client.php +1 -1
  70. vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookAuthenticationException.php +1 -1
  71. vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookAuthorizationException.php +1 -1
  72. vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookClientException.php +1 -1
  73. vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookOtherException.php +1 -1
  74. vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php +1 -1
  75. vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookResumableUploadException.php +1 -1
  76. vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookSDKException.php +1 -1
  77. vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookServerException.php +1 -1
  78. vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookThrottleException.php +1 -1
  79. vendor/facebook/graph-sdk/src/Facebook/Facebook.php +24 -3
  80. vendor/facebook/graph-sdk/src/Facebook/FacebookApp.php +1 -1
  81. vendor/facebook/graph-sdk/src/Facebook/FacebookBatchRequest.php +44 -23
  82. vendor/facebook/graph-sdk/src/Facebook/FacebookBatchResponse.php +1 -1
  83. vendor/facebook/graph-sdk/src/Facebook/FacebookClient.php +1 -1
  84. vendor/facebook/graph-sdk/src/Facebook/FacebookRequest.php +2 -2
  85. vendor/facebook/graph-sdk/src/Facebook/FacebookResponse.php +1 -1
  86. vendor/facebook/graph-sdk/src/Facebook/FileUpload/FacebookFile.php +1 -1
  87. vendor/facebook/graph-sdk/src/Facebook/FileUpload/FacebookResumableUploader.php +1 -1
  88. vendor/facebook/graph-sdk/src/Facebook/FileUpload/FacebookTransferChunk.php +1 -1
  89. vendor/facebook/graph-sdk/src/Facebook/FileUpload/FacebookVideo.php +1 -1
  90. vendor/facebook/graph-sdk/src/Facebook/FileUpload/Mimetypes.php +2 -1
  91. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/Birthday.php +1 -1
  92. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/Collection.php +1 -1
  93. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphAchievement.php +1 -1
  94. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphAlbum.php +1 -1
  95. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphApplication.php +1 -1
  96. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphCoverPhoto.php +1 -1
  97. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphEdge.php +15 -1
  98. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphEvent.php +1 -1
  99. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphGroup.php +1 -1
  100. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphList.php +1 -1
  101. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphLocation.php +1 -1
  102. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphNode.php +1 -1
  103. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphNodeFactory.php +1 -1
  104. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphObject.php +1 -1
  105. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphObjectFactory.php +1 -1
  106. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphPage.php +1 -1
  107. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphPicture.php +1 -1
  108. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphSessionInfo.php +1 -1
  109. vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphUser.php +1 -1
  110. vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookCanvasHelper.php +1 -1
  111. vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookJavaScriptHelper.php +1 -1
  112. vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookPageTabHelper.php +1 -1
  113. vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php +1 -1
  114. vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php +1 -1
  115. vendor/facebook/graph-sdk/src/Facebook/Http/GraphRawResponse.php +1 -1
  116. vendor/facebook/graph-sdk/src/Facebook/Http/RequestBodyInterface.php +1 -1
  117. vendor/facebook/graph-sdk/src/Facebook/Http/RequestBodyMultipart.php +1 -1
  118. vendor/facebook/graph-sdk/src/Facebook/Http/RequestBodyUrlEncoded.php +1 -1
  119. vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookCurl.php +1 -1
  120. vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php +1 -1
  121. vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookGuzzleHttpClient.php +1 -1
  122. vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookHttpClientInterface.php +1 -1
  123. vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookStream.php +1 -1
  124. vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookStreamHttpClient.php +1 -1
  125. vendor/facebook/graph-sdk/src/Facebook/HttpClients/HttpClientsFactory.php +1 -1
  126. vendor/facebook/graph-sdk/src/Facebook/PersistentData/FacebookMemoryPersistentDataHandler.php +1 -1
  127. vendor/facebook/graph-sdk/src/Facebook/PersistentData/FacebookSessionPersistentDataHandler.php +1 -1
  128. vendor/facebook/graph-sdk/src/Facebook/PersistentData/PersistentDataFactory.php +1 -1
  129. vendor/facebook/graph-sdk/src/Facebook/PersistentData/PersistentDataInterface.php +1 -1
  130. vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/McryptPseudoRandomStringGenerator.php +1 -1
  131. vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php +1 -1
  132. vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/PseudoRandomStringGeneratorFactory.php +1 -1
  133. vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/PseudoRandomStringGeneratorInterface.php +1 -1
  134. vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/PseudoRandomStringGeneratorTrait.php +1 -1
  135. vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/RandomBytesPseudoRandomStringGenerator.php +1 -1
  136. vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/UrandomPseudoRandomStringGenerator.php +1 -1
  137. vendor/facebook/graph-sdk/src/Facebook/SignedRequest.php +1 -1
  138. vendor/facebook/graph-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php +1 -1
  139. vendor/facebook/graph-sdk/src/Facebook/Url/FacebookUrlManipulator.php +1 -1
  140. vendor/facebook/graph-sdk/src/Facebook/Url/UrlDetectionInterface.php +1 -1
  141. vendor/facebook/graph-sdk/src/Facebook/autoload.php +1 -1
  142. vendor/facebook/graph-sdk/src/Facebook/polyfills.php +1 -1
  143. vendor/symfony/css-selector/Exception/SyntaxErrorException.php +5 -5
  144. vendor/symfony/css-selector/LICENSE +1 -1
  145. vendor/symfony/css-selector/Node/Specificity.php +1 -1
  146. vendor/symfony/css-selector/Parser/Reader.php +1 -1
  147. vendor/symfony/css-selector/Parser/TokenStream.php +2 -2
  148. vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php +2 -1
  149. vendor/symfony/css-selector/Tests/Node/AbstractNodeTest.php +2 -1
  150. vendor/symfony/css-selector/Tests/Node/SpecificityTest.php +2 -1
  151. vendor/symfony/css-selector/Tests/Parser/Handler/AbstractHandlerTest.php +2 -1
  152. vendor/symfony/css-selector/Tests/Parser/ParserTest.php +3 -2
  153. vendor/symfony/css-selector/Tests/Parser/ReaderTest.php +2 -1
  154. vendor/symfony/css-selector/Tests/Parser/Shortcut/ClassParserTest.php +2 -1
  155. vendor/symfony/css-selector/Tests/Parser/Shortcut/ElementParserTest.php +2 -1
  156. vendor/symfony/css-selector/Tests/Parser/Shortcut/EmptyStringParserTest.php +2 -1
  157. vendor/symfony/css-selector/Tests/Parser/Shortcut/HashParserTest.php +2 -1
  158. vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php +4 -3
  159. vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php +2 -1
  160. vendor/symfony/css-selector/XPath/Extension/NodeExtension.php +2 -2
  161. vendor/symfony/css-selector/XPath/Translator.php +2 -2
  162. vendor/symfony/css-selector/XPath/XPathExpr.php +4 -4
  163. vendor/symfony/css-selector/composer.json +2 -2
  164. vendor/symfony/css-selector/phpunit.xml.dist +2 -0
  165. wizard/class-instant-articles-option-publishing.php +16 -0
  166. wizard/class-instant-articles-option-styles.php +16 -2
  167. wpcom-helper.php +18 -18
class-instant-articles-post.php CHANGED
@@ -345,8 +345,9 @@ class Instant_Articles_Post {
345
  *
346
  * @since 0.1
347
  * @param string $content The post content.
 
348
  */
349
- $content = apply_filters( 'instant_articles_content', $content );
350
 
351
  // Cache the content.
352
  set_transient( 'instantarticles_mod_' . $this->_post->ID, get_post_modified_time( 'Y-m-d H:i:s', true, $this->_post->ID ), WEEK_IN_SECONDS );
@@ -595,11 +596,14 @@ class Instant_Articles_Post {
595
  */
596
  do_action( 'instant_articles_before_transform_post', $this );
597
 
 
 
598
  // Get time zone configured in WordPress. Default to UTC if no time zone configured.
599
  $date_time_zone = get_option( 'timezone_string' ) ? new DateTimeZone( get_option( 'timezone_string' ) ) : new DateTimeZone( 'UTC' );
600
 
601
  // Initialize transformer
602
  $file_path = plugin_dir_path( __FILE__ ) . 'rules-configuration.json';
 
603
  $configuration = file_get_contents( $file_path );
604
 
605
  $transformer = new Transformer();
@@ -634,11 +638,7 @@ class Instant_Articles_Post {
634
 
635
  $title = $this->get_the_title();
636
  if ( $title ) {
637
- $document = new DOMDocument();
638
- libxml_use_internal_errors(true);
639
- $document->loadHTML( '<?xml encoding="' . $blog_charset . '" ?><h1>' . $title . '</h1>' );
640
- libxml_use_internal_errors(false);
641
- $transformer->transform( $header, $document );
642
  }
643
 
644
  if ( $this->has_subtitle() ) {
@@ -676,11 +676,19 @@ class Instant_Articles_Post {
676
  ->addMetaProperty( 'op:generator:application', 'facebook-instant-articles-wp' )
677
  ->addMetaProperty( 'op:generator:application:version', IA_PLUGIN_VERSION );
678
 
679
- $settings_style = Instant_Articles_Option_Styles::get_option_decoded();
680
- if ( isset( $settings_style['article_style'] ) && ! empty( $settings_style['article_style'] ) ) {
681
- $this->instant_article->withStyle( $settings_style['article_style'] );
682
- } else {
683
- $this->instant_article->withStyle( 'default' );
 
 
 
 
 
 
 
 
684
  }
685
 
686
  $transformer->transformString( $this->instant_article, $this->get_the_content(), get_option( 'blog_charset' ) );
@@ -690,6 +698,8 @@ class Instant_Articles_Post {
690
 
691
  $this->instant_article = apply_filters( 'instant_articles_transformed_element', $this->instant_article );
692
 
 
 
693
  /**
694
  * Fires after the instant article is rendered.
695
  *
@@ -855,6 +865,31 @@ class Instant_Articles_Post {
855
  }
856
  }
857
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
858
  /**
859
  * Article <head> style.
860
  *
345
  *
346
  * @since 0.1
347
  * @param string $content The post content.
348
+ * @param int $post_id The instant article post.
349
  */
350
+ $content = apply_filters( 'instant_articles_content', $content, $this->_post->ID );
351
 
352
  // Cache the content.
353
  set_transient( 'instantarticles_mod_' . $this->_post->ID, get_post_modified_time( 'Y-m-d H:i:s', true, $this->_post->ID ), WEEK_IN_SECONDS );
596
  */
597
  do_action( 'instant_articles_before_transform_post', $this );
598
 
599
+ is_transforming_instant_article( true );
600
+
601
  // Get time zone configured in WordPress. Default to UTC if no time zone configured.
602
  $date_time_zone = get_option( 'timezone_string' ) ? new DateTimeZone( get_option( 'timezone_string' ) ) : new DateTimeZone( 'UTC' );
603
 
604
  // Initialize transformer
605
  $file_path = plugin_dir_path( __FILE__ ) . 'rules-configuration.json';
606
+ $file_path = apply_filters( 'instant_articles_transformer_rules_configuration_json_file_path', $file_path );
607
  $configuration = file_get_contents( $file_path );
608
 
609
  $transformer = new Transformer();
638
 
639
  $title = $this->get_the_title();
640
  if ( $title ) {
641
+ $transformer->transformString( $header, '<h1>' . $title . '</h1>', $blog_charset );
 
 
 
 
642
  }
643
 
644
  if ( $this->has_subtitle() ) {
676
  ->addMetaProperty( 'op:generator:application', 'facebook-instant-articles-wp' )
677
  ->addMetaProperty( 'op:generator:application:version', IA_PLUGIN_VERSION );
678
 
679
+ $this->set_appearance_from_settings();
680
+
681
+ // This block sets as default likes and/or comments based on the configuration setup,
682
+ // and call $transformer->transform will consider the defaults before building the Elements
683
+ //
684
+ // Warning: if you are using pthreads or any other multithreaded engine, consider replicating this to all processes.
685
+ if ( isset( $settings_publishing[ 'likes_on_media' ] ) ) {
686
+ Image::setDefaultLikeEnabled( $settings_publishing[ 'likes_on_media' ] );
687
+ Video::setDefaultLikeEnabled( $settings_publishing[ 'likes_on_media' ] );
688
+ }
689
+ if ( isset( $settings_publishing[ 'comments_on_media' ] ) ) {
690
+ Image::setDefaultCommentEnabled( $settings_publishing[ 'comments_on_media' ] );
691
+ Video::setDefaultCommentEnabled( $settings_publishing[ 'comments_on_media' ] );
692
  }
693
 
694
  $transformer->transformString( $this->instant_article, $this->get_the_content(), get_option( 'blog_charset' ) );
698
 
699
  $this->instant_article = apply_filters( 'instant_articles_transformed_element', $this->instant_article );
700
 
701
+ is_transforming_instant_article( false );
702
+
703
  /**
704
  * Fires after the instant article is rendered.
705
  *
865
  }
866
  }
867
 
868
+ /**
869
+ * Apply appearance settings for an InstantArticle.
870
+ *
871
+ * @since 3.3
872
+ */
873
+ public function set_appearance_from_settings() {
874
+ $settings = Instant_Articles_Option_Styles::get_option_decoded();
875
+
876
+ if ( isset( $settings['article_style'] ) && ! empty( $settings['article_style'] ) ) {
877
+ $this->instant_article->withStyle( $settings['article_style'] );
878
+ } else {
879
+ $this->instant_article->withStyle( 'default' );
880
+ }
881
+
882
+ if ( isset( $settings['copyright'] ) && ! empty( $settings['copyright'] ) ) {
883
+ $this->instant_article->withFooter(
884
+ Footer::create()->withCopyright( $settings['copyright'] )
885
+ );
886
+ }
887
+
888
+ if ( isset( $settings['rtl_enabled'] ) ) {
889
+ $this->instant_article->enableRTL();
890
+ }
891
+ }
892
+
893
  /**
894
  * Article <head> style.
895
  *
class-instant-articles-publisher.php CHANGED
@@ -25,9 +25,10 @@ class Instant_Articles_Publisher {
25
 
26
  /**
27
  * Inits publisher.
 
28
  */
29
  public static function init() {
30
- add_action( 'save_post', array( 'Instant_Articles_Publisher', 'submit_article' ), 10, 2 );
31
  }
32
 
33
  /**
@@ -39,7 +40,7 @@ class Instant_Articles_Publisher {
39
  public static function submit_article( $post_id, $post ) {
40
 
41
  // Don't process if this is just a revision or an autosave.
42
- if ( wp_is_post_revision( $post ) || wp_is_post_autosave( $post ) ) {
43
  return;
44
  }
45
 
@@ -121,7 +122,7 @@ class Instant_Articles_Publisher {
121
  $published = false;
122
  } else {
123
  // Any publish status other than 'publish' means draft for the Instant Article.
124
- $published = true;
125
  }
126
 
127
  try {
25
 
26
  /**
27
  * Inits publisher.
28
+ * Change by cmjaimet submitted Jan 3, 2016: Delay save_post action hook (3rd param 10 => 999) so that all custom meta data is processed and saved before submission to FBIA
29
  */
30
  public static function init() {
31
+ add_action( 'save_post', array( 'Instant_Articles_Publisher', 'submit_article' ), 999, 2 );
32
  }
33
 
34
  /**
40
  public static function submit_article( $post_id, $post ) {
41
 
42
  // Don't process if this is just a revision or an autosave.
43
+ if ( wp_is_post_revision( $post ) || wp_is_post_autosave( $post->ID ) ) {
44
  return;
45
  }
46
 
122
  $published = false;
123
  } else {
124
  // Any publish status other than 'publish' means draft for the Instant Article.
125
+ $published = apply_filters( 'instant_articles_post_published', true, $post_id );
126
  }
127
 
128
  try {
compat.php CHANGED
@@ -42,9 +42,12 @@ if ( function_exists( 'get_the_image' ) ) {
42
  $gti->init();
43
  }
44
 
45
- // Load support for Playbuzz plugin
46
- if ( function_exists( 'playbuzz_settings_link' ) ) {
47
- include( dirname( __FILE__ ) . '/compat/class-instant-articles-playbuzz.php' );
48
- $playbuzz = new Instant_Articles_Playbuzz;
49
- $playbuzz->init();
50
- }
 
 
 
42
  $gti->init();
43
  }
44
 
45
+ // Load support for Playbuzz plugin by default #515
46
+ include( dirname( __FILE__ ) . '/compat/class-instant-articles-playbuzz.php' );
47
+ $playbuzz = new Instant_Articles_Playbuzz;
48
+ $playbuzz->init();
49
+
50
+ // Load support for Apester's plugin Medias
51
+ include( dirname( __FILE__ ) . '/compat/class-instant-articles-apester.php' );
52
+ $apester = new Instant_Articles_Apester;
53
+ $apester->init();
compat/apester-rules-configuration.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "rules": [{
3
+ "class": "IgnoreRule",
4
+ "selector": "//script[contains(@src,'apester')]"
5
+ }, {
6
+ "class": "InteractiveRule",
7
+ "selector": "div.apester-media",
8
+ "properties": {
9
+ "interactive.iframe": {
10
+ "type": "multiple",
11
+ "children": [{
12
+ "type": "fragment",
13
+ "fragment": "<script type='text/javascript' src='//static.apester.com/js/sdk/latest/apester-sdk.min.js'></script>"
14
+ }, {
15
+ "type": "element",
16
+ "selector": "div.apester-media"
17
+ }]
18
+ }
19
+ }
20
+ }]
21
+ }
compat/class-instant-articles-apester.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Support class for Apester
5
+ *
6
+ * @since 3.3.2
7
+ *
8
+ */
9
+ class Instant_Articles_Apester {
10
+
11
+ /**
12
+ * Init the compat layer
13
+ *
14
+ */
15
+ function init() {
16
+ add_filter( 'instant_articles_transformer_rules_loaded', array( 'Instant_Articles_Apester', 'transformer_loaded' ) );
17
+ }
18
+
19
+ public static function transformer_loaded( $transformer ) {
20
+ // Appends more rules to transformer
21
+ $file_path = plugin_dir_path( __FILE__ ) . 'apester-rules-configuration.json';
22
+ $configuration = file_get_contents( $file_path );
23
+ $transformer->loadRules( $configuration );
24
+
25
+ return $transformer;
26
+ }
27
+ }
compat/class-instant-articles-jetpack.php CHANGED
@@ -39,6 +39,12 @@ class Instant_Articles_Jetpack {
39
  */
40
  private function _fix_facebook_embed() {
41
 
 
 
 
 
 
 
42
  // All of these are registered in jetpack/modules/shortcodes/facebook.php
43
 
44
  if ( defined( 'JETPACK_FACEBOOK_EMBED_REGEX' ) ) {
@@ -79,7 +85,7 @@ class Instant_Articles_Jetpack {
79
  $locale = 'en_US';
80
  }
81
 
82
- return '<figure class="op-social"><iframe><script src="https://connect.facebook.net/' . $locale . '/sdk.js#xfbml=1&amp;version=v2.6" async></script><div class="fb-post" data-href="' . esc_url( $url ) . '"></div></iframe></figure>';
83
  }
84
 
85
  public static function transformer_loaded( $transformer ) {
39
  */
40
  private function _fix_facebook_embed() {
41
 
42
+ // Don't try to fix facebook embeds unless we're in Instant Articles context.
43
+ // This prevents mangled output on frontend.
44
+ if ( ! is_transforming_instant_article() ) {
45
+ return;
46
+ }
47
+
48
  // All of these are registered in jetpack/modules/shortcodes/facebook.php
49
 
50
  if ( defined( 'JETPACK_FACEBOOK_EMBED_REGEX' ) ) {
85
  $locale = 'en_US';
86
  }
87
 
88
+ return '<figure class="op-interactive"><iframe><script src="https://connect.facebook.net/' . $locale . '/sdk.js#xfbml=1&amp;version=v2.6" async></script><div class="fb-post" data-href="' . esc_url( $url ) . '"></div></iframe></figure>';
89
  }
90
 
91
  public static function transformer_loaded( $transformer ) {
embeds.php CHANGED
@@ -39,8 +39,12 @@ function instant_articles_embed_oembed_html( $html, $url, $attr, $post_id ) {
39
  $provider_name = 'twitter';
40
  } elseif ( false !== strpos( $provider_url, 'youtube.com' ) ) {
41
  $provider_name = 'youtube';
42
- } elseif ( false !== strpos( $provider_url, 'vine.co' ) ) {
 
 
43
  $provider_name = 'vine';
 
 
44
  }
45
 
46
  $provider_name = apply_filters( 'instant_articles_social_embed_type', $provider_name, $url );
@@ -68,6 +72,12 @@ add_filter( 'embed_oembed_html', 'instant_articles_embed_oembed_html', 10, 4 );
68
  */
69
  function instant_articles_embed_get_html( $provider_name, $html, $url, $attr, $post_id ) {
70
 
 
 
 
 
 
 
71
  /**
72
  * Filter the HTML that will go into the Instant Article Social Embed markup.
73
  *
39
  $provider_name = 'twitter';
40
  } elseif ( false !== strpos( $provider_url, 'youtube.com' ) ) {
41
  $provider_name = 'youtube';
42
+ } elseif( false !== strpos( $provider_url, 'vimeo.com' ) ) {
43
+ $provider_name = 'vimeo';
44
+ } elseif( false !== strpos( $provider_url, 'vine.co' ) ) {
45
  $provider_name = 'vine';
46
+ } elseif( false !== strpos( $provider_url, 'facebook.com' ) ) {
47
+ $provider_name = 'facebook';
48
  }
49
 
50
  $provider_name = apply_filters( 'instant_articles_social_embed_type', $provider_name, $url );
72
  */
73
  function instant_articles_embed_get_html( $provider_name, $html, $url, $attr, $post_id ) {
74
 
75
+ // Don't try to fix embeds unless we're in Instant Articles context.
76
+ // This prevents mangled output on frontend.
77
+ if ( ! is_transforming_instant_article() ) {
78
+ return $html;
79
+ }
80
+
81
  /**
82
  * Filter the HTML that will go into the Instant Article Social Embed markup.
83
  *
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: 3.2.2
8
  * Text Domain: instant-articles
9
  * License: GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -12,13 +12,19 @@
12
  * @package default
13
  */
14
 
 
 
 
 
 
 
 
 
 
15
  if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
16
  add_action(
17
  'admin_notices',
18
- function () {
19
- echo '<div class="error"><p>' .
20
- esc_html__( 'Instant Articles for WP requires PHP 5.4 to function properly. Please upgrade PHP or deactivate Instant Articles for WP.', 'instant-articles' ) . '</p></div>';
21
- }
22
  );
23
  return;
24
  } else {
@@ -61,7 +67,7 @@ if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
61
 
62
  defined( 'ABSPATH' ) || die( 'Shame on you' );
63
 
64
- define( 'IA_PLUGIN_VERSION', '3.2.2' );
65
  define( 'IA_PLUGIN_PATH_FULL', __FILE__ );
66
  define( 'IA_PLUGIN_PATH', plugin_basename( __FILE__ ) );
67
  define( 'IA_PLUGIN_FILE_BASENAME', pathinfo( __FILE__, PATHINFO_FILENAME ) );
@@ -157,6 +163,21 @@ if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
157
 
158
  }
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
 
161
  /**
162
  * Modify the main query for our feed.
@@ -238,54 +259,66 @@ if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
238
  function instant_articles_register_scripts() {
239
  wp_register_style(
240
  'instant-articles-meta-box',
241
- plugins_url( '/css/instant-articles-meta-box.css', __FILE__ )
 
 
 
242
  );
243
  wp_register_style(
244
  'instant-articles-settings',
245
- plugins_url( '/css/instant-articles-settings.css', __FILE__ )
 
 
 
246
  );
247
  wp_register_style(
248
  'instant-articles-wizard',
249
- plugins_url( '/css/instant-articles-wizard.css', __FILE__ )
 
 
 
250
  );
251
 
252
  wp_register_script(
253
  'instant-articles-meta-box',
254
- plugins_url( '/js/instant-articles-meta-box.js', __FILE__ )
 
 
 
255
  );
256
  wp_register_script(
257
  'instant-articles-option-ads',
258
  plugins_url( '/js/instant-articles-option-ads.js', __FILE__ ),
259
  null,
260
- null,
261
  true
262
  );
263
  wp_register_script(
264
  'instant-articles-option-analytics',
265
  plugins_url( '/js/instant-articles-option-analytics.js', __FILE__ ),
266
  null,
267
- null,
268
  true
269
  );
270
  wp_register_script(
271
  'instant-articles-option-publishing',
272
  plugins_url( '/js/instant-articles-option-publishing.js', __FILE__ ),
273
  null,
274
- null,
275
  true
276
  );
277
  wp_register_script(
278
  'instant-articles-settings',
279
  plugins_url( '/js/instant-articles-settings.js', __FILE__ ),
280
  null,
281
- null,
282
  true
283
  );
284
  wp_register_script(
285
  'instant-articles-wizard',
286
  plugins_url( '/js/instant-articles-wizard.js', __FILE__ ),
287
  null,
288
- null,
289
  true
290
  );
291
  }
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: 3.3.4
8
  * Text Domain: instant-articles
9
  * License: GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  * @package default
13
  */
14
 
15
+ /**
16
+ * Prints error about incompatible version. Extracted as function issue: #390
17
+ *
18
+ * @since 3.3.4
19
+ */
20
+ function show_version_incompatible_warning() {
21
+ echo '<div class="error"><p>' .
22
+ esc_html__( 'Instant Articles for WP requires PHP 5.4 to function properly. Please upgrade PHP or deactivate Instant Articles for WP.', 'instant-articles' ) . '</p></div>';
23
+ }
24
  if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
25
  add_action(
26
  'admin_notices',
27
+ 'show_version_incompatible_warning'
 
 
 
28
  );
29
  return;
30
  } else {
67
 
68
  defined( 'ABSPATH' ) || die( 'Shame on you' );
69
 
70
+ define( 'IA_PLUGIN_VERSION', '3.3.4' );
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 ) );
163
 
164
  }
165
 
166
+ /**
167
+ * Whether currently processing an instant article.
168
+ *
169
+ * @param bool Set the status
170
+ * @return bool
171
+ */
172
+ function is_transforming_instant_article( $set_status = null ) {
173
+ static $is_instant_article = false;
174
+
175
+ if ( isset( $set_status ) ) {
176
+ $is_instant_article = (bool) $set_status;
177
+ }
178
+
179
+ return $is_instant_article;
180
+ }
181
 
182
  /**
183
  * Modify the main query for our feed.
259
  function instant_articles_register_scripts() {
260
  wp_register_style(
261
  'instant-articles-meta-box',
262
+ plugins_url( '/css/instant-articles-meta-box.css', __FILE__ ),
263
+ null,
264
+ IA_PLUGIN_VERSION,
265
+ true
266
  );
267
  wp_register_style(
268
  'instant-articles-settings',
269
+ plugins_url( '/css/instant-articles-settings.css', __FILE__ ),
270
+ null,
271
+ IA_PLUGIN_VERSION,
272
+ true
273
  );
274
  wp_register_style(
275
  'instant-articles-wizard',
276
+ plugins_url( '/css/instant-articles-wizard.css', __FILE__ ),
277
+ null,
278
+ IA_PLUGIN_VERSION,
279
+ true
280
  );
281
 
282
  wp_register_script(
283
  'instant-articles-meta-box',
284
+ plugins_url( '/js/instant-articles-meta-box.js', __FILE__ ),
285
+ null,
286
+ IA_PLUGIN_VERSION,
287
+ true
288
  );
289
  wp_register_script(
290
  'instant-articles-option-ads',
291
  plugins_url( '/js/instant-articles-option-ads.js', __FILE__ ),
292
  null,
293
+ IA_PLUGIN_VERSION,
294
  true
295
  );
296
  wp_register_script(
297
  'instant-articles-option-analytics',
298
  plugins_url( '/js/instant-articles-option-analytics.js', __FILE__ ),
299
  null,
300
+ IA_PLUGIN_VERSION,
301
  true
302
  );
303
  wp_register_script(
304
  'instant-articles-option-publishing',
305
  plugins_url( '/js/instant-articles-option-publishing.js', __FILE__ ),
306
  null,
307
+ IA_PLUGIN_VERSION,
308
  true
309
  );
310
  wp_register_script(
311
  'instant-articles-settings',
312
  plugins_url( '/js/instant-articles-settings.js', __FILE__ ),
313
  null,
314
+ IA_PLUGIN_VERSION,
315
  true
316
  );
317
  wp_register_script(
318
  'instant-articles-wizard',
319
  plugins_url( '/js/instant-articles-wizard.js', __FILE__ ),
320
  null,
321
+ IA_PLUGIN_VERSION,
322
  true
323
  );
324
  }
languages/de_DE.mo ADDED
Binary file
languages/de_DE.po ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
4
+ "Project-Id-Version: Instant Articles for WP\n"
5
+ "POT-Creation-Date: 2016-05-22 10:10+0200\n"
6
+ "PO-Revision-Date: 2016-05-22 10:12+0200\n"
7
+ "Language-Team: Bjørn Johansen <bjorn@dekode.no>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.8.7\n"
12
+ "X-Poedit-Basepath: ..\n"
13
+ "X-Poedit-WPHeader: instant-articles.php\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
16
+ "Last-Translator: \n"
17
+ "Language: de\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
20
+
21
+ #: feed-template.php:7
22
+ msgid "Instant Articles"
23
+ msgstr "Instant Articles"
24
+
25
+ #. Plugin Name of the plugin/theme
26
+ msgid "Instant Articles for WP"
27
+ msgstr "Instant Articles für WP"
28
+
29
+ #. Description of the plugin/theme
30
+ msgid "Add support for Instant Articles for Facebook to your WordPress site."
31
+ msgstr "Ermöglicht die Funtion von Instant Articles für deine WordPress Seite"
32
+
33
+ #. Author of the plugin/theme
34
+ msgid "Dekode"
35
+ msgstr "Dekode"
36
+
37
+ #. Author URI of the plugin/theme
38
+ msgid "https://dekode.no"
39
+ msgstr "https://dekode.no"
meta-box/class-instant-articles-meta-box.php CHANGED
@@ -85,7 +85,7 @@ class Instant_Articles_Meta_Box {
85
  public static function render_meta_box() {
86
  $post_id = intval( $_POST[ 'post_ID' ] );
87
 
88
- if ( !current_user_can( 'edit_post', $post_id ) ) {
89
  wp_die( -1, 403 );
90
  }
91
 
85
  public static function render_meta_box() {
86
  $post_id = intval( $_POST[ 'post_ID' ] );
87
 
88
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
89
  wp_die( -1, 403 );
90
  }
91
 
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.6
6
- Stable tag: 3.2.2
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.6
6
+ Stable tag: 3.3.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
release.sh ADDED
@@ -0,0 +1,472 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ red=`tput setaf 1`
3
+ green=`tput setaf 2`
4
+ yellow=`tput setaf 3`
5
+ blue=`tput setaf 4`
6
+ reset=`tput sgr0`
7
+ me='./'`basename "$0"`
8
+
9
+ #--------------------------------
10
+ # Functions
11
+ #--------------------------------
12
+ function show_help {
13
+ cat <<EOF
14
+
15
+ ${green}Usage:${reset}
16
+ ${blue}${me} [-hvs] [-c <command>] [version]${reset}
17
+
18
+ ${green}Arguments:${reset}
19
+ version - The target version (ex: 3.2.1)
20
+
21
+ ${green}Options:${reset}
22
+ -h Display this help message
23
+ -v Verbose mode
24
+ -s Simulate only (do not release)
25
+ -c <command> Runs only a single command. Possible commands are:
26
+ - bump_version: generate a new version tag on the repository
27
+ - release: release a new version on GitHub
28
+ - publish: publishes the target version to the WordPress
29
+ plugin repository
30
+
31
+
32
+ ${green}Examples:${reset}
33
+
34
+ ${blue}${me} 3.3.0${reset}
35
+ Runs bump_version then release for 3.3.0. This is the default use case.
36
+
37
+ ${blue}${me} -c bump_version 3.3.0${reset}
38
+ Generates a new commit on master changing the version to 3.3.0 in
39
+ all relevant files, tags the commit and pushes to remote.
40
+
41
+ ${blue}${me} -c release 3.3.0${reset}
42
+ Creates a new Release on GitHub based on the tag 3.3.0 and uploads
43
+ the binary package based on master.
44
+ ${red}IMPORTANT: this will create a new tag if tag 3.3.0 doesn't exist,
45
+ so make sure to bump_version beforehand.${reset}
46
+
47
+ ${blue}${me} -v 3.3.0${reset}
48
+ Releases 3.3.0 in verbose mode.
49
+
50
+ ${blue}${me} -s 3.3.0${reset}
51
+ Simulates a 3.3.0 release: prints the commands instead of running them.
52
+
53
+ EOF
54
+ }
55
+
56
+ function invalid_usage {
57
+ printf $red
58
+ echo $@
59
+ echo "Aborted"
60
+ printf $reset
61
+ show_help
62
+ exit -1;
63
+ }
64
+ function error_message {
65
+ printf $red
66
+ echo $@
67
+ echo "Aborted"
68
+ printf $reset
69
+ exit -1
70
+ }
71
+ function message {
72
+ if [[ $verbose == 1 ]]; then
73
+ printf $green
74
+ echo $@
75
+ printf $reset
76
+ fi
77
+ }
78
+ function run_message {
79
+ if [[ $simulate == 1 ]]; then
80
+ printf $yellow
81
+ echo $@
82
+ printf $reset
83
+ fi
84
+ }
85
+
86
+ #----------------
87
+ # Read parameters
88
+ #----------------
89
+
90
+ # A POSIX variable
91
+ # Reset in case getopts has been used previously in the shell.
92
+ OPTIND=1
93
+
94
+ # Read options:
95
+ verbose=0
96
+ simulate=0
97
+ selected_cmd='all'
98
+
99
+ while getopts "hvc:s" opt; do
100
+ case "$opt" in
101
+ h|\?)
102
+ show_help
103
+ exit 0
104
+ ;;
105
+ v) verbose=1
106
+ ;;
107
+ s) simulate=1
108
+ ;;
109
+ c) selected_cmd="${OPTARG}"
110
+ ;;
111
+ esac
112
+ done
113
+
114
+ shift $((OPTIND-1))
115
+
116
+ # Read argument
117
+ version=$1
118
+
119
+ # Validates arguments
120
+ if [[ $2 ]]; then
121
+ invalid_usage "Invalid parameters"
122
+ fi
123
+
124
+ if [[ ! $( echo $version | grep -Ee '^[0-9]+\.[0-9]+(\.[0-9]+)?$' ) ]]; then
125
+ invalid_usage "Invalid version provided"
126
+ fi
127
+
128
+ message "Releasing version: $version"
129
+ message "Running in verbose mode"
130
+ if [[ $simulate == 1 ]]; then
131
+ message "Running in simulation mode"
132
+ fi
133
+
134
+ #---------------------------------
135
+ # Check if we have the right tools
136
+ #---------------------------------
137
+
138
+ if ! type "git" > /dev/null; then
139
+ error_message "git not found, please install git before continuing: http://git.org"
140
+ else
141
+ message "Found git: $(git --version)"
142
+ fi
143
+
144
+ if ! type "js" > /dev/null; then
145
+ error_message "SpiderMonkey interpreter not found, please install SpiderMonkey before continuing"
146
+ else
147
+ message "Found SpiderMonkey"
148
+ fi
149
+
150
+ #------------------------------------
151
+ # Check if we are in the right folder
152
+ #------------------------------------
153
+ if [[ ! -e '.git/config' ]]; then
154
+ error_message "You should run this command from the root directory of your repository."
155
+ fi
156
+ if [[ ! $( cat .git/config | grep -i 'automattic/facebook-instant-articles-wp') ]]; then
157
+ error_message "You should run this command from the root directory of the facebook-instant-articles-wp repository."
158
+ fi
159
+
160
+ repo_dir=$(pwd)
161
+
162
+ #-------------------
163
+ # Manages simulation
164
+ #-------------------
165
+ function run {
166
+ if [[ $simulate == 1 ]]; then
167
+ run_message $@
168
+ else
169
+ "$@"
170
+ fi
171
+ }
172
+
173
+ function revert_repo {
174
+ run cd $repo_dir
175
+ if [[ $branch_name != 'master' ]]; then
176
+ message "Going back to $branch_name"
177
+ # stashes anything possibly left from the script execution
178
+ run git stash
179
+ run git checkout $branch_name
180
+ fi
181
+ if [[ $stash_ref ]]; then
182
+ message "Applying stashed changes"
183
+ run git stash apply $stash_ref
184
+ fi
185
+ }
186
+
187
+ function confirm {
188
+ confirm=''
189
+ while [[ $confirm != 'a' && $confirm != 'y' ]]; do
190
+ printf $blue
191
+ printf "%b" "$*"
192
+ printf ' (y)es/(a)bort: '
193
+ printf $red
194
+ read -n 1 confirm
195
+ printf "\n"
196
+ done
197
+ if [[ $confirm != 'y' ]]; then
198
+ revert_repo
199
+ error_message 'Execution aborted by the user'
200
+ exit -1
201
+ fi
202
+ printf $reset
203
+ }
204
+
205
+ function ask {
206
+ user_response=''
207
+ while [[ $user_response != 'n' && $user_response != 'y' ]]; do
208
+ printf $blue
209
+ printf "%b" "$*"
210
+ printf ' (y)es/(n)o: '
211
+ printf $red
212
+ read -n 1 user_response
213
+ printf "\n"
214
+ done
215
+ printf $reset
216
+ }
217
+
218
+ function prompt {
219
+ user_response=''
220
+ printf $blue
221
+ printf "%b" "$*"
222
+ printf $red
223
+ read user_response
224
+ printf $reset
225
+ }
226
+
227
+ function prompt_password {
228
+ user_response=''
229
+ printf $blue
230
+ printf "%b" "$*"
231
+ printf $red
232
+ read -s user_response
233
+ printf $reset
234
+ }
235
+
236
+ #----------------------
237
+ # Commands
238
+ #----------------------
239
+ function bump_version {
240
+
241
+ message "Stashing current work..."
242
+
243
+ stash_ref=$(git stash create)
244
+ run_message git stash create
245
+
246
+ if [[ $stash_ref ]]; then
247
+ run git reset --hard
248
+ message "Stashed current work to: $stash_ref"
249
+ else
250
+ message "Nothing to stash"
251
+ fi
252
+
253
+ branch_name="$(git symbolic-ref HEAD 2>/dev/null)"
254
+ branch_name=${branch_name##refs/heads/}
255
+ message "Current branch: $branch_name"
256
+
257
+ if [[ $branch_name != 'master' ]]; then
258
+ message "Switching to master..."
259
+ run git checkout master
260
+ fi
261
+
262
+ message "Pulling latest version from GitHub"
263
+ run git pull --rebase
264
+
265
+ confirm "Replace stable tag on readme.txt with $version?"
266
+ message "Replacing stable tag on readme.txt"
267
+ run sed -i -e "s/Stable tag: .*/Stable tag: $version/" ./readme.txt
268
+ run git diff
269
+ confirm "Add changes to commit?"
270
+ run git add readme.txt
271
+ run rm readme.txt-e
272
+
273
+ confirm "Replace version on facebook-instant-articles-wp.php with $version?"
274
+ message "Replacing version on facebook-instant-articles-wp.php"
275
+ run sed -i -e "s/^ \* Version: .*/ * Version: $version/" facebook-instant-articles.php
276
+ run sed -i -e "s/define( 'IA_PLUGIN_VERSION', '[0-9.]*' );/define( 'IA_PLUGIN_VERSION', '$version' );/" facebook-instant-articles.php
277
+ run git diff
278
+ confirm "Add changes to commit?"
279
+ run git add facebook-instant-articles.php
280
+ run rm facebook-instant-articles.php-e
281
+
282
+ confirm "Commit version bump on master with message 'Bump version to $version'?"
283
+ run git commit -m "Bump version to $version"
284
+
285
+ confirm "Create tag $version?"
286
+ run git tag $version
287
+
288
+ confirm "Push tag and commit to GitHub?"
289
+ run git push
290
+ run git push --tags
291
+
292
+ revert_repo
293
+
294
+ echo "🍺 Tag $version created!"
295
+ }
296
+
297
+ function release {
298
+
299
+ confirm "Create a new release for $version?"
300
+
301
+ message "Stashing current work..."
302
+
303
+ stash_ref=$(git stash create)
304
+ run_message git stash create
305
+
306
+ if [[ $stash_ref ]]; then
307
+ run git reset --hard
308
+ message "Stashed current work to: $stash_ref"
309
+ else
310
+ message "Nothing to stash"
311
+ fi
312
+
313
+ branch_name="$(git symbolic-ref HEAD 2>/dev/null)"
314
+ branch_name=${branch_name##refs/heads/}
315
+ message "Current branch: $branch_name"
316
+
317
+ if [[ $branch_name != 'master' ]]; then
318
+ message "Switching to master..."
319
+ run git checkout master
320
+ fi
321
+
322
+ message "Pulling latest version from GitHub"
323
+ run git pull --rebase
324
+
325
+ if [[ ! -e resty ]]; then
326
+ message "Downloading resty to connect to GitHub API"
327
+ run curl -L http://github.com/micha/resty/raw/2.2/resty > resty
328
+ fi
329
+ if [[ ! -e jsawk ]]; then
330
+ message "Downloading jsawk to parse info from GitHub API"
331
+ run curl -L http://github.com/micha/jsawk/raw/1.4/jsawk > jsawk
332
+ fi
333
+
334
+ prompt "GitHub access-token (required only for 2fac):"
335
+ github_access_token=$user_response
336
+
337
+ if [[ github_access_token ]]; then
338
+ run . resty -W 'https://api.github.com' -H "Authorization: token $github_access_token"
339
+ else
340
+ prompt "GitHub username:"
341
+ github_username=$user_response
342
+
343
+ prompt_password "GitHub password:"
344
+ github_password=$user_response
345
+
346
+ run . resty -W 'https://api.github.com' -u $github_username:$github_password
347
+ fi
348
+
349
+ response=$(run POST /repos/Automattic/facebook-instant-articles-wp/releases "
350
+ {
351
+ \"tag_name\": \"$version\",
352
+ \"target_commitish\": \"master\",
353
+ \"name\": \"$version\",
354
+ \"body\": \"Version $version\",
355
+ \"draft\": false,
356
+ \"prerelease\": false
357
+ }
358
+ ");
359
+
360
+ if [[ $response ]]; then
361
+ message "Release $version created!"
362
+ else
363
+ error_message "Couldn't create release"
364
+ fi
365
+
366
+ upload_url=$( echo $response | . jsawk -n 'out(this.upload_url)' | sed -e "s/{[^}]*}//g" )
367
+ release_id=$( echo $response | . jsawk -n 'out(this.id)' )
368
+
369
+ message "Upload URL: $upload_url"
370
+
371
+ message "Creating binary file"
372
+ run composer install
373
+ run composer update
374
+ run zip -qr facebook-instant-articles-wp.zip .
375
+
376
+ message "Uploading binary for release..."
377
+
378
+ if [[ github_access_token ]]; then
379
+ response=$(run curl -H "Authorization: token $github_access_token" -H "Content-Type: application/zip" --data-binary @facebook-instant-articles-wp.zip $upload_url\?name=facebook-instant-articles-wp-$version.zip )
380
+ else
381
+ response=$(run curl -u $github_username:$github_password -H "Content-Type: application/zip" --data-binary @facebook-instant-articles-wp.zip $upload_url\?name=facebook-instant-articles-wp-$version.zip )
382
+ fi
383
+
384
+ run rm facebook-instant-articles-wp.zip
385
+ revert_repo
386
+
387
+ if [[ $response ]]; then
388
+ echo "🍺 Release $version successfully created"
389
+ else
390
+ error_message "Couldn't upload file"
391
+ fi
392
+
393
+
394
+ }
395
+
396
+ function publish {
397
+ confirm "Publish $version to WordPress plugin repository?"
398
+
399
+ message "Stashing current work..."
400
+
401
+ stash_ref=$(git stash create)
402
+ run_message git stash create
403
+
404
+ if [[ $stash_ref ]]; then
405
+ run git reset --hard
406
+ message "Stashed current work to: $stash_ref"
407
+ else
408
+ message "Nothing to stash"
409
+ fi
410
+
411
+ branch_name="$(git symbolic-ref HEAD 2>/dev/null)"
412
+ branch_name=${branch_name##refs/heads/}
413
+ message "Current branch: $branch_name"
414
+
415
+ if [[ $branch_name != 'master' ]]; then
416
+ message "Switching to master..."
417
+ run git checkout master
418
+ fi
419
+
420
+ message "Pulling latest version from GitHub"
421
+ run git pull --rebase
422
+
423
+ tmp_dir=$(mktemp -d)
424
+
425
+ message "Updating composer dependencies"
426
+ run composer install
427
+ run composer update
428
+
429
+ message "Checking out SVN repository..."
430
+ run cd $tmp_dir
431
+ run svn checkout -q https://plugins.svn.wordpress.org/fb-instant-articles/
432
+ run cd fb-instant-articles/trunk/
433
+
434
+ confirm "Copy new version to trunk?"
435
+ run cp -rf $repo_dir/* ./
436
+
437
+ # Removes development files we know shouldn't make to the SVN repo
438
+ run rm -rf .[!.]* # this will remove all hidden files
439
+ run rm -rf bin
440
+ run rm -rf tests
441
+ run rm -rf composer*
442
+ run rm -rf phpunit*
443
+ run rm -rf vendor/apache/log4php/src/test
444
+ run rm -rf facebook-instant-articles-wp.zip
445
+ run rm -rf jsawk
446
+ run rm -rf resty
447
+ run rm -rf vendor/apache/log4php/.git
448
+
449
+ run svn st | grep '^\?' | sed 's/^\? *//' | xargs -I% svn add %
450
+ run svn status
451
+ ask "Review changes?"
452
+ if [[ $user_response == 'y' ]]; then
453
+ run svn diff
454
+ fi
455
+ confirm "Commit changes to trunk?"
456
+ run svn commit -m "Release $version"
457
+ confirm "Tag version $version?"
458
+ run svn cp ../trunk ../tags/$version
459
+ run cd ..
460
+ run svn commit -m "Tag $version"
461
+
462
+ revert_repo
463
+
464
+ echo "🍺 Published $version successfully"
465
+ }
466
+
467
+ # Run right command
468
+ if [[ $selected_cmd == 'bump_version' ]]; then bump_version; exit 0; fi
469
+ if [[ $selected_cmd == 'release' ]]; then release; exit 0; fi
470
+ if [[ $selected_cmd == 'publish' ]]; then publish; exit 0; fi
471
+ if [[ $selected_cmd == 'all' ]]; then bump_version; release; publish; exit 0; fi
472
+ error_message "Invalid command $selected_cmd"
rules-configuration.json CHANGED
@@ -63,7 +63,10 @@
63
  "class": "PassThroughRule",
64
  "selector": "blockquote p"
65
  }, {
66
- "class": "ImageInsideParagraphRule",
 
 
 
67
  "selector": "img",
68
  "properties": {
69
  "image.url": {
@@ -72,9 +75,9 @@
72
  "attribute": "src"
73
  }
74
  }
75
- },{
76
  "class": "ImageRule",
77
- "selector": "img",
78
  "properties": {
79
  "image.url": {
80
  "type": "string",
@@ -270,133 +273,6 @@
270
  "attribute": "width"
271
  }
272
  }
273
- }, {
274
- "class": "InteractiveInsideParagraphRule",
275
- "selector" : "iframe",
276
- "properties" : {
277
- "interactive.url" : {
278
- "type" : "string",
279
- "selector" : "iframe",
280
- "attribute": "src"
281
- },
282
- "interactive.height" : {
283
- "type" : "int",
284
- "selector" : "iframe",
285
- "attribute": "height"
286
- },
287
- "interactive.width" : {
288
- "type" : "int",
289
- "selector" : "iframe",
290
- "attribute": "width"
291
- }
292
- }
293
- },{
294
- "class": "InteractiveInsideParagraphRule",
295
- "selector" : "div.embed",
296
- "properties" : {
297
- "interactive.iframe" : {
298
- "type" : "children",
299
- "selector" : "div.embed"
300
- },
301
- "interactive.height" : {
302
- "type" : "int",
303
- "selector" : "iframe",
304
- "attribute": "height"
305
- },
306
- "interactive.width" : {
307
- "type" : "int",
308
- "selector" : "iframe",
309
- "attribute": "width"
310
- }
311
- }
312
- }, {
313
- "class": "InteractiveInsideParagraphRule",
314
- "selector" : "div.interactive",
315
- "properties" : {
316
- "interactive.iframe" : {
317
- "type" : "children",
318
- "selector" : "div.interactive"
319
- },
320
- "interactive.height" : {
321
- "type" : "int",
322
- "selector" : "iframe",
323
- "attribute": "height"
324
- },
325
- "interactive.width" : {
326
- "type" : "int",
327
- "selector" : "iframe",
328
- "attribute": "width"
329
- }
330
- }
331
- }, {
332
- "class": "InteractiveInsideParagraphRule",
333
- "selector" : "//div[@class='embed' and iframe]",
334
- "properties" : {
335
- "interactive.url" : {
336
- "type" : "string",
337
- "selector" : "iframe",
338
- "attribute": "src"
339
- },
340
- "interactive.iframe" : {
341
- "type" : "children",
342
- "selector" : "iframe",
343
- "attribute": "src"
344
- },
345
- "interactive.width" : {
346
- "type" : "int",
347
- "selector" : "iframe",
348
- "attribute": "width"
349
- },
350
- "interactive.height" : {
351
- "type" : "int",
352
- "selector" : "iframe",
353
- "attribute": "height"
354
- }
355
- }
356
- }, {
357
- "class": "InteractiveInsideParagraphRule",
358
- "selector" : "//div[@class='interactive' and iframe]",
359
- "properties" : {
360
- "interactive.url" : {
361
- "type" : "string",
362
- "selector" : "iframe",
363
- "attribute": "src"
364
- },
365
- "interactive.iframe" : {
366
- "type" : "children",
367
- "selector" : "iframe",
368
- "attribute": "src"
369
- },
370
- "interactive.height" : {
371
- "type" : "int",
372
- "selector" : "iframe",
373
- "attribute": "height"
374
- },
375
- "interactive.width" : {
376
- "type" : "int",
377
- "selector" : "iframe",
378
- "attribute": "width"
379
- }
380
- }
381
- }, {
382
- "class": "InteractiveInsideParagraphRule",
383
- "selector" : "table",
384
- "properties" : {
385
- "interactive.iframe" : {
386
- "type" : "element",
387
- "selector" : "table"
388
- },
389
- "interactive.height" : {
390
- "type" : "int",
391
- "selector" : "table",
392
- "attribute": "height"
393
- },
394
- "interactive.width" : {
395
- "type" : "int",
396
- "selector" : "table",
397
- "attribute": "width"
398
- }
399
- }
400
  }, {
401
  "class": "SlideshowImageRule",
402
  "selector" : "figure",
63
  "class": "PassThroughRule",
64
  "selector": "blockquote p"
65
  }, {
66
+ "class": "ItalicRule",
67
+ "selector": "cite"
68
+ }, {
69
+ "class": "ImageRule",
70
  "selector": "img",
71
  "properties": {
72
  "image.url": {
75
  "attribute": "src"
76
  }
77
  }
78
+ }, {
79
  "class": "ImageRule",
80
+ "selector": "//a[img and not(*[not(self::img)])]",
81
  "properties": {
82
  "image.url": {
83
  "type": "string",
273
  "attribute": "width"
274
  }
275
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  }, {
277
  "class": "SlideshowImageRule",
278
  "selector" : "figure",
vendor/composer/installed.json CHANGED
@@ -1,72 +1,49 @@
1
  [
2
  {
3
- "name": "symfony/css-selector",
4
- "version": "v2.8.14",
5
- "version_normalized": "2.8.14.0",
6
  "source": {
7
  "type": "git",
8
- "url": "https://github.com/symfony/css-selector.git",
9
- "reference": "981abbbd6ba49af338a98490cbe29e7f39ca9fa9"
10
- },
11
- "dist": {
12
- "type": "zip",
13
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/981abbbd6ba49af338a98490cbe29e7f39ca9fa9",
14
- "reference": "981abbbd6ba49af338a98490cbe29e7f39ca9fa9",
15
- "shasum": ""
16
  },
17
  "require": {
18
- "php": ">=5.3.9"
19
  },
20
- "time": "2016-11-03 07:52:58",
21
  "type": "library",
22
- "extra": {
23
- "branch-alias": {
24
- "dev-master": "2.8-dev"
25
- }
26
- },
27
- "installation-source": "dist",
28
  "autoload": {
29
- "psr-4": {
30
- "Symfony\\Component\\CssSelector\\": ""
31
- },
32
- "exclude-from-classmap": [
33
- "/Tests/"
34
  ]
35
  },
36
  "notification-url": "https://packagist.org/downloads/",
37
  "license": [
38
- "MIT"
39
- ],
40
- "authors": [
41
- {
42
- "name": "Jean-François Simon",
43
- "email": "jeanfrancois.simon@sensiolabs.com"
44
- },
45
- {
46
- "name": "Fabien Potencier",
47
- "email": "fabien@symfony.com"
48
- },
49
- {
50
- "name": "Symfony Community",
51
- "homepage": "https://symfony.com/contributors"
52
- }
53
  ],
54
- "description": "Symfony CssSelector Component",
55
- "homepage": "https://symfony.com"
 
 
 
 
 
56
  },
57
  {
58
  "name": "facebook/graph-sdk",
59
- "version": "5.4.2",
60
- "version_normalized": "5.4.2.0",
61
  "source": {
62
  "type": "git",
63
  "url": "https://github.com/facebook/php-graph-sdk.git",
64
- "reference": "2839246e971aef150650196acbb46d47e5207370"
65
  },
66
  "dist": {
67
  "type": "zip",
68
- "url": "https://api.github.com/repos/facebook/php-graph-sdk/zipball/2839246e971aef150650196acbb46d47e5207370",
69
- "reference": "2839246e971aef150650196acbb46d47e5207370",
70
  "shasum": ""
71
  },
72
  "require": {
@@ -81,7 +58,7 @@
81
  "guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client",
82
  "paragonie/random_compat": "Provides a better CSPRNG option in PHP 5"
83
  },
84
- "time": "2016-11-15 14:34:16",
85
  "type": "library",
86
  "extra": {
87
  "branch-alias": {
@@ -115,64 +92,87 @@
115
  ]
116
  },
117
  {
118
- "name": "apache/log4php",
119
- "version": "2.3.0",
120
- "version_normalized": "2.3.0.0",
121
  "source": {
122
  "type": "git",
123
- "url": "https://git-wip-us.apache.org/repos/asf/logging-log4php.git",
124
- "reference": "8c6df2481cd68d0d211d38f700406c5f0a9de0c2"
 
 
 
 
 
 
125
  },
126
  "require": {
127
- "php": ">=5.2.7"
128
  },
129
- "time": "2012-10-26 09:13:25",
130
  "type": "library",
131
- "installation-source": "source",
 
 
 
 
 
132
  "autoload": {
133
- "classmap": [
134
- "src/main/php/"
 
 
 
135
  ]
136
  },
137
  "notification-url": "https://packagist.org/downloads/",
138
  "license": [
139
- "Apache-2.0"
140
  ],
141
- "description": "A versatile logging framework for PHP",
142
- "homepage": "http://logging.apache.org/log4php/",
143
- "keywords": [
144
- "log",
145
- "logging",
146
- "php"
147
- ]
 
 
 
 
 
 
 
 
 
148
  },
149
  {
150
  "name": "facebook/facebook-instant-articles-sdk-php",
151
- "version": "v1.5.2",
152
- "version_normalized": "1.5.2.0",
153
  "source": {
154
  "type": "git",
155
  "url": "https://github.com/facebook/facebook-instant-articles-sdk-php.git",
156
- "reference": "563726feebd4c3a0132d33bb5b946d4b460a9fa7"
157
  },
158
  "dist": {
159
  "type": "zip",
160
- "url": "https://api.github.com/repos/facebook/facebook-instant-articles-sdk-php/zipball/563726feebd4c3a0132d33bb5b946d4b460a9fa7",
161
- "reference": "563726feebd4c3a0132d33bb5b946d4b460a9fa7",
162
  "shasum": ""
163
  },
164
  "require": {
165
  "apache/log4php": "2.3.0",
166
  "facebook/graph-sdk": "~5.0",
167
  "php": "^5.4 || ^7.0",
168
- "symfony/css-selector": "2.8.*"
169
  },
170
  "require-dev": {
171
  "fzaninotto/faker": "^1.6.0",
172
  "phpunit/phpunit": "^4.8",
173
  "squizlabs/php_codesniffer": "^2.6.0"
174
  },
175
- "time": "2016-10-07 18:26:43",
176
  "type": "library",
177
  "installation-source": "dist",
178
  "autoload": {
1
  [
2
  {
3
+ "name": "apache/log4php",
4
+ "version": "2.3.0",
5
+ "version_normalized": "2.3.0.0",
6
  "source": {
7
  "type": "git",
8
+ "url": "https://git-wip-us.apache.org/repos/asf/logging-log4php.git",
9
+ "reference": "8c6df2481cd68d0d211d38f700406c5f0a9de0c2"
 
 
 
 
 
 
10
  },
11
  "require": {
12
+ "php": ">=5.2.7"
13
  },
14
+ "time": "2012-10-26 09:13:25",
15
  "type": "library",
16
+ "installation-source": "source",
 
 
 
 
 
17
  "autoload": {
18
+ "classmap": [
19
+ "src/main/php/"
 
 
 
20
  ]
21
  },
22
  "notification-url": "https://packagist.org/downloads/",
23
  "license": [
24
+ "Apache-2.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  ],
26
+ "description": "A versatile logging framework for PHP",
27
+ "homepage": "http://logging.apache.org/log4php/",
28
+ "keywords": [
29
+ "log",
30
+ "logging",
31
+ "php"
32
+ ]
33
  },
34
  {
35
  "name": "facebook/graph-sdk",
36
+ "version": "5.5.0",
37
+ "version_normalized": "5.5.0.0",
38
  "source": {
39
  "type": "git",
40
  "url": "https://github.com/facebook/php-graph-sdk.git",
41
+ "reference": "93d7dc87e55a541d2e27d38f3aed40abbffdf6e1"
42
  },
43
  "dist": {
44
  "type": "zip",
45
+ "url": "https://api.github.com/repos/facebook/php-graph-sdk/zipball/93d7dc87e55a541d2e27d38f3aed40abbffdf6e1",
46
+ "reference": "93d7dc87e55a541d2e27d38f3aed40abbffdf6e1",
47
  "shasum": ""
48
  },
49
  "require": {
58
  "guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client",
59
  "paragonie/random_compat": "Provides a better CSPRNG option in PHP 5"
60
  },
61
+ "time": "2017-04-20 14:15:02",
62
  "type": "library",
63
  "extra": {
64
  "branch-alias": {
92
  ]
93
  },
94
  {
95
+ "name": "symfony/css-selector",
96
+ "version": "v3.2.8",
97
+ "version_normalized": "3.2.8.0",
98
  "source": {
99
  "type": "git",
100
+ "url": "https://github.com/symfony/css-selector.git",
101
+ "reference": "02983c144038e697c959e6b06ef6666de759ccbc"
102
+ },
103
+ "dist": {
104
+ "type": "zip",
105
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/02983c144038e697c959e6b06ef6666de759ccbc",
106
+ "reference": "02983c144038e697c959e6b06ef6666de759ccbc",
107
+ "shasum": ""
108
  },
109
  "require": {
110
+ "php": ">=5.5.9"
111
  },
112
+ "time": "2017-05-01 14:55:58",
113
  "type": "library",
114
+ "extra": {
115
+ "branch-alias": {
116
+ "dev-master": "3.2-dev"
117
+ }
118
+ },
119
+ "installation-source": "dist",
120
  "autoload": {
121
+ "psr-4": {
122
+ "Symfony\\Component\\CssSelector\\": ""
123
+ },
124
+ "exclude-from-classmap": [
125
+ "/Tests/"
126
  ]
127
  },
128
  "notification-url": "https://packagist.org/downloads/",
129
  "license": [
130
+ "MIT"
131
  ],
132
+ "authors": [
133
+ {
134
+ "name": "Jean-François Simon",
135
+ "email": "jeanfrancois.simon@sensiolabs.com"
136
+ },
137
+ {
138
+ "name": "Fabien Potencier",
139
+ "email": "fabien@symfony.com"
140
+ },
141
+ {
142
+ "name": "Symfony Community",
143
+ "homepage": "https://symfony.com/contributors"
144
+ }
145
+ ],
146
+ "description": "Symfony CssSelector Component",
147
+ "homepage": "https://symfony.com"
148
  },
149
  {
150
  "name": "facebook/facebook-instant-articles-sdk-php",
151
+ "version": "v1.5.7",
152
+ "version_normalized": "1.5.7.0",
153
  "source": {
154
  "type": "git",
155
  "url": "https://github.com/facebook/facebook-instant-articles-sdk-php.git",
156
+ "reference": "540cfcf1df49ce98d1942c34672ac10bf8888bd7"
157
  },
158
  "dist": {
159
  "type": "zip",
160
+ "url": "https://api.github.com/repos/facebook/facebook-instant-articles-sdk-php/zipball/540cfcf1df49ce98d1942c34672ac10bf8888bd7",
161
+ "reference": "540cfcf1df49ce98d1942c34672ac10bf8888bd7",
162
  "shasum": ""
163
  },
164
  "require": {
165
  "apache/log4php": "2.3.0",
166
  "facebook/graph-sdk": "~5.0",
167
  "php": "^5.4 || ^7.0",
168
+ "symfony/css-selector": "2.8.* || ^3.0"
169
  },
170
  "require-dev": {
171
  "fzaninotto/faker": "^1.6.0",
172
  "phpunit/phpunit": "^4.8",
173
  "squizlabs/php_codesniffer": "^2.6.0"
174
  },
175
+ "time": "2017-04-27 18:49:03",
176
  "type": "library",
177
  "installation-source": "dist",
178
  "autoload": {
vendor/facebook/facebook-instant-articles-sdk-php/.github/ISSUE_TEMPLATE.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Steps required to reproduce the problem
2
+
3
+ 1.
4
+ 2.
5
+ 3.
6
+
7
+ # Expected Result
8
+
9
+ *
10
+
11
+ # Actual Result
12
+
13
+ *
vendor/facebook/facebook-instant-articles-sdk-php/.github/PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ This PR
2
+
3
+ * [x]
4
+ * [ ]
5
+ * [ ]
6
+
7
+ Follows #.
8
+ Related to #.
9
+ Fixes #.
vendor/facebook/facebook-instant-articles-sdk-php/.gitignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ composer.phar
2
+ /vendor/
3
+ *.ignored
4
+ **/IgnoredTest.php
5
+ .DS_Store
vendor/facebook/facebook-instant-articles-sdk-php/composer.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "facebook/facebook-instant-articles-sdk-php",
3
+ "description": "Facebook Instant Articles SDK for PHP",
4
+ "keywords": ["facebook", "sdk", "instant", "articles"],
5
+ "type": "library",
6
+ "homepage": "https://github.com/facebook/facebook-instant-articles-sdk-php",
7
+ "license": "proprietary",
8
+ "authors": [{
9
+ "name": "Facebook",
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.* || ^3.0",
15
+ "facebook/graph-sdk": "~5.0",
16
+ "apache/log4php": "2.3.0"
17
+ },
18
+ "require-dev": {
19
+ "fzaninotto/faker": "^1.6.0",
20
+ "phpunit/phpunit": "^4.8",
21
+ "squizlabs/php_codesniffer": "^2.6.0"
22
+ },
23
+ "autoload": {
24
+ "psr-4": {
25
+ "Facebook\\InstantArticles\\": "src/Facebook/InstantArticles/"
26
+ }
27
+ },
28
+ "autoload-dev": {
29
+ "psr-4": {
30
+ "Facebook\\InstantArticles\\": "tests/Facebook/InstantArticles/"
31
+ }
32
+ },
33
+ "scripts": {
34
+ "all": [
35
+ "@cs",
36
+ "@test"
37
+ ],
38
+ "cs": [
39
+ "composer install",
40
+ "phpcbf --standard=phpcs.xml -p || phpcs --standard=phpcs.xml -p"
41
+ ],
42
+ "test": [
43
+ "composer install",
44
+ "phpunit"
45
+ ]
46
+ }
47
+ }
vendor/facebook/facebook-instant-articles-sdk-php/composer.lock ADDED
@@ -0,0 +1,1246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_readme": [
3
+ "This file locks the dependencies of your project to a known state",
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
+ "content-hash": "8841c13d6e972dcf95be310e7057845a",
8
+ "packages": [
9
+ {
10
+ "name": "apache/log4php",
11
+ "version": "2.3.0",
12
+ "source": {
13
+ "type": "git",
14
+ "url": "https://git-wip-us.apache.org/repos/asf/logging-log4php.git",
15
+ "reference": "8c6df2481cd68d0d211d38f700406c5f0a9de0c2"
16
+ },
17
+ "require": {
18
+ "php": ">=5.2.7"
19
+ },
20
+ "type": "library",
21
+ "autoload": {
22
+ "classmap": [
23
+ "src/main/php/"
24
+ ]
25
+ },
26
+ "notification-url": "https://packagist.org/downloads/",
27
+ "license": [
28
+ "Apache-2.0"
29
+ ],
30
+ "description": "A versatile logging framework for PHP",
31
+ "homepage": "http://logging.apache.org/log4php/",
32
+ "keywords": [
33
+ "log",
34
+ "logging",
35
+ "php"
36
+ ],
37
+ "time": "2012-10-26T09:13:25+00:00"
38
+ },
39
+ {
40
+ "name": "facebook/graph-sdk",
41
+ "version": "5.4.2",
42
+ "source": {
43
+ "type": "git",
44
+ "url": "https://github.com/facebook/php-graph-sdk.git",
45
+ "reference": "2839246e971aef150650196acbb46d47e5207370"
46
+ },
47
+ "dist": {
48
+ "type": "zip",
49
+ "url": "https://api.github.com/repos/facebook/php-graph-sdk/zipball/2839246e971aef150650196acbb46d47e5207370",
50
+ "reference": "2839246e971aef150650196acbb46d47e5207370",
51
+ "shasum": ""
52
+ },
53
+ "require": {
54
+ "php": "^5.4|^7.0"
55
+ },
56
+ "require-dev": {
57
+ "guzzlehttp/guzzle": "~5.0",
58
+ "mockery/mockery": "~0.8",
59
+ "phpunit/phpunit": "~4.0"
60
+ },
61
+ "suggest": {
62
+ "guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client",
63
+ "paragonie/random_compat": "Provides a better CSPRNG option in PHP 5"
64
+ },
65
+ "type": "library",
66
+ "extra": {
67
+ "branch-alias": {
68
+ "dev-master": "5.x-dev"
69
+ }
70
+ },
71
+ "autoload": {
72
+ "psr-4": {
73
+ "Facebook\\": "src/Facebook/"
74
+ },
75
+ "files": [
76
+ "src/Facebook/polyfills.php"
77
+ ]
78
+ },
79
+ "notification-url": "https://packagist.org/downloads/",
80
+ "license": [
81
+ "Facebook Platform"
82
+ ],
83
+ "authors": [
84
+ {
85
+ "name": "Facebook",
86
+ "homepage": "https://github.com/facebook/php-graph-sdk/contributors"
87
+ }
88
+ ],
89
+ "description": "Facebook SDK for PHP",
90
+ "homepage": "https://github.com/facebook/php-graph-sdk",
91
+ "keywords": [
92
+ "facebook",
93
+ "sdk"
94
+ ],
95
+ "time": "2016-11-15T14:34:16+00:00"
96
+ },
97
+ {
98
+ "name": "symfony/css-selector",
99
+ "version": "v2.8.14",
100
+ "source": {
101
+ "type": "git",
102
+ "url": "https://github.com/symfony/css-selector.git",
103
+ "reference": "981abbbd6ba49af338a98490cbe29e7f39ca9fa9"
104
+ },
105
+ "dist": {
106
+ "type": "zip",
107
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/981abbbd6ba49af338a98490cbe29e7f39ca9fa9",
108
+ "reference": "981abbbd6ba49af338a98490cbe29e7f39ca9fa9",
109
+ "shasum": ""
110
+ },
111
+ "require": {
112
+ "php": ">=5.3.9"
113
+ },
114
+ "type": "library",
115
+ "extra": {
116
+ "branch-alias": {
117
+ "dev-master": "2.8-dev"
118
+ }
119
+ },
120
+ "autoload": {
121
+ "psr-4": {
122
+ "Symfony\\Component\\CssSelector\\": ""
123
+ },
124
+ "exclude-from-classmap": [
125
+ "/Tests/"
126
+ ]
127
+ },
128
+ "notification-url": "https://packagist.org/downloads/",
129
+ "license": [
130
+ "MIT"
131
+ ],
132
+ "authors": [
133
+ {
134
+ "name": "Jean-François Simon",
135
+ "email": "jeanfrancois.simon@sensiolabs.com"
136
+ },
137
+ {
138
+ "name": "Fabien Potencier",
139
+ "email": "fabien@symfony.com"
140
+ },
141
+ {
142
+ "name": "Symfony Community",
143
+ "homepage": "https://symfony.com/contributors"
144
+ }
145
+ ],
146
+ "description": "Symfony CssSelector Component",
147
+ "homepage": "https://symfony.com",
148
+ "time": "2016-11-03T07:52:58+00:00"
149
+ }
150
+ ],
151
+ "packages-dev": [
152
+ {
153
+ "name": "doctrine/instantiator",
154
+ "version": "1.0.5",
155
+ "source": {
156
+ "type": "git",
157
+ "url": "https://github.com/doctrine/instantiator.git",
158
+ "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
159
+ },
160
+ "dist": {
161
+ "type": "zip",
162
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
163
+ "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
164
+ "shasum": ""
165
+ },
166
+ "require": {
167
+ "php": ">=5.3,<8.0-DEV"
168
+ },
169
+ "require-dev": {
170
+ "athletic/athletic": "~0.1.8",
171
+ "ext-pdo": "*",
172
+ "ext-phar": "*",
173
+ "phpunit/phpunit": "~4.0",
174
+ "squizlabs/php_codesniffer": "~2.0"
175
+ },
176
+ "type": "library",
177
+ "extra": {
178
+ "branch-alias": {
179
+ "dev-master": "1.0.x-dev"
180
+ }
181
+ },
182
+ "autoload": {
183
+ "psr-4": {
184
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
185
+ }
186
+ },
187
+ "notification-url": "https://packagist.org/downloads/",
188
+ "license": [
189
+ "MIT"
190
+ ],
191
+ "authors": [
192
+ {
193
+ "name": "Marco Pivetta",
194
+ "email": "ocramius@gmail.com",
195
+ "homepage": "http://ocramius.github.com/"
196
+ }
197
+ ],
198
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
199
+ "homepage": "https://github.com/doctrine/instantiator",
200
+ "keywords": [
201
+ "constructor",
202
+ "instantiate"
203
+ ],
204
+ "time": "2015-06-14T21:17:01+00:00"
205
+ },
206
+ {
207
+ "name": "fzaninotto/faker",
208
+ "version": "v1.6.0",
209
+ "source": {
210
+ "type": "git",
211
+ "url": "https://github.com/fzaninotto/Faker.git",
212
+ "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123"
213
+ },
214
+ "dist": {
215
+ "type": "zip",
216
+ "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/44f9a286a04b80c76a4e5fb7aad8bb539b920123",
217
+ "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123",
218
+ "shasum": ""
219
+ },
220
+ "require": {
221
+ "php": "^5.3.3|^7.0"
222
+ },
223
+ "require-dev": {
224
+ "ext-intl": "*",
225
+ "phpunit/phpunit": "~4.0",
226
+ "squizlabs/php_codesniffer": "~1.5"
227
+ },
228
+ "type": "library",
229
+ "extra": {
230
+ "branch-alias": []
231
+ },
232
+ "autoload": {
233
+ "psr-4": {
234
+ "Faker\\": "src/Faker/"
235
+ }
236
+ },
237
+ "notification-url": "https://packagist.org/downloads/",
238
+ "license": [
239
+ "MIT"
240
+ ],
241
+ "authors": [
242
+ {
243
+ "name": "François Zaninotto"
244
+ }
245
+ ],
246
+ "description": "Faker is a PHP library that generates fake data for you.",
247
+ "keywords": [
248
+ "data",
249
+ "faker",
250
+ "fixtures"
251
+ ],
252
+ "time": "2016-04-29T12:21:54+00:00"
253
+ },
254
+ {
255
+ "name": "phpdocumentor/reflection-docblock",
256
+ "version": "2.0.4",
257
+ "source": {
258
+ "type": "git",
259
+ "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
260
+ "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
261
+ },
262
+ "dist": {
263
+ "type": "zip",
264
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
265
+ "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
266
+ "shasum": ""
267
+ },
268
+ "require": {
269
+ "php": ">=5.3.3"
270
+ },
271
+ "require-dev": {
272
+ "phpunit/phpunit": "~4.0"
273
+ },
274
+ "suggest": {
275
+ "dflydev/markdown": "~1.0",
276
+ "erusev/parsedown": "~1.0"
277
+ },
278
+ "type": "library",
279
+ "extra": {
280
+ "branch-alias": {
281
+ "dev-master": "2.0.x-dev"
282
+ }
283
+ },
284
+ "autoload": {
285
+ "psr-0": {
286
+ "phpDocumentor": [
287
+ "src/"
288
+ ]
289
+ }
290
+ },
291
+ "notification-url": "https://packagist.org/downloads/",
292
+ "license": [
293
+ "MIT"
294
+ ],
295
+ "authors": [
296
+ {
297
+ "name": "Mike van Riel",
298
+ "email": "mike.vanriel@naenius.com"
299
+ }
300
+ ],
301
+ "time": "2015-02-03T12:10:50+00:00"
302
+ },
303
+ {
304
+ "name": "phpspec/prophecy",
305
+ "version": "v1.6.2",
306
+ "source": {
307
+ "type": "git",
308
+ "url": "https://github.com/phpspec/prophecy.git",
309
+ "reference": "6c52c2722f8460122f96f86346600e1077ce22cb"
310
+ },
311
+ "dist": {
312
+ "type": "zip",
313
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb",
314
+ "reference": "6c52c2722f8460122f96f86346600e1077ce22cb",
315
+ "shasum": ""
316
+ },
317
+ "require": {
318
+ "doctrine/instantiator": "^1.0.2",
319
+ "php": "^5.3|^7.0",
320
+ "phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
321
+ "sebastian/comparator": "^1.1",
322
+ "sebastian/recursion-context": "^1.0|^2.0"
323
+ },
324
+ "require-dev": {
325
+ "phpspec/phpspec": "^2.0",
326
+ "phpunit/phpunit": "^4.8 || ^5.6.5"
327
+ },
328
+ "type": "library",
329
+ "extra": {
330
+ "branch-alias": {
331
+ "dev-master": "1.6.x-dev"
332
+ }
333
+ },
334
+ "autoload": {
335
+ "psr-0": {
336
+ "Prophecy\\": "src/"
337
+ }
338
+ },
339
+ "notification-url": "https://packagist.org/downloads/",
340
+ "license": [
341
+ "MIT"
342
+ ],
343
+ "authors": [
344
+ {
345
+ "name": "Konstantin Kudryashov",
346
+ "email": "ever.zet@gmail.com",
347
+ "homepage": "http://everzet.com"
348
+ },
349
+ {
350
+ "name": "Marcello Duarte",
351
+ "email": "marcello.duarte@gmail.com"
352
+ }
353
+ ],
354
+ "description": "Highly opinionated mocking framework for PHP 5.3+",
355
+ "homepage": "https://github.com/phpspec/prophecy",
356
+ "keywords": [
357
+ "Double",
358
+ "Dummy",
359
+ "fake",
360
+ "mock",
361
+ "spy",
362
+ "stub"
363
+ ],
364
+ "time": "2016-11-21T14:58:47+00:00"
365
+ },
366
+ {
367
+ "name": "phpunit/php-code-coverage",
368
+ "version": "2.2.4",
369
+ "source": {
370
+ "type": "git",
371
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
372
+ "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
373
+ },
374
+ "dist": {
375
+ "type": "zip",
376
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
377
+ "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
378
+ "shasum": ""
379
+ },
380
+ "require": {
381
+ "php": ">=5.3.3",
382
+ "phpunit/php-file-iterator": "~1.3",
383
+ "phpunit/php-text-template": "~1.2",
384
+ "phpunit/php-token-stream": "~1.3",
385
+ "sebastian/environment": "^1.3.2",
386
+ "sebastian/version": "~1.0"
387
+ },
388
+ "require-dev": {
389
+ "ext-xdebug": ">=2.1.4",
390
+ "phpunit/phpunit": "~4"
391
+ },
392
+ "suggest": {
393
+ "ext-dom": "*",
394
+ "ext-xdebug": ">=2.2.1",
395
+ "ext-xmlwriter": "*"
396
+ },
397
+ "type": "library",
398
+ "extra": {
399
+ "branch-alias": {
400
+ "dev-master": "2.2.x-dev"
401
+ }
402
+ },
403
+ "autoload": {
404
+ "classmap": [
405
+ "src/"
406
+ ]
407
+ },
408
+ "notification-url": "https://packagist.org/downloads/",
409
+ "license": [
410
+ "BSD-3-Clause"
411
+ ],
412
+ "authors": [
413
+ {
414
+ "name": "Sebastian Bergmann",
415
+ "email": "sb@sebastian-bergmann.de",
416
+ "role": "lead"
417
+ }
418
+ ],
419
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
420
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
421
+ "keywords": [
422
+ "coverage",
423
+ "testing",
424
+ "xunit"
425
+ ],
426
+ "time": "2015-10-06T15:47:00+00:00"
427
+ },
428
+ {
429
+ "name": "phpunit/php-file-iterator",
430
+ "version": "1.4.1",
431
+ "source": {
432
+ "type": "git",
433
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
434
+ "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
435
+ },
436
+ "dist": {
437
+ "type": "zip",
438
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
439
+ "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
440
+ "shasum": ""
441
+ },
442
+ "require": {
443
+ "php": ">=5.3.3"
444
+ },
445
+ "type": "library",
446
+ "extra": {
447
+ "branch-alias": {
448
+ "dev-master": "1.4.x-dev"
449
+ }
450
+ },
451
+ "autoload": {
452
+ "classmap": [
453
+ "src/"
454
+ ]
455
+ },
456
+ "notification-url": "https://packagist.org/downloads/",
457
+ "license": [
458
+ "BSD-3-Clause"
459
+ ],
460
+ "authors": [
461
+ {
462
+ "name": "Sebastian Bergmann",
463
+ "email": "sb@sebastian-bergmann.de",
464
+ "role": "lead"
465
+ }
466
+ ],
467
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
468
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
469
+ "keywords": [
470
+ "filesystem",
471
+ "iterator"
472
+ ],
473
+ "time": "2015-06-21T13:08:43+00:00"
474
+ },
475
+ {
476
+ "name": "phpunit/php-text-template",
477
+ "version": "1.2.1",
478
+ "source": {
479
+ "type": "git",
480
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
481
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
482
+ },
483
+ "dist": {
484
+ "type": "zip",
485
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
486
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
487
+ "shasum": ""
488
+ },
489
+ "require": {
490
+ "php": ">=5.3.3"
491
+ },
492
+ "type": "library",
493
+ "autoload": {
494
+ "classmap": [
495
+ "src/"
496
+ ]
497
+ },
498
+ "notification-url": "https://packagist.org/downloads/",
499
+ "license": [
500
+ "BSD-3-Clause"
501
+ ],
502
+ "authors": [
503
+ {
504
+ "name": "Sebastian Bergmann",
505
+ "email": "sebastian@phpunit.de",
506
+ "role": "lead"
507
+ }
508
+ ],
509
+ "description": "Simple template engine.",
510
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
511
+ "keywords": [
512
+ "template"
513
+ ],
514
+ "time": "2015-06-21T13:50:34+00:00"
515
+ },
516
+ {
517
+ "name": "phpunit/php-timer",
518
+ "version": "1.0.8",
519
+ "source": {
520
+ "type": "git",
521
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
522
+ "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
523
+ },
524
+ "dist": {
525
+ "type": "zip",
526
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
527
+ "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
528
+ "shasum": ""
529
+ },
530
+ "require": {
531
+ "php": ">=5.3.3"
532
+ },
533
+ "require-dev": {
534
+ "phpunit/phpunit": "~4|~5"
535
+ },
536
+ "type": "library",
537
+ "autoload": {
538
+ "classmap": [
539
+ "src/"
540
+ ]
541
+ },
542
+ "notification-url": "https://packagist.org/downloads/",
543
+ "license": [
544
+ "BSD-3-Clause"
545
+ ],
546
+ "authors": [
547
+ {
548
+ "name": "Sebastian Bergmann",
549
+ "email": "sb@sebastian-bergmann.de",
550
+ "role": "lead"
551
+ }
552
+ ],
553
+ "description": "Utility class for timing",
554
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
555
+ "keywords": [
556
+ "timer"
557
+ ],
558
+ "time": "2016-05-12T18:03:57+00:00"
559
+ },
560
+ {
561
+ "name": "phpunit/php-token-stream",
562
+ "version": "1.4.9",
563
+ "source": {
564
+ "type": "git",
565
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
566
+ "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b"
567
+ },
568
+ "dist": {
569
+ "type": "zip",
570
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b",
571
+ "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b",
572
+ "shasum": ""
573
+ },
574
+ "require": {
575
+ "ext-tokenizer": "*",
576
+ "php": ">=5.3.3"
577
+ },
578
+ "require-dev": {
579
+ "phpunit/phpunit": "~4.2"
580
+ },
581
+ "type": "library",
582
+ "extra": {
583
+ "branch-alias": {
584
+ "dev-master": "1.4-dev"
585
+ }
586
+ },
587
+ "autoload": {
588
+ "classmap": [
589
+ "src/"
590
+ ]
591
+ },
592
+ "notification-url": "https://packagist.org/downloads/",
593
+ "license": [
594
+ "BSD-3-Clause"
595
+ ],
596
+ "authors": [
597
+ {
598
+ "name": "Sebastian Bergmann",
599
+ "email": "sebastian@phpunit.de"
600
+ }
601
+ ],
602
+ "description": "Wrapper around PHP's tokenizer extension.",
603
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
604
+ "keywords": [
605
+ "tokenizer"
606
+ ],
607
+ "time": "2016-11-15T14:06:22+00:00"
608
+ },
609
+ {
610
+ "name": "phpunit/phpunit",
611
+ "version": "4.8.29",
612
+ "source": {
613
+ "type": "git",
614
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
615
+ "reference": "f19d481b468b76a7fb55eb2b772ed487e484891e"
616
+ },
617
+ "dist": {
618
+ "type": "zip",
619
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f19d481b468b76a7fb55eb2b772ed487e484891e",
620
+ "reference": "f19d481b468b76a7fb55eb2b772ed487e484891e",
621
+ "shasum": ""
622
+ },
623
+ "require": {
624
+ "ext-dom": "*",
625
+ "ext-json": "*",
626
+ "ext-pcre": "*",
627
+ "ext-reflection": "*",
628
+ "ext-spl": "*",
629
+ "php": ">=5.3.3",
630
+ "phpspec/prophecy": "^1.3.1",
631
+ "phpunit/php-code-coverage": "~2.1",
632
+ "phpunit/php-file-iterator": "~1.4",
633
+ "phpunit/php-text-template": "~1.2",
634
+ "phpunit/php-timer": "^1.0.6",
635
+ "phpunit/phpunit-mock-objects": "~2.3",
636
+ "sebastian/comparator": "~1.2.2",
637
+ "sebastian/diff": "~1.2",
638
+ "sebastian/environment": "~1.3",
639
+ "sebastian/exporter": "~1.2",
640
+ "sebastian/global-state": "~1.0",
641
+ "sebastian/version": "~1.0",
642
+ "symfony/yaml": "~2.1|~3.0"
643
+ },
644
+ "suggest": {
645
+ "phpunit/php-invoker": "~1.1"
646
+ },
647
+ "bin": [
648
+ "phpunit"
649
+ ],
650
+ "type": "library",
651
+ "extra": {
652
+ "branch-alias": {
653
+ "dev-master": "4.8.x-dev"
654
+ }
655
+ },
656
+ "autoload": {
657
+ "classmap": [
658
+ "src/"
659
+ ]
660
+ },
661
+ "notification-url": "https://packagist.org/downloads/",
662
+ "license": [
663
+ "BSD-3-Clause"
664
+ ],
665
+ "authors": [
666
+ {
667
+ "name": "Sebastian Bergmann",
668
+ "email": "sebastian@phpunit.de",
669
+ "role": "lead"
670
+ }
671
+ ],
672
+ "description": "The PHP Unit Testing framework.",
673
+ "homepage": "https://phpunit.de/",
674
+ "keywords": [
675
+ "phpunit",
676
+ "testing",
677
+ "xunit"
678
+ ],
679
+ "time": "2016-11-20T10:35:28+00:00"
680
+ },
681
+ {
682
+ "name": "phpunit/phpunit-mock-objects",
683
+ "version": "2.3.8",
684
+ "source": {
685
+ "type": "git",
686
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
687
+ "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
688
+ },
689
+ "dist": {
690
+ "type": "zip",
691
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
692
+ "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
693
+ "shasum": ""
694
+ },
695
+ "require": {
696
+ "doctrine/instantiator": "^1.0.2",
697
+ "php": ">=5.3.3",
698
+ "phpunit/php-text-template": "~1.2",
699
+ "sebastian/exporter": "~1.2"
700
+ },
701
+ "require-dev": {
702
+ "phpunit/phpunit": "~4.4"
703
+ },
704
+ "suggest": {
705
+ "ext-soap": "*"
706
+ },
707
+ "type": "library",
708
+ "extra": {
709
+ "branch-alias": {
710
+ "dev-master": "2.3.x-dev"
711
+ }
712
+ },
713
+ "autoload": {
714
+ "classmap": [
715
+ "src/"
716
+ ]
717
+ },
718
+ "notification-url": "https://packagist.org/downloads/",
719
+ "license": [
720
+ "BSD-3-Clause"
721
+ ],
722
+ "authors": [
723
+ {
724
+ "name": "Sebastian Bergmann",
725
+ "email": "sb@sebastian-bergmann.de",
726
+ "role": "lead"
727
+ }
728
+ ],
729
+ "description": "Mock Object library for PHPUnit",
730
+ "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
731
+ "keywords": [
732
+ "mock",
733
+ "xunit"
734
+ ],
735
+ "time": "2015-10-02T06:51:40+00:00"
736
+ },
737
+ {
738
+ "name": "sebastian/comparator",
739
+ "version": "1.2.2",
740
+ "source": {
741
+ "type": "git",
742
+ "url": "https://github.com/sebastianbergmann/comparator.git",
743
+ "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f"
744
+ },
745
+ "dist": {
746
+ "type": "zip",
747
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f",
748
+ "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f",
749
+ "shasum": ""
750
+ },
751
+ "require": {
752
+ "php": ">=5.3.3",
753
+ "sebastian/diff": "~1.2",
754
+ "sebastian/exporter": "~1.2 || ~2.0"
755
+ },
756
+ "require-dev": {
757
+ "phpunit/phpunit": "~4.4"
758
+ },
759
+ "type": "library",
760
+ "extra": {
761
+ "branch-alias": {
762
+ "dev-master": "1.2.x-dev"
763
+ }
764
+ },
765
+ "autoload": {
766
+ "classmap": [
767
+ "src/"
768
+ ]
769
+ },
770
+ "notification-url": "https://packagist.org/downloads/",
771
+ "license": [
772
+ "BSD-3-Clause"
773
+ ],
774
+ "authors": [
775
+ {
776
+ "name": "Jeff Welch",
777
+ "email": "whatthejeff@gmail.com"
778
+ },
779
+ {
780
+ "name": "Volker Dusch",
781
+ "email": "github@wallbash.com"
782
+ },
783
+ {
784
+ "name": "Bernhard Schussek",
785
+ "email": "bschussek@2bepublished.at"
786
+ },
787
+ {
788
+ "name": "Sebastian Bergmann",
789
+ "email": "sebastian@phpunit.de"
790
+ }
791
+ ],
792
+ "description": "Provides the functionality to compare PHP values for equality",
793
+ "homepage": "http://www.github.com/sebastianbergmann/comparator",
794
+ "keywords": [
795
+ "comparator",
796
+ "compare",
797
+ "equality"
798
+ ],
799
+ "time": "2016-11-19T09:18:40+00:00"
800
+ },
801
+ {
802
+ "name": "sebastian/diff",
803
+ "version": "1.4.1",
804
+ "source": {
805
+ "type": "git",
806
+ "url": "https://github.com/sebastianbergmann/diff.git",
807
+ "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
808
+ },
809
+ "dist": {
810
+ "type": "zip",
811
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
812
+ "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
813
+ "shasum": ""
814
+ },
815
+ "require": {
816
+ "php": ">=5.3.3"
817
+ },
818
+ "require-dev": {
819
+ "phpunit/phpunit": "~4.8"
820
+ },
821
+ "type": "library",
822
+ "extra": {
823
+ "branch-alias": {
824
+ "dev-master": "1.4-dev"
825
+ }
826
+ },
827
+ "autoload": {
828
+ "classmap": [
829
+ "src/"
830
+ ]
831
+ },
832
+ "notification-url": "https://packagist.org/downloads/",
833
+ "license": [
834
+ "BSD-3-Clause"
835
+ ],
836
+ "authors": [
837
+ {
838
+ "name": "Kore Nordmann",
839
+ "email": "mail@kore-nordmann.de"
840
+ },
841
+ {
842
+ "name": "Sebastian Bergmann",
843
+ "email": "sebastian@phpunit.de"
844
+ }
845
+ ],
846
+ "description": "Diff implementation",
847
+ "homepage": "https://github.com/sebastianbergmann/diff",
848
+ "keywords": [
849
+ "diff"
850
+ ],
851
+ "time": "2015-12-08T07:14:41+00:00"
852
+ },
853
+ {
854
+ "name": "sebastian/environment",
855
+ "version": "1.3.8",
856
+ "source": {
857
+ "type": "git",
858
+ "url": "https://github.com/sebastianbergmann/environment.git",
859
+ "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
860
+ },
861
+ "dist": {
862
+ "type": "zip",
863
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
864
+ "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
865
+ "shasum": ""
866
+ },
867
+ "require": {
868
+ "php": "^5.3.3 || ^7.0"
869
+ },
870
+ "require-dev": {
871
+ "phpunit/phpunit": "^4.8 || ^5.0"
872
+ },
873
+ "type": "library",
874
+ "extra": {
875
+ "branch-alias": {
876
+ "dev-master": "1.3.x-dev"
877
+ }
878
+ },
879
+ "autoload": {
880
+ "classmap": [
881
+ "src/"
882
+ ]
883
+ },
884
+ "notification-url": "https://packagist.org/downloads/",
885
+ "license": [
886
+ "BSD-3-Clause"
887
+ ],
888
+ "authors": [
889
+ {
890
+ "name": "Sebastian Bergmann",
891
+ "email": "sebastian@phpunit.de"
892
+ }
893
+ ],
894
+ "description": "Provides functionality to handle HHVM/PHP environments",
895
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
896
+ "keywords": [
897
+ "Xdebug",
898
+ "environment",
899
+ "hhvm"
900
+ ],
901
+ "time": "2016-08-18T05:49:44+00:00"
902
+ },
903
+ {
904
+ "name": "sebastian/exporter",
905
+ "version": "1.2.2",
906
+ "source": {
907
+ "type": "git",
908
+ "url": "https://github.com/sebastianbergmann/exporter.git",
909
+ "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
910
+ },
911
+ "dist": {
912
+ "type": "zip",
913
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
914
+ "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
915
+ "shasum": ""
916
+ },
917
+ "require": {
918
+ "php": ">=5.3.3",
919
+ "sebastian/recursion-context": "~1.0"
920
+ },
921
+ "require-dev": {
922
+ "ext-mbstring": "*",
923
+ "phpunit/phpunit": "~4.4"
924
+ },
925
+ "type": "library",
926
+ "extra": {
927
+ "branch-alias": {
928
+ "dev-master": "1.3.x-dev"
929
+ }
930
+ },
931
+ "autoload": {
932
+ "classmap": [
933
+ "src/"
934
+ ]
935
+ },
936
+ "notification-url": "https://packagist.org/downloads/",
937
+ "license": [
938
+ "BSD-3-Clause"
939
+ ],
940
+ "authors": [
941
+ {
942
+ "name": "Jeff Welch",
943
+ "email": "whatthejeff@gmail.com"
944
+ },
945
+ {
946
+ "name": "Volker Dusch",
947
+ "email": "github@wallbash.com"
948
+ },
949
+ {
950
+ "name": "Bernhard Schussek",
951
+ "email": "bschussek@2bepublished.at"
952
+ },
953
+ {
954
+ "name": "Sebastian Bergmann",
955
+ "email": "sebastian@phpunit.de"
956
+ },
957
+ {
958
+ "name": "Adam Harvey",
959
+ "email": "aharvey@php.net"
960
+ }
961
+ ],
962
+ "description": "Provides the functionality to export PHP variables for visualization",
963
+ "homepage": "http://www.github.com/sebastianbergmann/exporter",
964
+ "keywords": [
965
+ "export",
966
+ "exporter"
967
+ ],
968
+ "time": "2016-06-17T09:04:28+00:00"
969
+ },
970
+ {
971
+ "name": "sebastian/global-state",
972
+ "version": "1.1.1",
973
+ "source": {
974
+ "type": "git",
975
+ "url": "https://github.com/sebastianbergmann/global-state.git",
976
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
977
+ },
978
+ "dist": {
979
+ "type": "zip",
980
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
981
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
982
+ "shasum": ""
983
+ },
984
+ "require": {
985
+ "php": ">=5.3.3"
986
+ },
987
+ "require-dev": {
988
+ "phpunit/phpunit": "~4.2"
989
+ },
990
+ "suggest": {
991
+ "ext-uopz": "*"
992
+ },
993
+ "type": "library",
994
+ "extra": {
995
+ "branch-alias": {
996
+ "dev-master": "1.0-dev"
997
+ }
998
+ },
999
+ "autoload": {
1000
+ "classmap": [
1001
+ "src/"
1002
+ ]
1003
+ },
1004
+ "notification-url": "https://packagist.org/downloads/",
1005
+ "license": [
1006
+ "BSD-3-Clause"
1007
+ ],
1008
+ "authors": [
1009
+ {
1010
+ "name": "Sebastian Bergmann",
1011
+ "email": "sebastian@phpunit.de"
1012
+ }
1013
+ ],
1014
+ "description": "Snapshotting of global state",
1015
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
1016
+ "keywords": [
1017
+ "global state"
1018
+ ],
1019
+ "time": "2015-10-12T03:26:01+00:00"
1020
+ },
1021
+ {
1022
+ "name": "sebastian/recursion-context",
1023
+ "version": "1.0.2",
1024
+ "source": {
1025
+ "type": "git",
1026
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
1027
+ "reference": "913401df809e99e4f47b27cdd781f4a258d58791"
1028
+ },
1029
+ "dist": {
1030
+ "type": "zip",
1031
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
1032
+ "reference": "913401df809e99e4f47b27cdd781f4a258d58791",
1033
+ "shasum": ""
1034
+ },
1035
+ "require": {
1036
+ "php": ">=5.3.3"
1037
+ },
1038
+ "require-dev": {
1039
+ "phpunit/phpunit": "~4.4"
1040
+ },
1041
+ "type": "library",
1042
+ "extra": {
1043
+ "branch-alias": {
1044
+ "dev-master": "1.0.x-dev"
1045
+ }
1046
+ },
1047
+ "autoload": {
1048
+ "classmap": [
1049
+ "src/"
1050
+ ]
1051
+ },
1052
+ "notification-url": "https://packagist.org/downloads/",
1053
+ "license": [
1054
+ "BSD-3-Clause"
1055
+ ],
1056
+ "authors": [
1057
+ {
1058
+ "name": "Jeff Welch",
1059
+ "email": "whatthejeff@gmail.com"
1060
+ },
1061
+ {
1062
+ "name": "Sebastian Bergmann",
1063
+ "email": "sebastian@phpunit.de"
1064
+ },
1065
+ {
1066
+ "name": "Adam Harvey",
1067
+ "email": "aharvey@php.net"
1068
+ }
1069
+ ],
1070
+ "description": "Provides functionality to recursively process PHP variables",
1071
+ "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
1072
+ "time": "2015-11-11T19:50:13+00:00"
1073
+ },
1074
+ {
1075
+ "name": "sebastian/version",
1076
+ "version": "1.0.6",
1077
+ "source": {
1078
+ "type": "git",
1079
+ "url": "https://github.com/sebastianbergmann/version.git",
1080
+ "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
1081
+ },
1082
+ "dist": {
1083
+ "type": "zip",
1084
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
1085
+ "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
1086
+ "shasum": ""
1087
+ },
1088
+ "type": "library",
1089
+ "autoload": {
1090
+ "classmap": [
1091
+ "src/"
1092
+ ]
1093
+ },
1094
+ "notification-url": "https://packagist.org/downloads/",
1095
+ "license": [
1096
+ "BSD-3-Clause"
1097
+ ],
1098
+ "authors": [
1099
+ {
1100
+ "name": "Sebastian Bergmann",
1101
+ "email": "sebastian@phpunit.de",
1102
+ "role": "lead"
1103
+ }
1104
+ ],
1105
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
1106
+ "homepage": "https://github.com/sebastianbergmann/version",
1107
+ "time": "2015-06-21T13:59:46+00:00"
1108
+ },
1109
+ {
1110
+ "name": "squizlabs/php_codesniffer",
1111
+ "version": "2.7.0",
1112
+ "source": {
1113
+ "type": "git",
1114
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
1115
+ "reference": "571e27b6348e5b3a637b2abc82ac0d01e6d7bbed"
1116
+ },
1117
+ "dist": {
1118
+ "type": "zip",
1119
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/571e27b6348e5b3a637b2abc82ac0d01e6d7bbed",
1120
+ "reference": "571e27b6348e5b3a637b2abc82ac0d01e6d7bbed",
1121
+ "shasum": ""
1122
+ },
1123
+ "require": {
1124
+ "ext-simplexml": "*",
1125
+ "ext-tokenizer": "*",
1126
+ "ext-xmlwriter": "*",
1127
+ "php": ">=5.1.2"
1128
+ },
1129
+ "require-dev": {
1130
+ "phpunit/phpunit": "~4.0"
1131
+ },
1132
+ "bin": [
1133
+ "scripts/phpcs",
1134
+ "scripts/phpcbf"
1135
+ ],
1136
+ "type": "library",
1137
+ "extra": {
1138
+ "branch-alias": {
1139
+ "dev-master": "2.x-dev"
1140
+ }
1141
+ },
1142
+ "autoload": {
1143
+ "classmap": [
1144
+ "CodeSniffer.php",
1145
+ "CodeSniffer/CLI.php",
1146
+ "CodeSniffer/Exception.php",
1147
+ "CodeSniffer/File.php",
1148
+ "CodeSniffer/Fixer.php",
1149
+ "CodeSniffer/Report.php",
1150
+ "CodeSniffer/Reporting.php",
1151
+ "CodeSniffer/Sniff.php",
1152
+ "CodeSniffer/Tokens.php",
1153
+ "CodeSniffer/Reports/",
1154
+ "CodeSniffer/Tokenizers/",
1155
+ "CodeSniffer/DocGenerators/",
1156
+ "CodeSniffer/Standards/AbstractPatternSniff.php",
1157
+ "CodeSniffer/Standards/AbstractScopeSniff.php",
1158
+ "CodeSniffer/Standards/AbstractVariableSniff.php",
1159
+ "CodeSniffer/Standards/IncorrectPatternException.php",
1160
+ "CodeSniffer/Standards/Generic/Sniffs/",
1161
+ "CodeSniffer/Standards/MySource/Sniffs/",
1162
+ "CodeSniffer/Standards/PEAR/Sniffs/",
1163
+ "CodeSniffer/Standards/PSR1/Sniffs/",
1164
+ "CodeSniffer/Standards/PSR2/Sniffs/",
1165
+ "CodeSniffer/Standards/Squiz/Sniffs/",
1166
+ "CodeSniffer/Standards/Zend/Sniffs/"
1167
+ ]
1168
+ },
1169
+ "notification-url": "https://packagist.org/downloads/",
1170
+ "license": [
1171
+ "BSD-3-Clause"
1172
+ ],
1173
+ "authors": [
1174
+ {
1175
+ "name": "Greg Sherwood",
1176
+ "role": "lead"
1177
+ }
1178
+ ],
1179
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
1180
+ "homepage": "http://www.squizlabs.com/php-codesniffer",
1181
+ "keywords": [
1182
+ "phpcs",
1183
+ "standards"
1184
+ ],
1185
+ "time": "2016-09-01T23:53:02+00:00"
1186
+ },
1187
+ {
1188
+ "name": "symfony/yaml",
1189
+ "version": "v2.8.14",
1190
+ "source": {
1191
+ "type": "git",
1192
+ "url": "https://github.com/symfony/yaml.git",
1193
+ "reference": "befb26a3713c97af90d25dd12e75621ef14d91ff"
1194
+ },
1195
+ "dist": {
1196
+ "type": "zip",
1197
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/befb26a3713c97af90d25dd12e75621ef14d91ff",
1198
+ "reference": "befb26a3713c97af90d25dd12e75621ef14d91ff",
1199
+ "shasum": ""
1200
+ },
1201
+ "require": {
1202
+ "php": ">=5.3.9"
1203
+ },
1204
+ "type": "library",
1205
+ "extra": {
1206
+ "branch-alias": {
1207
+ "dev-master": "2.8-dev"
1208
+ }
1209
+ },
1210
+ "autoload": {
1211
+ "psr-4": {
1212
+ "Symfony\\Component\\Yaml\\": ""
1213
+ },
1214
+ "exclude-from-classmap": [
1215
+ "/Tests/"
1216
+ ]
1217
+ },
1218
+ "notification-url": "https://packagist.org/downloads/",
1219
+ "license": [
1220
+ "MIT"
1221
+ ],
1222
+ "authors": [
1223
+ {
1224
+ "name": "Fabien Potencier",
1225
+ "email": "fabien@symfony.com"
1226
+ },
1227
+ {
1228
+ "name": "Symfony Community",
1229
+ "homepage": "https://symfony.com/contributors"
1230
+ }
1231
+ ],
1232
+ "description": "Symfony Yaml Component",
1233
+ "homepage": "https://symfony.com",
1234
+ "time": "2016-11-14T16:15:57+00:00"
1235
+ }
1236
+ ],
1237
+ "aliases": [],
1238
+ "minimum-stability": "stable",
1239
+ "stability-flags": [],
1240
+ "prefer-stable": false,
1241
+ "prefer-lowest": false,
1242
+ "platform": {
1243
+ "php": "^5.4 || ^7.0"
1244
+ },
1245
+ "platform-dev": []
1246
+ }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Client/Client.php CHANGED
@@ -85,10 +85,11 @@ class Client
85
  *
86
  * @param InstantArticle $article The article to import
87
  * @param bool|false $published Specifies if this article should be taken live or not. Optional. Default: false.
 
88
  *
89
  * @return int The submission status ID. It is not the article ID. (Since 1.3.0)
90
  */
91
- public function importArticle($article, $published = false)
92
  {
93
  Type::enforce($article, 'Facebook\InstantArticles\Elements\InstantArticleInterface');
94
  Type::enforce($published, Type::BOOLEAN);
@@ -98,14 +99,32 @@ class Client
98
 
99
  // Assume default access token is set on $this->facebook
100
  $response = $this->facebook->post($this->pageID . Client::EDGE_NAME, [
101
- 'html_source' => $article->render(),
102
  'published' => $published,
103
  'development_mode' => $this->developmentMode,
104
  ]);
105
 
 
 
 
 
 
106
  return $response->getGraphNode()->getField('id');
107
  }
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  /**
110
  * Removes an article from your Instant Articles library.
111
  *
85
  *
86
  * @param InstantArticle $article The article to import
87
  * @param bool|false $published Specifies if this article should be taken live or not. Optional. Default: false.
88
+ * @param bool|false $formatOutput Specifies if this article should be formatted after transformation. Optional. Default: false.
89
  *
90
  * @return int The submission status ID. It is not the article ID. (Since 1.3.0)
91
  */
92
+ public function importArticle($article, $published = false, $forceRescrape = false, $formatOutput = false)
93
  {
94
  Type::enforce($article, 'Facebook\InstantArticles\Elements\InstantArticleInterface');
95
  Type::enforce($published, Type::BOOLEAN);
99
 
100
  // Assume default access token is set on $this->facebook
101
  $response = $this->facebook->post($this->pageID . Client::EDGE_NAME, [
102
+ 'html_source' => $article->render(null, $formatOutput),
103
  'published' => $published,
104
  'development_mode' => $this->developmentMode,
105
  ]);
106
 
107
+ if ($forceRescrape) {
108
+ // Re-scrape Graph object for article URL
109
+ $this->scrapeArticleURL($article->getCanonicalURL());
110
+ }
111
+
112
  return $response->getGraphNode()->getField('id');
113
  }
114
 
115
+ /**
116
+ * Scrape Graph object for given URL
117
+ *
118
+ * @param string $canonicalURL The URL that will be scraped.
119
+ */
120
+ private function scrapeArticleURL($canonicalURL)
121
+ {
122
+ $this->facebook->post('/', [
123
+ 'id' => $canonicalURL,
124
+ 'scrape' => 'true',
125
+ ]);
126
+ }
127
+
128
  /**
129
  * Removes an article from your Instant Articles library.
130
  *
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Client/Helper.php CHANGED
@@ -61,12 +61,13 @@ class Helper
61
  * short-lived user access token.
62
  *
63
  * @param AccessToken $accessToken A short-lived user access token.
 
64
  *
65
  * @return array
66
  *
67
  * @throws FacebookSDKException
68
  */
69
- public function getPagesAndTokens($accessToken)
70
  {
71
  Type::enforce($accessToken, 'Facebook\Authentication\AccessToken');
72
 
@@ -89,7 +90,7 @@ class Helper
89
  // Request the list of pages and associated page tokens that are
90
  // connected to this user
91
  try {
92
- $response = $this->facebook->get('/me/accounts?fields=name,id,access_token,supports_instant_articles,picture');
93
  } catch (FacebookResponseException $e) {
94
  throw new FacebookSDKException('Graph API returned an error: ' . $e->getMessage());
95
  }
61
  * short-lived user access token.
62
  *
63
  * @param AccessToken $accessToken A short-lived user access token.
64
+ * @param int $offset Offset pages API results
65
  *
66
  * @return array
67
  *
68
  * @throws FacebookSDKException
69
  */
70
+ public function getPagesAndTokens($accessToken, $offset = 0)
71
  {
72
  Type::enforce($accessToken, 'Facebook\Authentication\AccessToken');
73
 
90
  // Request the list of pages and associated page tokens that are
91
  // connected to this user
92
  try {
93
+ $response = $this->facebook->get('/me/accounts?fields=name,id,access_token,supports_instant_articles,picture&offset=' . $offset);
94
  } catch (FacebookResponseException $e) {
95
  throw new FacebookSDKException('Graph API returned an error: ' . $e->getMessage());
96
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Caption.php CHANGED
@@ -37,6 +37,7 @@ use Facebook\InstantArticles\Validators\Type;
37
  class Caption extends FormattedText
38
  {
39
  // Font size
 
40
  const SIZE_MEDIUM = 'op-medium';
41
  const SIZE_LARGE = 'op-large';
42
  const SIZE_XLARGE = 'op-extra-large';
@@ -72,7 +73,7 @@ class Caption extends FormattedText
72
  private $credit;
73
 
74
  /**
75
- * @var string text Size. Values: "op-medium"|"op-large"|"op-extra-large"
76
  */
77
  private $fontSize;
78
 
@@ -161,6 +162,7 @@ class Caption extends FormattedText
161
  /**
162
  * The Fontsize that will be used.
163
  *
 
164
  * @see Caption::SIZE_MEDIUM
165
  * @see Caption::SIZE_LARGE
166
  * @see Caption::SIZE_XLARGE
@@ -176,7 +178,8 @@ class Caption extends FormattedText
176
  [
177
  Caption::SIZE_XLARGE,
178
  Caption::SIZE_LARGE,
179
- Caption::SIZE_MEDIUM
 
180
  ]
181
  );
182
  $this->fontSize = $font_size;
@@ -301,6 +304,7 @@ class Caption extends FormattedText
301
  /**
302
  * @return string the Font size.
303
  *
 
304
  * @see Caption::SIZE_MEDIUM
305
  * @see Caption::SIZE_LARGE
306
  * @see Caption::SIZE_XLARGE
@@ -334,6 +338,18 @@ class Caption extends FormattedText
334
  return $this->position;
335
  }
336
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  /**
338
  * Structure and create the full ArticleImage in a XML format DOMElement.
339
  *
37
  class Caption extends FormattedText
38
  {
39
  // Font size
40
+ const SIZE_SMALL = 'op-small';
41
  const SIZE_MEDIUM = 'op-medium';
42
  const SIZE_LARGE = 'op-large';
43
  const SIZE_XLARGE = 'op-extra-large';
73
  private $credit;
74
 
75
  /**
76
+ * @var string text Size. Values: "op-small"|"op-medium"|"op-large"|"op-extra-large"
77
  */
78
  private $fontSize;
79
 
162
  /**
163
  * The Fontsize that will be used.
164
  *
165
+ * @see Caption::SIZE_SMALL
166
  * @see Caption::SIZE_MEDIUM
167
  * @see Caption::SIZE_LARGE
168
  * @see Caption::SIZE_XLARGE
178
  [
179
  Caption::SIZE_XLARGE,
180
  Caption::SIZE_LARGE,
181
+ Caption::SIZE_MEDIUM,
182
+ Caption::SIZE_SMALL
183
  ]
184
  );
185
  $this->fontSize = $font_size;
304
  /**
305
  * @return string the Font size.
306
  *
307
+ * @see Caption::SIZE_SMALL
308
  * @see Caption::SIZE_MEDIUM
309
  * @see Caption::SIZE_LARGE
310
  * @see Caption::SIZE_XLARGE
338
  return $this->position;
339
  }
340
 
341
+ /**
342
+ * @return string the Vertical Alignment.
343
+ *
344
+ * @see Caption::VERTICAL_TOP
345
+ * @see Caption::VERTICAL_BOTTOM
346
+ * @see Caption::VERTICAL_CENTER
347
+ */
348
+ public function getVerticalAlignment()
349
+ {
350
+ return $this->verticalAlignment;
351
+ }
352
+
353
  /**
354
  * Structure and create the full ArticleImage in a XML format DOMElement.
355
  *
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Element.php CHANGED
@@ -20,7 +20,7 @@ abstract class Element
20
  {
21
  private $empty_validation = true;
22
 
23
- abstract public function toDOMElement();
24
 
25
  /**
26
  * Renders the Element content
20
  {
21
  private $empty_validation = true;
22
 
23
+ abstract public function toDOMElement($document = null);
24
 
25
  /**
26
  * Renders the Element content
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Footer.php CHANGED
@@ -104,7 +104,7 @@ class Footer extends Element implements Container
104
  */
105
  public function withCopyright($copyright)
106
  {
107
- Type::enforce($copyright, Type::STRING);
108
  $this->copyright = $copyright;
109
 
110
  return $this;
@@ -188,9 +188,13 @@ class Footer extends Element implements Container
188
  }
189
 
190
  if ($this->copyright) {
191
- $small = $document->createElement('small');
192
- $small->appendChild($document->createTextNode($this->copyright));
193
- $footer->appendChild($small);
 
 
 
 
194
  }
195
 
196
  if ($this->relatedArticles) {
104
  */
105
  public function withCopyright($copyright)
106
  {
107
+ Type::enforce($copyright, [Type::STRING, Small::getClassName()]);
108
  $this->copyright = $copyright;
109
 
110
  return $this;
188
  }
189
 
190
  if ($this->copyright) {
191
+ if (Type::is($this->copyright, Type::STRING)) {
192
+ $small = $document->createElement('small');
193
+ $small->appendChild($document->createTextNode($this->copyright));
194
+ $footer->appendChild($small);
195
+ } else {
196
+ $footer->appendChild($this->copyright->toDOMElement($document));
197
+ }
198
  }
199
 
200
  if ($this->relatedArticles) {
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Image.php CHANGED
@@ -40,6 +40,16 @@ class Image extends Audible implements Container
40
  const FULLSCREEN = 'fullscreen';
41
  const NON_INTERACTIVE = 'non-interactive';
42
 
 
 
 
 
 
 
 
 
 
 
43
  /**
44
  * @var Caption The caption for Image
45
  */
@@ -86,6 +96,8 @@ class Image extends Audible implements Container
86
  */
87
  private function __construct()
88
  {
 
 
89
  }
90
 
91
  /**
@@ -384,4 +396,28 @@ class Image extends Audible implements Container
384
 
385
  return $children;
386
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  }
40
  const FULLSCREEN = 'fullscreen';
41
  const NON_INTERACTIVE = 'non-interactive';
42
 
43
+ /**
44
+ * @var boolean marks if any created image will have likes enabled by default
45
+ */
46
+ public static $defaultLikeEnabled = false;
47
+
48
+ /**
49
+ * @var boolean marks if any created image will have comments enabled by default
50
+ */
51
+ public static $defaultCommentEnabled = false;
52
+
53
  /**
54
  * @var Caption The caption for Image
55
  */
96
  */
97
  private function __construct()
98
  {
99
+ $this->isLikeEnabled = self::$defaultLikeEnabled;
100
+ $this->isCommentsEnabled = self::$defaultCommentEnabled;
101
  }
102
 
103
  /**
396
 
397
  return $children;
398
  }
399
+
400
+ /**
401
+ * Modify the default setup to enable/disable likes in images
402
+ *
403
+ * WARNING this is not Thread-safe, so if you are using pthreads or any other multithreaded engine,
404
+ * this might not work as expected. (you will need to set this in all working threads manually)
405
+ * @param boolean $enabled inform true to enable likes on images per default or false to disable like on images.
406
+ */
407
+ public static function setDefaultLikeEnabled($enabled)
408
+ {
409
+ self::$defaultLikeEnabled = $enabled;
410
+ }
411
+
412
+ /**
413
+ * Modify the default setup to enable/disable comments in images
414
+ *
415
+ * WARNING this is not Thread-safe, so if you are using pthreads or any other multithreaded engine,
416
+ * this might not work as expected. (you will need to set this in all working threads manually)
417
+ * @param boolean $enabled inform true to enable comments on images per default or false to disable commenting on images.
418
+ */
419
+ public static function setDefaultCommentEnabled($enabled)
420
+ {
421
+ self::$defaultCommentEnabled = $enabled;
422
+ }
423
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/InstantArticle.php CHANGED
@@ -34,7 +34,7 @@ use Facebook\InstantArticles\Validators\Type;
34
 
35
  class InstantArticle extends Element implements Container, InstantArticleInterface
36
  {
37
- const CURRENT_VERSION = '1.5.0';
38
 
39
  /**
40
  * The meta properties that are used on <head>
@@ -81,6 +81,11 @@ class InstantArticle extends Element implements Container, InstantArticleInterfa
81
  */
82
  private $children = [];
83
 
 
 
 
 
 
84
  /**
85
  * Factory method
86
  * @return InstantArticle object.
@@ -165,6 +170,24 @@ class InstantArticle extends Element implements Container, InstantArticleInterfa
165
  return $this;
166
  }
167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  /**
169
  * Sets the header content to this InstantArticle
170
  *
@@ -195,6 +218,64 @@ class InstantArticle extends Element implements Container, InstantArticleInterfa
195
  return $this;
196
  }
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  /**
199
  * Adds new child elements to this InstantArticle
200
  *
@@ -275,6 +356,14 @@ class InstantArticle extends Element implements Container, InstantArticleInterfa
275
  return $this->canonicalURL;
276
  }
277
 
 
 
 
 
 
 
 
 
278
  /**
279
  * @return Header header element from the InstantArticle
280
  */
@@ -299,6 +388,22 @@ class InstantArticle extends Element implements Container, InstantArticleInterfa
299
  return $this->children;
300
  }
301
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
  /**
303
  * Adds a meta property for the <head> of Instant Article.
304
  *
@@ -315,6 +420,7 @@ class InstantArticle extends Element implements Container, InstantArticleInterfa
315
 
316
  public function render($doctype = '<!doctype html>', $format = false)
317
  {
 
318
  return parent::render($doctype, $format);
319
  }
320
 
@@ -326,6 +432,9 @@ class InstantArticle extends Element implements Container, InstantArticleInterfa
326
 
327
  // Builds and appends head to the HTML document
328
  $html = $document->createElement('html');
 
 
 
329
  $head = $document->createElement('head');
330
  $html->appendChild($head);
331
 
@@ -455,4 +564,18 @@ class InstantArticle extends Element implements Container, InstantArticleInterfa
455
 
456
  return $children;
457
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
458
  }
34
 
35
  class InstantArticle extends Element implements Container, InstantArticleInterface
36
  {
37
+ const CURRENT_VERSION = '1.5.7';
38
 
39
  /**
40
  * The meta properties that are used on <head>
81
  */
82
  private $children = [];
83
 
84
+ /**
85
+ * @var boolean flag that indicates if this article is Right-to-left(RTL). Defaults to false.
86
+ */
87
+ private $isRTLEnabled = false;
88
+
89
  /**
90
  * Factory method
91
  * @return InstantArticle object.
170
  return $this;
171
  }
172
 
173
+ /**
174
+ * Updates article to use RTL orientation.
175
+ */
176
+ public function enableRTL()
177
+ {
178
+ $this->isRTLEnabled = true;
179
+ return $this;
180
+ }
181
+
182
+ /**
183
+ * Updates article to use LTR orientation (default), disabling RTL.
184
+ */
185
+ public function disableRTL()
186
+ {
187
+ $this->isRTLEnabled = false;
188
+ return $this;
189
+ }
190
+
191
  /**
192
  * Sets the header content to this InstantArticle
193
  *
218
  return $this;
219
  }
220
 
221
+ /**
222
+ * Replace all the children within this InstantArticle
223
+ *
224
+ * @param Element[] $children Array of elements replacing the original.
225
+ *
226
+ * @return $this
227
+ */
228
+ public function withChildren($children)
229
+ {
230
+ Type::enforceArrayOf(
231
+ $children,
232
+ [
233
+ Ad::getClassName(),
234
+ Analytics::getClassName(),
235
+ AnimatedGIF::getClassName(),
236
+ Audio::getClassName(),
237
+ Blockquote::getClassName(),
238
+ Image::getClassName(),
239
+ H1::getClassName(),
240
+ H2::getClassName(),
241
+ Interactive::getClassName(),
242
+ ListElement::getClassName(),
243
+ Map::getClassName(),
244
+ Paragraph::getClassName(),
245
+ Pullquote::getClassName(),
246
+ RelatedArticles::getClassName(),
247
+ Slideshow::getClassName(),
248
+ SocialEmbed::getClassName(),
249
+ Video::getClassName()
250
+ ]
251
+ );
252
+ $this->children = $children;
253
+
254
+ return $this;
255
+ }
256
+
257
+ /**
258
+ * Replace all the children within this InstantArticle
259
+ *
260
+ * @param Type::INTEGER $index The index of the element to be deleted
261
+ * in the array of children.
262
+ *
263
+ * @return $this
264
+ */
265
+ public function deleteChild($index)
266
+ {
267
+ Type::enforce($index, Type::INTEGER);
268
+ $children = [];
269
+ foreach ($this->children as $childIndex => $child) {
270
+ if ($childIndex != $index) {
271
+ $children[] = $child;
272
+ }
273
+ }
274
+ $this->children = $children;
275
+
276
+ return $this;
277
+ }
278
+
279
  /**
280
  * Adds new child elements to this InstantArticle
281
  *
356
  return $this->canonicalURL;
357
  }
358
 
359
+ /**
360
+ * @return string style from the InstantArticle
361
+ */
362
+ public function getStyle()
363
+ {
364
+ return $this->style;
365
+ }
366
+
367
  /**
368
  * @return Header header element from the InstantArticle
369
  */
388
  return $this->children;
389
  }
390
 
391
+ /**
392
+ * @return boolean if this article is Right-to-left(RTL).
393
+ */
394
+ public function isRTLEnabled()
395
+ {
396
+ return $this->isRTLEnabled;
397
+ }
398
+
399
+ /**
400
+ * @return string The article charset.
401
+ */
402
+ public function getCharset()
403
+ {
404
+ return $this->charset;
405
+ }
406
+
407
  /**
408
  * Adds a meta property for the <head> of Instant Article.
409
  *
420
 
421
  public function render($doctype = '<!doctype html>', $format = false)
422
  {
423
+ $doctype = is_null($doctype) ? '<!doctype html>' : $doctype;
424
  return parent::render($doctype, $format);
425
  }
426
 
432
 
433
  // Builds and appends head to the HTML document
434
  $html = $document->createElement('html');
435
+ if ($this->isRTLEnabled) {
436
+ $html->setAttribute('dir', 'rtl');
437
+ }
438
  $head = $document->createElement('head');
439
  $html->appendChild($head);
440
 
564
 
565
  return $children;
566
  }
567
+
568
+ public function getFirstParagraph()
569
+ {
570
+ $items = $this->getChildren();
571
+ if ($items) {
572
+ foreach ($items as $item) {
573
+ if (Type::is($item, Paragraph::getClassName())) {
574
+ return $item;
575
+ }
576
+ }
577
+ }
578
+ // Case no paragraph exists, we return an empty paragraph
579
+ return Paragraph::create();
580
+ }
581
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Small.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016-present, Facebook, Inc.
4
+ * All rights reserved.
5
+ *
6
+ * This source code is licensed under the license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ namespace Facebook\InstantArticles\Elements;
10
+
11
+ /**
12
+ * A small Text container used in footer
13
+ *
14
+ * @see {link:https://developers.intern.facebook.com/docs/instant-articles/reference/footer}
15
+ */
16
+ class Small extends TextContainer
17
+ {
18
+ private function __construct()
19
+ {
20
+ }
21
+
22
+ /**
23
+ * @return Small
24
+ */
25
+ public static function create()
26
+ {
27
+ return new self();
28
+ }
29
+
30
+ /**
31
+ * Structure and create <small> node.
32
+ *
33
+ * @param \DOMDocument $document - The document where this element will be appended (optional).
34
+ *
35
+ * @return \DOMElement
36
+ */
37
+ public function toDOMElement($document = null)
38
+ {
39
+ if (!$document) {
40
+ $document = new \DOMDocument();
41
+ }
42
+
43
+ if (!$this->isValid()) {
44
+ return $this->emptyElement($document);
45
+ }
46
+
47
+ $small = $document->createElement('small');
48
+
49
+ $small->appendChild($this->textToDOMDocumentFragment($document));
50
+
51
+ return $small;
52
+ }
53
+ }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/TextContainer.php CHANGED
@@ -80,6 +80,27 @@ abstract class TextContainer extends Element implements Container
80
  return $fragment;
81
  }
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  /**
84
  * Overrides the Element::isValid().
85
  *
80
  return $fragment;
81
  }
82
 
83
+ /**
84
+ * Build up a string with the content from children text container
85
+ *
86
+ * @return string the unformated plain text content from children
87
+ */
88
+ public function getPlainText()
89
+ {
90
+ $text = '';
91
+
92
+ // Generate markup
93
+ foreach ($this->textChildren as $content) {
94
+ if (Type::is($content, Type::STRING)) {
95
+ $text .= $content;
96
+ } else {
97
+ $text .= $content->getPlainText();
98
+ }
99
+ }
100
+
101
+ return $text;
102
+ }
103
+
104
  /**
105
  * Overrides the Element::isValid().
106
  *
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Video.php CHANGED
@@ -44,6 +44,16 @@ class Video extends Element implements Container
44
  const LOOP = 'loop';
45
  const DATA_FADE = 'data-fade';
46
 
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * @var Caption The caption for Video
49
  */
@@ -114,6 +124,8 @@ class Video extends Element implements Container
114
 
115
  private function __construct()
116
  {
 
 
117
  }
118
 
119
  /**
@@ -433,6 +445,31 @@ class Video extends Element implements Container
433
  return $this->geoTag;
434
  }
435
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
436
  /**
437
  * Structure and create the full Video in a XML format DOMElement.
438
  *
44
  const LOOP = 'loop';
45
  const DATA_FADE = 'data-fade';
46
 
47
+ /**
48
+ * @var boolean marks if any created image will have likes enabled by default
49
+ */
50
+ private static $defaultLikeEnabled = false;
51
+
52
+ /**
53
+ * @var boolean marks if any created image will have comments enabled by default
54
+ */
55
+ private static $defaultCommentEnabled = false;
56
+
57
  /**
58
  * @var Caption The caption for Video
59
  */
124
 
125
  private function __construct()
126
  {
127
+ $this->isLikeEnabled = self::$defaultLikeEnabled;
128
+ $this->isCommentsEnabled = self::$defaultCommentEnabled;
129
  }
130
 
131
  /**
445
  return $this->geoTag;
446
  }
447
 
448
+ /**
449
+ * Modify the default setup to enable/disable likes in videos
450
+ *
451
+ * WARNING this is not Thread-safe, so if you are using pthreads or any other multithreaded engine,
452
+ * this might not work as expected. (you will need to set this in all working threads manually)
453
+ * @param boolean $enabled inform true to enable likes on videos per default or false to disable like on videos.
454
+ */
455
+ public static function setDefaultLikeEnabled($enabled)
456
+ {
457
+ self::$defaultLikeEnabled = $enabled;
458
+ }
459
+
460
+ /**
461
+ * Modify the default setup to enable/disable comments in videos
462
+ *
463
+ * WARNING this is not Thread-safe, so if you are using pthreads or any other multithreaded engine,
464
+ * this might not work as expected. (you will need to set this in all working threads manually)
465
+ * @param boolean $enabled inform true to enable comments on videos per default or false to disable commenting on videos.
466
+ */
467
+ public static function setDefaultCommentEnabled($enabled)
468
+ {
469
+ self::$defaultCommentEnabled = $enabled;
470
+ }
471
+
472
+
473
  /**
474
  * Structure and create the full Video in a XML format DOMElement.
475
  *
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Parser/instant-articles-rules.json CHANGED
@@ -129,6 +129,10 @@
129
  "class": "HeaderRule",
130
  "selector" : "header"
131
  },
 
 
 
 
132
  {
133
  "class": "FooterRule",
134
  "selector" : "footer"
@@ -146,14 +150,7 @@
146
  },
147
  {
148
  "class": "FooterRelatedArticlesRule",
149
- "selector" : "ul.op-related-articles",
150
- "properties" : {
151
- "related.title" : {
152
- "type" : "string",
153
- "selector" : "ul.op-related-articles",
154
- "attribute": "title"
155
- }
156
- }
157
  },
158
  {
159
  "class": "RelatedItemRule",
@@ -194,6 +191,11 @@
194
  "type" : "xpath",
195
  "selector" : "//meta[@property='fb:use_automatic_ad_placement']",
196
  "attribute": "content"
 
 
 
 
 
197
  }
198
 
199
  }
@@ -213,24 +215,30 @@
213
  {
214
  "class": "TimeRule",
215
  "selector" : "time.op-modified",
216
- "article.time_type": "op-modified",
217
  "properties" : {
218
  "article.time" : {
219
  "type" : "string",
220
  "selector" : "time",
221
  "attribute": "datetime"
 
 
 
 
222
  }
223
  }
224
  },
225
  {
226
  "class": "TimeRule",
227
  "selector" : "time.op-published",
228
- "article.time_type": "op-published",
229
  "properties" : {
230
  "article.time" : {
231
  "type" : "string",
232
  "selector" : "time",
233
  "attribute": "datetime"
 
 
 
 
234
  }
235
  }
236
  },
129
  "class": "HeaderRule",
130
  "selector" : "header"
131
  },
132
+ {
133
+ "class": "FooterSmallRule",
134
+ "selector": "small"
135
+ },
136
  {
137
  "class": "FooterRule",
138
  "selector" : "footer"
150
  },
151
  {
152
  "class": "FooterRelatedArticlesRule",
153
+ "selector" : "ul.op-related-articles"
 
 
 
 
 
 
 
154
  },
155
  {
156
  "class": "RelatedItemRule",
191
  "type" : "xpath",
192
  "selector" : "//meta[@property='fb:use_automatic_ad_placement']",
193
  "attribute": "content"
194
+ },
195
+ "article.style" : {
196
+ "type" : "xpath",
197
+ "selector": "//meta[@property='fb:article_style']",
198
+ "attribute": "content"
199
  }
200
 
201
  }
215
  {
216
  "class": "TimeRule",
217
  "selector" : "time.op-modified",
 
218
  "properties" : {
219
  "article.time" : {
220
  "type" : "string",
221
  "selector" : "time",
222
  "attribute": "datetime"
223
+ },
224
+ "article.datetype": {
225
+ "type": "constant",
226
+ "value": "op-modified"
227
  }
228
  }
229
  },
230
  {
231
  "class": "TimeRule",
232
  "selector" : "time.op-published",
 
233
  "properties" : {
234
  "article.time" : {
235
  "type" : "string",
236
  "selector" : "time",
237
  "attribute": "datetime"
238
+ },
239
+ "article.datetype": {
240
+ "type": "constant",
241
+ "value": "op-published"
242
  }
243
  }
244
  },
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/ConstantGetter.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016-present, Facebook, Inc.
4
+ * All rights reserved.
5
+ *
6
+ * This source code is licensed under the license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ namespace Facebook\InstantArticles\Transformer\Getters;
10
+
11
+ use Facebook\InstantArticles\Validators\Type;
12
+
13
+ class ConstantGetter extends AbstractGetter
14
+ {
15
+ /**
16
+ * @var string
17
+ */
18
+ protected $value;
19
+
20
+ public function createFrom($properties)
21
+ {
22
+ return $this->withValue($properties['value']);
23
+ }
24
+
25
+ /**
26
+ * @param string $value
27
+ *
28
+ * @return $this
29
+ */
30
+ public function withValue($value)
31
+ {
32
+ Type::enforce($value, Type::STRING);
33
+ $this->value = $value;
34
+
35
+ return $this;
36
+ }
37
+
38
+ public function get($node)
39
+ {
40
+ return $this->value;
41
+ }
42
+ }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/ElementGetter.php CHANGED
@@ -26,14 +26,14 @@ class ElementGetter extends AbstractGetter
26
 
27
  /**
28
  * @param \DOMNode $node
29
- *
30
  * @return \DOMNodeList
31
  */
32
- public function findAll($node)
33
  {
34
  $domXPath = new \DOMXPath($node->ownerDocument);
35
  $converter = new CssSelectorConverter();
36
- $xpath = $converter->toXPath($this->selector);
37
  return $domXPath->query($xpath, $node);
38
  }
39
 
26
 
27
  /**
28
  * @param \DOMNode $node
29
+ * @param string $selector
30
  * @return \DOMNodeList
31
  */
32
+ public function findAll($node, $selector)
33
  {
34
  $domXPath = new \DOMXPath($node->ownerDocument);
35
  $converter = new CssSelectorConverter();
36
+ $xpath = $converter->toXPath($selector);
37
  return $domXPath->query($xpath, $node);
38
  }
39
 
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/GetterFactory.php CHANGED
@@ -14,6 +14,7 @@ class GetterFactory
14
  const TYPE_INTEGER_GETTER = 'int';
15
  const TYPE_CHILDREN_GETTER = 'children';
16
  const TYPE_ELEMENT_GETTER = 'element';
 
17
  const TYPE_FRAGMENT_GETTER = 'fragment';
18
  const TYPE_NEXTSIBLING_GETTER = 'sibling';
19
  const TYPE_NEXTSIBLINGELEMENT_GETTER = 'next-sibling-element-of';
@@ -34,6 +35,7 @@ class GetterFactory
34
  * @see ChildrenGetter
35
  * @see IntegerGetter
36
  * @see ElementGetter
 
37
  * @see NextSiblingGetter
38
  * @see ExistsGetter
39
  * @see JSONGetter
@@ -51,6 +53,7 @@ class GetterFactory
51
  self::TYPE_CHILDREN_GETTER => ChildrenGetter::getClassName(),
52
  self::TYPE_ELEMENT_GETTER => ElementGetter::getClassName(),
53
  self::TYPE_FRAGMENT_GETTER => FragmentGetter::getClassName(),
 
54
  self::TYPE_NEXTSIBLING_GETTER => NextSiblingGetter::getClassName(),
55
  self::TYPE_NEXTSIBLINGELEMENT_GETTER => NextSiblingElementGetter::getClassName(),
56
  self::TYPE_EXISTS_GETTER => ExistsGetter::getClassName(),
14
  const TYPE_INTEGER_GETTER = 'int';
15
  const TYPE_CHILDREN_GETTER = 'children';
16
  const TYPE_ELEMENT_GETTER = 'element';
17
+ const TYPE_CONSTANT_GETTER = 'constant';
18
  const TYPE_FRAGMENT_GETTER = 'fragment';
19
  const TYPE_NEXTSIBLING_GETTER = 'sibling';
20
  const TYPE_NEXTSIBLINGELEMENT_GETTER = 'next-sibling-element-of';
35
  * @see ChildrenGetter
36
  * @see IntegerGetter
37
  * @see ElementGetter
38
+ * @see ConstantGetter
39
  * @see NextSiblingGetter
40
  * @see ExistsGetter
41
  * @see JSONGetter
53
  self::TYPE_CHILDREN_GETTER => ChildrenGetter::getClassName(),
54
  self::TYPE_ELEMENT_GETTER => ElementGetter::getClassName(),
55
  self::TYPE_FRAGMENT_GETTER => FragmentGetter::getClassName(),
56
+ self::TYPE_CONSTANT_GETTER => ConstantGetter::getClassName(),
57
  self::TYPE_NEXTSIBLING_GETTER => NextSiblingGetter::getClassName(),
58
  self::TYPE_NEXTSIBLINGELEMENT_GETTER => NextSiblingElementGetter::getClassName(),
59
  self::TYPE_EXISTS_GETTER => ExistsGetter::getClassName(),
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/StringGetter.php CHANGED
@@ -17,6 +17,16 @@ class StringGetter extends ChildrenGetter
17
  */
18
  protected $attribute;
19
 
 
 
 
 
 
 
 
 
 
 
20
  public function createFrom($properties)
21
  {
22
  if (isset($properties['selector'])) {
@@ -25,6 +35,12 @@ class StringGetter extends ChildrenGetter
25
  if (isset($properties['attribute'])) {
26
  $this->withAttribute($properties['attribute']);
27
  }
 
 
 
 
 
 
28
  }
29
 
30
  /**
@@ -40,6 +56,32 @@ class StringGetter extends ChildrenGetter
40
  return $this;
41
  }
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  public function get($node)
44
  {
45
  Type::enforce($node, 'DOMNode');
@@ -47,9 +89,18 @@ class StringGetter extends ChildrenGetter
47
  if (!empty($elements) && $elements->item(0)) {
48
  $element = $elements->item(0);
49
  if ($this->attribute) {
50
- return $element->getAttribute($this->attribute);
 
 
 
 
 
 
 
 
 
51
  }
52
- return $element->textContent;
53
  }
54
  return null;
55
  }
17
  */
18
  protected $attribute;
19
 
20
+ /**
21
+ * @var string
22
+ */
23
+ protected $prefix;
24
+
25
+ /**
26
+ * @var string
27
+ */
28
+ protected $suffix;
29
+
30
  public function createFrom($properties)
31
  {
32
  if (isset($properties['selector'])) {
35
  if (isset($properties['attribute'])) {
36
  $this->withAttribute($properties['attribute']);
37
  }
38
+ if (isset($properties['prefix'])) {
39
+ $this->withPrefix($properties['prefix']);
40
+ }
41
+ if (isset($properties['suffix'])) {
42
+ $this->withSuffix($properties['suffix']);
43
+ }
44
  }
45
 
46
  /**
56
  return $this;
57
  }
58
 
59
+ /**
60
+ * @param string $prefix
61
+ *
62
+ * @return $this
63
+ */
64
+ public function withPrefix($prefix)
65
+ {
66
+ Type::enforce($prefix, Type::STRING);
67
+ $this->prefix = $prefix;
68
+
69
+ return $this;
70
+ }
71
+
72
+ /**
73
+ * @param string $suffix
74
+ *
75
+ * @return $this
76
+ */
77
+ public function withSuffix($suffix)
78
+ {
79
+ Type::enforce($suffix, Type::STRING);
80
+ $this->suffix = $suffix;
81
+
82
+ return $this;
83
+ }
84
+
85
  public function get($node)
86
  {
87
  Type::enforce($node, 'DOMNode');
89
  if (!empty($elements) && $elements->item(0)) {
90
  $element = $elements->item(0);
91
  if ($this->attribute) {
92
+ $result = $element->getAttribute($this->attribute);
93
+ } else {
94
+ $result = $element->textContent;
95
+ }
96
+
97
+ if (!Type::isTextEmpty($this->prefix)) {
98
+ $result = $this->prefix . $result;
99
+ }
100
+ if (!Type::isTextEmpty($this->suffix)) {
101
+ $result = $result . $this->suffix;
102
  }
103
+ return $result;
104
  }
105
  return null;
106
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/CaptionRule.php CHANGED
@@ -53,6 +53,7 @@ class CaptionRule extends ConfigurationSelectorRule
53
  Caption::ALIGN_CENTER,
54
  Caption::ALIGN_RIGHT,
55
 
 
56
  Caption::SIZE_MEDIUM,
57
  Caption::SIZE_LARGE,
58
  Caption::SIZE_XLARGE,
@@ -90,6 +91,9 @@ class CaptionRule extends ConfigurationSelectorRule
90
  $caption->withTextAlignment(Caption::ALIGN_RIGHT);
91
  }
92
 
 
 
 
93
  if ($this->getProperty(Caption::SIZE_MEDIUM, $node)) {
94
  $caption->withFontsize(Caption::SIZE_MEDIUM);
95
  }
53
  Caption::ALIGN_CENTER,
54
  Caption::ALIGN_RIGHT,
55
 
56
+ Caption::SIZE_SMALL,
57
  Caption::SIZE_MEDIUM,
58
  Caption::SIZE_LARGE,
59
  Caption::SIZE_XLARGE,
91
  $caption->withTextAlignment(Caption::ALIGN_RIGHT);
92
  }
93
 
94
+ if ($this->getProperty(Caption::SIZE_SMALL, $node)) {
95
+ $caption->withFontsize(Caption::SIZE_SMALL);
96
+ }
97
  if ($this->getProperty(Caption::SIZE_MEDIUM, $node)) {
98
  $caption->withFontsize(Caption::SIZE_MEDIUM);
99
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/FooterRelatedArticlesRule.php CHANGED
@@ -13,8 +13,6 @@ use Facebook\InstantArticles\Elements\Footer;
13
 
14
  class FooterRelatedArticlesRule extends ConfigurationSelectorRule
15
  {
16
- const PROPERTY_TITLE = 'related.title';
17
-
18
  public function getContextClass()
19
  {
20
  return Footer::getClassName();
@@ -30,24 +28,13 @@ class FooterRelatedArticlesRule extends ConfigurationSelectorRule
30
  $related_articles_rule = self::create();
31
  $related_articles_rule->withSelector($configuration['selector']);
32
 
33
- $related_articles_rule->withProperty(
34
- self::PROPERTY_TITLE,
35
- self::retrieveProperty($configuration, self::PROPERTY_TITLE)
36
- );
37
-
38
  return $related_articles_rule;
39
  }
40
 
41
  public function apply($transformer, $footer, $node)
42
  {
43
  $related_articles = RelatedArticles::create();
44
-
45
- // Builds the image
46
- $title = $this->getProperty(self::PROPERTY_TITLE, $node);
47
- if ($title) {
48
- $related_articles->withTitle($title);
49
- $footer->withRelatedArticles($related_articles);
50
- }
51
 
52
  $transformer->transform($related_articles, $node);
53
 
13
 
14
  class FooterRelatedArticlesRule extends ConfigurationSelectorRule
15
  {
 
 
16
  public function getContextClass()
17
  {
18
  return Footer::getClassName();
28
  $related_articles_rule = self::create();
29
  $related_articles_rule->withSelector($configuration['selector']);
30
 
 
 
 
 
 
31
  return $related_articles_rule;
32
  }
33
 
34
  public function apply($transformer, $footer, $node)
35
  {
36
  $related_articles = RelatedArticles::create();
37
+ $footer->withRelatedArticles($related_articles);
 
 
 
 
 
 
38
 
39
  $transformer->transform($related_articles, $node);
40
 
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/FooterSmallRule.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016-present, Facebook, Inc.
4
+ * All rights reserved.
5
+ *
6
+ * This source code is licensed under the license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ namespace Facebook\InstantArticles\Transformer\Rules;
10
+
11
+ use Facebook\InstantArticles\Elements\Footer;
12
+ use Facebook\InstantArticles\Elements\Small;
13
+
14
+ class FooterSmallRule extends ConfigurationSelectorRule
15
+ {
16
+ public function getContextClass()
17
+ {
18
+ return Footer::getClassName();
19
+ }
20
+
21
+ public static function create()
22
+ {
23
+ return new FooterSmallRule();
24
+ }
25
+
26
+ public static function createFrom($configuration)
27
+ {
28
+ return self::create()->withSelector($configuration['selector']);
29
+ }
30
+
31
+ public function apply($transformer, $footer, $element)
32
+ {
33
+ $small = Small::create();
34
+ $footer->withCopyright($small);
35
+ $transformer->transform($small, $element);
36
+ return $footer;
37
+ }
38
+ }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/H1Rule.php CHANGED
@@ -41,6 +41,7 @@ class H1Rule extends ConfigurationSelectorRule
41
  Caption::ALIGN_CENTER,
42
  Caption::ALIGN_RIGHT,
43
 
 
44
  Caption::SIZE_MEDIUM,
45
  Caption::SIZE_LARGE,
46
  Caption::SIZE_XLARGE
41
  Caption::ALIGN_CENTER,
42
  Caption::ALIGN_RIGHT,
43
 
44
+ Caption::SIZE_SMALL,
45
  Caption::SIZE_MEDIUM,
46
  Caption::SIZE_LARGE,
47
  Caption::SIZE_XLARGE
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ImageInsideParagraphRule.php CHANGED
@@ -8,91 +8,15 @@
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
- use Facebook\InstantArticles\Elements\Image;
12
- use Facebook\InstantArticles\Elements\TextContainer;
13
  use Facebook\InstantArticles\Elements\Paragraph;
14
- use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
15
- use Facebook\InstantArticles\Transformer\Warnings\NoRootInstantArticleFoundWarning;
16
 
17
- class ImageInsideParagraphRule extends ConfigurationSelectorRule
 
 
 
18
  {
19
- const PROPERTY_IMAGE_URL = 'image.url';
20
- const PROPERTY_LIKE = 'image.like';
21
- const PROPERTY_COMMENTS = 'image.comments';
22
-
23
  public function getContextClass()
24
  {
25
  return Paragraph::getClassName();
26
  }
27
-
28
- public static function create()
29
- {
30
- return new ImageInsideParagraphRule();
31
- }
32
-
33
- public static function createFrom($configuration)
34
- {
35
- $image_rule = self::create();
36
- $image_rule->withSelector($configuration['selector']);
37
-
38
- $image_rule->withProperties(
39
- [
40
- self::PROPERTY_IMAGE_URL,
41
- self::PROPERTY_LIKE,
42
- self::PROPERTY_COMMENTS
43
- ],
44
- $configuration
45
- );
46
-
47
- return $image_rule;
48
- }
49
-
50
- public function apply($transformer, $context, $node)
51
- {
52
- $image = Image::create();
53
-
54
- // Builds the image
55
- $url = $this->getProperty(self::PROPERTY_IMAGE_URL, $node);
56
- if ($url) {
57
- $image->withURL($url);
58
- $instant_article = $transformer->getInstantArticle();
59
- if ($instant_article) {
60
- $instant_article->addChild($image);
61
- $context->disableEmptyValidation();
62
- $context = Paragraph::create();
63
- $context->disableEmptyValidation();
64
- $instant_article->addChild($context);
65
- } else {
66
- $transformer->addWarning(
67
- // This new error message should be something like:
68
- // Could not transform Image, as no root InstantArticle was provided.
69
- new NoRootInstantArticleFoundWarning(null, $node)
70
- );
71
- }
72
- } else {
73
- $transformer->addWarning(
74
- new InvalidSelector(
75
- self::PROPERTY_IMAGE_URL,
76
- $instant_article,
77
- $node,
78
- $this
79
- )
80
- );
81
- }
82
-
83
- if ($this->getProperty(self::PROPERTY_LIKE, $node)) {
84
- $image->enableLike();
85
- }
86
-
87
- if ($this->getProperty(self::PROPERTY_COMMENTS, $node)) {
88
- $image->enableComments();
89
- }
90
-
91
- $suppress_warnings = $transformer->suppress_warnings;
92
- $transformer->suppress_warnings = true;
93
- $transformer->transform($image, $node);
94
- $transformer->suppress_warnings = $suppress_warnings;
95
-
96
- return $context;
97
- }
98
  }
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
 
 
11
  use Facebook\InstantArticles\Elements\Paragraph;
 
 
12
 
13
+ /**
14
+ * @deprecated ImageRule now works inside Paragraph without a custom rule, use it instead
15
+ */
16
+ class ImageInsideParagraphRule extends ImageRule
17
  {
 
 
 
 
18
  public function getContextClass()
19
  {
20
  return Paragraph::getClassName();
21
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ImageRule.php CHANGED
@@ -9,8 +9,10 @@
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
16
  {
@@ -25,17 +27,21 @@ class ImageRule extends ConfigurationSelectorRule
25
 
26
  public function getContextClass()
27
  {
28
- return InstantArticle::getClassName();
 
 
 
 
29
  }
30
 
31
  public static function create()
32
  {
33
- return new ImageRule();
34
  }
35
 
36
  public static function createFrom($configuration)
37
  {
38
- $image_rule = self::create();
39
  $image_rule->withSelector($configuration['selector']);
40
 
41
  $image_rule->withProperties(
@@ -54,15 +60,34 @@ class ImageRule extends ConfigurationSelectorRule
54
  return $image_rule;
55
  }
56
 
57
- public function apply($transformer, $instant_article, $node)
58
  {
59
  $image = Image::create();
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  // Builds the image
62
  $url = $this->getProperty(self::PROPERTY_IMAGE_URL, $node);
63
  if ($url) {
64
  $image->withURL($url);
65
  $instant_article->addChild($image);
 
 
 
66
  } else {
67
  $transformer->addWarning(
68
  new InvalidSelector(
@@ -97,6 +122,6 @@ class ImageRule extends ConfigurationSelectorRule
97
  $transformer->transform($image, $node);
98
  $transformer->suppress_warnings = $suppress_warnings;
99
 
100
- return $instant_article;
101
  }
102
  }
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Image;
12
+ use Facebook\InstantArticles\Elements\Paragraph;
13
  use Facebook\InstantArticles\Elements\InstantArticle;
14
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
15
+ use Facebook\InstantArticles\Validators\Type;
16
 
17
  class ImageRule extends ConfigurationSelectorRule
18
  {
27
 
28
  public function getContextClass()
29
  {
30
+ return
31
+ [
32
+ InstantArticle::getClassName(),
33
+ Paragraph::getClassName()
34
+ ];
35
  }
36
 
37
  public static function create()
38
  {
39
+ return new static();
40
  }
41
 
42
  public static function createFrom($configuration)
43
  {
44
+ $image_rule = static::create();
45
  $image_rule->withSelector($configuration['selector']);
46
 
47
  $image_rule->withProperties(
60
  return $image_rule;
61
  }
62
 
63
+ public function apply($transformer, $context, $node)
64
  {
65
  $image = Image::create();
66
 
67
+ if (Type::is($context, InstantArticle::getClassName())) {
68
+ $instant_article = $context;
69
+ } elseif ($transformer->getInstantArticle()) {
70
+ $instant_article = $transformer->getInstantArticle();
71
+ $context->disableEmptyValidation();
72
+ $context = Paragraph::create();
73
+ $context->disableEmptyValidation();
74
+ } else {
75
+ $transformer->addWarning(
76
+ // This new error message should be something like:
77
+ // Could not transform Image, as no root InstantArticle was provided.
78
+ new NoRootInstantArticleFoundWarning(null, $node)
79
+ );
80
+ return $context;
81
+ }
82
+
83
  // Builds the image
84
  $url = $this->getProperty(self::PROPERTY_IMAGE_URL, $node);
85
  if ($url) {
86
  $image->withURL($url);
87
  $instant_article->addChild($image);
88
+ if ($instant_article !== $context) {
89
+ $instant_article->addChild($context);
90
+ }
91
  } else {
92
  $transformer->addWarning(
93
  new InvalidSelector(
122
  $transformer->transform($image, $node);
123
  $transformer->suppress_warnings = $suppress_warnings;
124
 
125
+ return $context;
126
  }
127
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InstantArticleRule.php CHANGED
@@ -17,6 +17,7 @@ class InstantArticleRule extends ConfigurationSelectorRule
17
  const PROPERTY_CHARSET = 'article.charset';
18
  const PROPERTY_MARKUP_VERSION = 'article.markup.version';
19
  const PROPERTY_AUTO_AD_PLACEMENT = 'article.auto.ad';
 
20
 
21
  public function getContextClass()
22
  {
@@ -38,7 +39,8 @@ class InstantArticleRule extends ConfigurationSelectorRule
38
  self::PROPERTY_CANONICAL,
39
  self::PROPERTY_CHARSET,
40
  self::PROPERTY_MARKUP_VERSION,
41
- self::PROPERTY_AUTO_AD_PLACEMENT
 
42
  ],
43
  $configuration
44
  );
@@ -78,6 +80,11 @@ class InstantArticleRule extends ConfigurationSelectorRule
78
  $instant_article->disableAutomaticAdPlacement();
79
  }
80
 
 
 
 
 
 
81
  return $instant_article;
82
  }
83
  }
17
  const PROPERTY_CHARSET = 'article.charset';
18
  const PROPERTY_MARKUP_VERSION = 'article.markup.version';
19
  const PROPERTY_AUTO_AD_PLACEMENT = 'article.auto.ad';
20
+ const PROPERTY_STYLE = 'article.style';
21
 
22
  public function getContextClass()
23
  {
39
  self::PROPERTY_CANONICAL,
40
  self::PROPERTY_CHARSET,
41
  self::PROPERTY_MARKUP_VERSION,
42
+ self::PROPERTY_AUTO_AD_PLACEMENT,
43
+ self::PROPERTY_STYLE
44
  ],
45
  $configuration
46
  );
80
  $instant_article->disableAutomaticAdPlacement();
81
  }
82
 
83
+ $style = $this->getProperty(self::PROPERTY_STYLE, $node);
84
+ if ($style) {
85
+ $instant_article->withStyle($style);
86
+ }
87
+
88
  return $instant_article;
89
  }
90
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InteractiveInsideParagraphRule.php CHANGED
@@ -8,112 +8,15 @@
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
- use Facebook\InstantArticles\Elements\Interactive;
12
  use Facebook\InstantArticles\Elements\Paragraph;
13
- use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
- use Facebook\InstantArticles\Transformer\Warnings\NoRootInstantArticleFoundWarning;
15
 
16
- class InteractiveInsideParagraphRule extends ConfigurationSelectorRule
 
 
 
17
  {
18
- const PROPERTY_IFRAME = 'interactive.iframe';
19
- const PROPERTY_URL = 'interactive.url';
20
- const PROPERTY_WIDTH_NO_MARGIN = Interactive::NO_MARGIN;
21
- const PROPERTY_WIDTH_COLUMN_WIDTH = Interactive::COLUMN_WIDTH;
22
- const PROPERTY_HEIGHT = 'interactive.height';
23
- const PROPERTY_WIDTH = 'interactive.width';
24
-
25
  public function getContextClass()
26
  {
27
  return Paragraph::getClassName();
28
  }
29
-
30
- public static function create()
31
- {
32
- return new InteractiveInsideParagraphRule();
33
- }
34
-
35
- public static function createFrom($configuration)
36
- {
37
- $interactive_rule = self::create();
38
- $interactive_rule->withSelector($configuration['selector']);
39
-
40
- $interactive_rule->withProperties(
41
- [
42
- self::PROPERTY_IFRAME,
43
- self::PROPERTY_URL,
44
- self::PROPERTY_WIDTH_NO_MARGIN,
45
- self::PROPERTY_WIDTH_COLUMN_WIDTH,
46
- self::PROPERTY_WIDTH,
47
- self::PROPERTY_HEIGHT
48
- ],
49
- $configuration
50
- );
51
-
52
- return $interactive_rule;
53
- }
54
-
55
- public function apply($transformer, $context, $node)
56
- {
57
- $interactive = Interactive::create();
58
-
59
- // Builds the interactive
60
- $iframe = $this->getProperty(self::PROPERTY_IFRAME, $node);
61
- $url = $this->getProperty(self::PROPERTY_URL, $node);
62
- if ($iframe) {
63
- $interactive->withHTML($iframe);
64
- }
65
- if ($url) {
66
- $interactive->withSource($url);
67
- }
68
-
69
- if ($this->getProperty(self::PROPERTY_WIDTH_COLUMN_WIDTH, $node)) {
70
- $interactive->withMargin(Interactive::COLUMN_WIDTH);
71
- } else {
72
- $interactive->withMargin(Interactive::NO_MARGIN);
73
- }
74
-
75
- $width = $this->getProperty(self::PROPERTY_WIDTH, $node);
76
- if ($width) {
77
- $interactive->withWidth($width);
78
- }
79
-
80
- $height = $this->getProperty(self::PROPERTY_HEIGHT, $node);
81
- if ($height) {
82
- $interactive->withHeight($height);
83
- }
84
-
85
-
86
- if ($iframe || $url) {
87
- $instant_article = $transformer->getInstantArticle();
88
- if ($instant_article) {
89
- $instant_article->addChild($interactive);
90
- $context->disableEmptyValidation();
91
- $context = Paragraph::create();
92
- $context->disableEmptyValidation();
93
- $instant_article->addChild($context);
94
- } else {
95
- $transformer->addWarning(
96
- // This new error message should be something like:
97
- // Could not transform Interactive, as no root InstantArticle was provided.
98
- new NoRootInstantArticleFoundWarning(null, $node)
99
- );
100
- }
101
- } else {
102
- $transformer->addWarning(
103
- new InvalidSelector(
104
- self::PROPERTY_IFRAME,
105
- $instant_article,
106
- $node,
107
- $this
108
- )
109
- );
110
- }
111
-
112
- $suppress_warnings = $transformer->suppress_warnings;
113
- $transformer->suppress_warnings = true;
114
- $transformer->transform($interactive, $node);
115
- $transformer->suppress_warnings = $suppress_warnings;
116
-
117
- return $context;
118
- }
119
  }
8
  */
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
 
11
  use Facebook\InstantArticles\Elements\Paragraph;
 
 
12
 
13
+ /**
14
+ * @deprecated InteractiveRule now works inside Paragraph without a custom rule, use it instead
15
+ */
16
+ class InteractiveInsideParagraphRule extends InteractiveRule
17
  {
 
 
 
 
 
 
 
18
  public function getContextClass()
19
  {
20
  return Paragraph::getClassName();
21
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InteractiveRule.php CHANGED
@@ -9,8 +9,10 @@
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
 
15
  class InteractiveRule extends ConfigurationSelectorRule
16
  {
@@ -23,17 +25,21 @@ class InteractiveRule extends ConfigurationSelectorRule
23
 
24
  public function getContextClass()
25
  {
26
- return InstantArticle::getClassName();
 
 
 
 
27
  }
28
 
29
  public static function create()
30
  {
31
- return new InteractiveRule();
32
  }
33
 
34
  public static function createFrom($configuration)
35
  {
36
- $interactive_rule = self::create();
37
  $interactive_rule->withSelector($configuration['selector']);
38
 
39
  $interactive_rule->withProperties(
@@ -51,10 +57,26 @@ class InteractiveRule extends ConfigurationSelectorRule
51
  return $interactive_rule;
52
  }
53
 
54
- public function apply($transformer, $instant_article, $node)
55
  {
56
  $interactive = Interactive::create();
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  // Builds the interactive
59
  $iframe = $this->getProperty(self::PROPERTY_IFRAME, $node);
60
  $url = $this->getProperty(self::PROPERTY_URL, $node);
@@ -66,6 +88,9 @@ class InteractiveRule extends ConfigurationSelectorRule
66
  }
67
  if ($iframe || $url) {
68
  $instant_article->addChild($interactive);
 
 
 
69
  } else {
70
  $transformer->addWarning(
71
  new InvalidSelector(
@@ -98,6 +123,6 @@ class InteractiveRule extends ConfigurationSelectorRule
98
  $transformer->transform($interactive, $node);
99
  $transformer->suppress_warnings = $suppress_warnings;
100
 
101
- return $instant_article;
102
  }
103
  }
9
  namespace Facebook\InstantArticles\Transformer\Rules;
10
 
11
  use Facebook\InstantArticles\Elements\Interactive;
12
+ use Facebook\InstantArticles\Elements\Paragraph;
13
  use Facebook\InstantArticles\Elements\InstantArticle;
14
  use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
15
+ use Facebook\InstantArticles\Validators\Type;
16
 
17
  class InteractiveRule extends ConfigurationSelectorRule
18
  {
25
 
26
  public function getContextClass()
27
  {
28
+ return
29
+ [
30
+ InstantArticle::getClassName(),
31
+ Paragraph::getClassName()
32
+ ];
33
  }
34
 
35
  public static function create()
36
  {
37
+ return new static();
38
  }
39
 
40
  public static function createFrom($configuration)
41
  {
42
+ $interactive_rule = static::create();
43
  $interactive_rule->withSelector($configuration['selector']);
44
 
45
  $interactive_rule->withProperties(
57
  return $interactive_rule;
58
  }
59
 
60
+ public function apply($transformer, $context, $node)
61
  {
62
  $interactive = Interactive::create();
63
 
64
+ if (Type::is($context, InstantArticle::getClassName())) {
65
+ $instant_article = $context;
66
+ } elseif ($transformer->getInstantArticle()) {
67
+ $instant_article = $transformer->getInstantArticle();
68
+ $context->disableEmptyValidation();
69
+ $context = Paragraph::create();
70
+ $context->disableEmptyValidation();
71
+ } else {
72
+ $transformer->addWarning(
73
+ // This new error message should be something like:
74
+ // Could not transform Image, as no root InstantArticle was provided.
75
+ new NoRootInstantArticleFoundWarning(null, $node)
76
+ );
77
+ return $context;
78
+ }
79
+
80
  // Builds the interactive
81
  $iframe = $this->getProperty(self::PROPERTY_IFRAME, $node);
82
  $url = $this->getProperty(self::PROPERTY_URL, $node);
88
  }
89
  if ($iframe || $url) {
90
  $instant_article->addChild($interactive);
91
+ if ($instant_article !== $context) {
92
+ $instant_article->addChild($context);
93
+ }
94
  } else {
95
  $transformer->addWarning(
96
  new InvalidSelector(
123
  $transformer->transform($interactive, $node);
124
  $transformer->suppress_warnings = $suppress_warnings;
125
 
126
+ return $context;
127
  }
128
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/RelatedArticlesRule.php CHANGED
@@ -42,12 +42,11 @@ class RelatedArticlesRule extends ConfigurationSelectorRule
42
  {
43
  $related_articles = RelatedArticles::create();
44
 
45
- // Builds the image
46
  $title = $this->getProperty(self::PROPERTY_TITLE, $node);
47
  if ($title) {
48
  $related_articles->withTitle($title);
49
- $instant_article->addChild($related_articles);
50
  }
 
51
 
52
  $transformer->transform($related_articles, $node);
53
 
42
  {
43
  $related_articles = RelatedArticles::create();
44
 
 
45
  $title = $this->getProperty(self::PROPERTY_TITLE, $node);
46
  if ($title) {
47
  $related_articles->withTitle($title);
 
48
  }
49
+ $instant_article->addChild($related_articles);
50
 
51
  $transformer->transform($related_articles, $node);
52
 
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/TimeRule.php CHANGED
@@ -14,7 +14,8 @@ use Facebook\InstantArticles\Transformer\Warnings\InvalidSelector;
14
 
15
  class TimeRule extends ConfigurationSelectorRule
16
  {
17
- const PROPERTY_TIME_TYPE = 'article.time_type';
 
18
  const PROPERTY_TIME = 'article.time';
19
 
20
  private $type = Time::PUBLISHED;
@@ -34,13 +35,17 @@ class TimeRule extends ConfigurationSelectorRule
34
  $time_rule = self::create();
35
  $time_rule->withSelector($configuration['selector']);
36
 
37
- $time_rule->withProperty(
38
- self::PROPERTY_TIME,
39
- self::retrieveProperty($configuration, self::PROPERTY_TIME)
 
 
 
40
  );
41
 
42
- if (isset($configuration[self::PROPERTY_TIME_TYPE])) {
43
- $time_rule->type = $configuration[self::PROPERTY_TIME_TYPE];
 
44
  }
45
 
46
  return $time_rule;
@@ -48,6 +53,11 @@ class TimeRule extends ConfigurationSelectorRule
48
 
49
  public function apply($transformer, $header, $node)
50
  {
 
 
 
 
 
51
  // Builds the image
52
  $time_string = $this->getProperty(self::PROPERTY_TIME, $node);
53
  if ($time_string) {
@@ -65,6 +75,8 @@ class TimeRule extends ConfigurationSelectorRule
65
  );
66
  }
67
 
 
 
68
  return $header;
69
  }
70
  }
14
 
15
  class TimeRule extends ConfigurationSelectorRule
16
  {
17
+ const PROPERTY_TIME_TYPE_DEPRECATED = 'article.time_type';
18
+ const PROPERTY_DATETIME_TYPE = 'article.datetype';
19
  const PROPERTY_TIME = 'article.time';
20
 
21
  private $type = Time::PUBLISHED;
35
  $time_rule = self::create();
36
  $time_rule->withSelector($configuration['selector']);
37
 
38
+ $time_rule->withProperties(
39
+ [
40
+ self::PROPERTY_TIME,
41
+ self::PROPERTY_DATETIME_TYPE
42
+ ],
43
+ $configuration
44
  );
45
 
46
+ // Just for retrocompatibility - issue #172
47
+ if (isset($configuration[self::PROPERTY_TIME_TYPE_DEPRECATED])) {
48
+ $time_rule->type = $configuration[self::PROPERTY_TIME_TYPE_DEPRECATED];
49
  }
50
 
51
  return $time_rule;
53
 
54
  public function apply($transformer, $header, $node)
55
  {
56
+ $time_type = $this->getProperty(self::PROPERTY_DATETIME_TYPE, $node);
57
+ if ($time_type) {
58
+ $this->type = $time_type;
59
+ }
60
+
61
  // Builds the image
62
  $time_string = $this->getProperty(self::PROPERTY_TIME, $node);
63
  if ($time_string) {
75
  );
76
  }
77
 
78
+
79
+
80
  return $header;
81
  }
82
  }
vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Validators/Type.php CHANGED
@@ -412,4 +412,33 @@ class Type
412
  // stringify the $object parameter
413
  return var_export($object, true);
414
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  }
412
  // stringify the $object parameter
413
  return var_export($object, true);
414
  }
415
+
416
+ /**
417
+ * Checks if tag is a DOMElement and also to have the $tagName informed.
418
+ * @param $tag DOMElement the tag element that will be validated
419
+ * @param $tagName string Tag name to be validated
420
+ * @return boolean true if it is Element and from same tagName.
421
+ * @throws InvalidArgumentException in case $tag is not DOMElement.
422
+ */
423
+ public static function isElementTag($tag, $tagName)
424
+ {
425
+ $element = new \DOMElement('dummy'); // This is just for retro-compatibility for 5.4 ::class placeholder
426
+ self::enforce($tag, get_class($element));
427
+ return $tag->tagName === $tagName;
428
+ }
429
+
430
+ /**
431
+ * Enforces tag to be an DOMElement and also to have the $tagName informed.
432
+ * @param $tag DOMElement the tag element that will be validated
433
+ * @param $tagName string Tag name to be validated
434
+ * @throws InvalidArgumentException in case $tag is not DOMElement or same tagName.
435
+ */
436
+ public static function enforceElementTag($tag, $tagName)
437
+ {
438
+ if (!self::isElementTag($tag, $tagName)) {
439
+ throw new \InvalidArgumentException(
440
+ "Tag <".$tagName."> expected, <".$tag->tagName."> informed."
441
+ );
442
+ }
443
+ }
444
  }
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Client/ClientTest.php CHANGED
@@ -108,6 +108,54 @@ class ClientTest extends \PHPUnit_Framework_TestCase
108
  $this->assertEquals($expectedSubmissionStatusID, $resultSubmissionStatusID);
109
  }
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  /**
112
  * Tests removing an article from an Instant Articles library.
113
  *
108
  $this->assertEquals($expectedSubmissionStatusID, $resultSubmissionStatusID);
109
  }
110
 
111
+ /**
112
+ * Tests that a re-scrape is performed when requested at article import.
113
+ */
114
+ public function testImportArticleRescrape()
115
+ {
116
+ $expectedSubmissionStatusID = 1;
117
+
118
+ $serverResponseMock =
119
+ $this->getMockBuilder('Facebook\FacebookResponse')
120
+ ->disableOriginalConstructor()
121
+ ->getMock();
122
+ $graphNodeMock =
123
+ $this->getMockBuilder('Facebook\GraphNodes\GraphNode')
124
+ ->disableOriginalConstructor()
125
+ ->getMock();
126
+ $serverResponseMock
127
+ ->expects($this->once())
128
+ ->method('getGraphNode')
129
+ ->willReturn($graphNodeMock);
130
+ $graphNodeMock
131
+ ->expects($this->once())
132
+ ->method('getField')
133
+ ->with('id')
134
+ ->willReturn($expectedSubmissionStatusID);
135
+
136
+ $this->facebook
137
+ ->expects($this->at(0))
138
+ ->method('post')
139
+ ->with('PAGE_ID' . Client::EDGE_NAME, [
140
+ 'html_source' => $this->article->render(),
141
+ 'published' => true,
142
+ 'development_mode' => false,
143
+ ])
144
+ ->willReturn($serverResponseMock);
145
+
146
+ $this->facebook
147
+ ->expects($this->at(1))
148
+ ->method('post')
149
+ ->with('/', [
150
+ 'id' => $this->article->getCanonicalURL(),
151
+ 'scrape' => 'true',
152
+ ])
153
+ ->willReturn($serverResponseMock);
154
+
155
+ $resultSubmissionStatusID = $this->client->importArticle($this->article, true, true);
156
+ $this->assertEquals($expectedSubmissionStatusID, $resultSubmissionStatusID);
157
+ }
158
+
159
  /**
160
  * Tests removing an article from an Instant Articles library.
161
  *
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Client/HelperTest.php CHANGED
@@ -54,7 +54,7 @@ class HelperTest extends \PHPUnit_Framework_TestCase
54
  $this->facebook
55
  ->expects($this->once())
56
  ->method('get')
57
- ->with('/me/accounts?fields=name,id,access_token,supports_instant_articles,picture')
58
  ->willReturn($response);
59
 
60
  $pagesAndTokensReturned = $this->helper->getPagesAndTokens($accessToken);
54
  $this->facebook
55
  ->expects($this->once())
56
  ->method('get')
57
+ ->with('/me/accounts?fields=name,id,access_token,supports_instant_articles,picture&offset=0')
58
  ->willReturn($response);
59
 
60
  $pagesAndTokensReturned = $this->helper->getPagesAndTokens($accessToken);
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/CaptionTest.php CHANGED
@@ -85,7 +85,7 @@ class CaptionTest extends \PHPUnit_Framework_TestCase
85
  $this->assertEquals($expected, $rendered);
86
  }
87
 
88
- public function testRenderWithFontSize()
89
  {
90
  $caption =
91
  Caption::create()
@@ -101,6 +101,22 @@ class CaptionTest extends \PHPUnit_Framework_TestCase
101
  $this->assertEquals($expected, $rendered);
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  public function testRenderWithTextAlignment()
105
  {
106
  $caption =
85
  $this->assertEquals($expected, $rendered);
86
  }
87
 
88
+ public function testRenderWithLargeFontSize()
89
  {
90
  $caption =
91
  Caption::create()
101
  $this->assertEquals($expected, $rendered);
102
  }
103
 
104
+ public function testRenderWithSmallFontSize()
105
+ {
106
+ $caption =
107
+ Caption::create()
108
+ ->appendText('Small Caption Title')
109
+ ->withFontsize(Caption::SIZE_SMALL);
110
+
111
+ $expected =
112
+ '<figcaption class="op-small">'.
113
+ 'Small Caption Title'.
114
+ '</figcaption>';
115
+
116
+ $rendered = $caption->render();
117
+ $this->assertEquals($expected, $rendered);
118
+ }
119
+
120
  public function testRenderWithTextAlignment()
121
  {
122
  $caption =
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/FooterTest.php CHANGED
@@ -106,6 +106,31 @@ class FooterTest extends \PHPUnit_Framework_TestCase
106
  $this->assertEquals($expected, $rendered);
107
  }
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  public function testRenderWithRelatedArticles()
110
  {
111
  $footer =
106
  $this->assertEquals($expected, $rendered);
107
  }
108
 
109
+ public function testRenderWithCopyrightSmallElement()
110
+ {
111
+ $small =
112
+ Small::create()
113
+ ->appendText("2016 ")
114
+ ->appendText(
115
+ Anchor::create()
116
+ ->withHRef('https://facebook.com')
117
+ ->appendText('Facebook')
118
+ );
119
+ $footer =
120
+ Footer::create()
121
+ ->withCopyright($small);
122
+
123
+ $expected =
124
+ '<footer>'.
125
+ '<small>'.
126
+ '2016 <a href="https://facebook.com">Facebook</a>'.
127
+ '</small>'.
128
+ '</footer>';
129
+
130
+ $rendered = $footer->render();
131
+ $this->assertEquals($expected, $rendered);
132
+ }
133
+
134
  public function testRenderWithRelatedArticles()
135
  {
136
  $footer =
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/H1Test.php CHANGED
@@ -223,4 +223,22 @@ class H1Test extends \PHPUnit_Framework_TestCase
223
  $rendered = $h1->render();
224
  $this->assertEquals($expected, $rendered);
225
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  }
223
  $rendered = $h1->render();
224
  $this->assertEquals($expected, $rendered);
225
  }
226
+
227
+ public function testGetPlainText()
228
+ {
229
+ $h1 =
230
+ H1::create()
231
+ ->appendText(Bold::create()->appendText('Some'))
232
+ ->appendText(' text to be ')
233
+ ->appendText(Italic::create()->appendText('within'))
234
+ ->appendText(' a ')
235
+ ->appendText(Italic::create()->appendText('paragraph'))
236
+ ->appendText(' for ')
237
+ ->appendText(Bold::create()->appendText('testing.'));
238
+
239
+ $expected = 'Some text to be within a paragraph for testing.';
240
+
241
+ $rendered = $h1->getPlainText();
242
+ $this->assertEquals($expected, $rendered);
243
+ }
244
  }
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/InstantArticleTest.php CHANGED
@@ -414,4 +414,296 @@ class InstantArticleTest extends \PHPUnit_Framework_TestCase
414
  {
415
  $this->assertInstanceOf('Facebook\InstantArticles\Elements\InstantArticleInterface', $this->article);
416
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
  }
414
  {
415
  $this->assertInstanceOf('Facebook\InstantArticles\Elements\InstantArticleInterface', $this->article);
416
  }
417
+
418
+ public function testIsRTLEnabled()
419
+ {
420
+ $article =
421
+ InstantArticle::create()
422
+ ->withCanonicalURL('http://wp.localtest.me/2016/04/12/stress-on-earth/')
423
+ ->enableAutomaticAdPlacement()
424
+ ->enableRTL()
425
+ ->withHeader(
426
+ Header::create()
427
+ ->withTitle(
428
+ H1::create()->appendText('Peace on <b>earth</b>')
429
+ )
430
+ ->addAuthor(
431
+ Author::create()->withName('bill')
432
+ )
433
+ ->withPublishTime(
434
+ Time::create(Time::PUBLISHED)
435
+ ->withDatetime(
436
+ \DateTime::createFromFormat(
437
+ 'j-M-Y G:i:s',
438
+ '14-Aug-1984 19:30:00'
439
+ )
440
+ )
441
+ )
442
+ )
443
+ ->addChild(
444
+ Paragraph::create()
445
+ ->appendText('Yes, peace is good for everybody!')
446
+ ->appendText(LineBreak::create())
447
+ ->appendText(' Man kind.')
448
+ );
449
+ $result = $article->render();
450
+ $expected =
451
+ '<!doctype html>'.
452
+ '<html dir="rtl">'.
453
+ '<head>'.
454
+ '<link rel="canonical" href="http://wp.localtest.me/2016/04/12/stress-on-earth/"/>'.
455
+ '<meta charset="utf-8"/>'.
456
+ '<meta property="op:generator" content="facebook-instant-articles-sdk-php"/>'.
457
+ '<meta property="op:generator:version" content="'.InstantArticle::CURRENT_VERSION.'"/>'.
458
+ '<meta property="op:markup_version" content="v1.0"/>'.
459
+ '</head>'.
460
+ '<body>'.
461
+ '<article>'.
462
+ '<header>'.
463
+ '<h1>Peace on &lt;b&gt;earth&lt;/b&gt;</h1>'.
464
+ '<time class="op-published" datetime="1984-08-14T19:30:00+00:00">August 14th, 7:30pm</time>'.
465
+ '<address>'.
466
+ '<a>bill</a>'.
467
+ '</address>'.
468
+ '</header>'.
469
+ '<p>Yes, peace is good for everybody!<br/> Man kind.</p>'.
470
+ '</article>'.
471
+ '</body>'.
472
+ '</html>';
473
+
474
+ $this->assertEquals($expected, $result);
475
+ }
476
+
477
+ public function testGetFirstParagraph()
478
+ {
479
+ $article =
480
+ InstantArticle::create()
481
+ ->withCanonicalURL('http://wp.localtest.me/2016/04/12/stress-on-earth/')
482
+ ->enableAutomaticAdPlacement()
483
+ ->enableRTL()
484
+ ->withHeader(
485
+ Header::create()
486
+ ->withTitle(
487
+ H1::create()->appendText('Peace on <b>earth</b>')
488
+ )
489
+ ->addAuthor(
490
+ Author::create()->withName('bill')
491
+ )
492
+ ->withPublishTime(
493
+ Time::create(Time::PUBLISHED)
494
+ ->withDatetime(
495
+ \DateTime::createFromFormat(
496
+ 'j-M-Y G:i:s',
497
+ '14-Aug-1984 19:30:00'
498
+ )
499
+ )
500
+ )
501
+ )
502
+ ->addChild(
503
+ Paragraph::create()
504
+ ->appendText('Yes, peace is good for everybody!')
505
+ ->appendText(LineBreak::create())
506
+ ->appendText(' Man kind.')
507
+ );
508
+ $result = $article->getFirstParagraph()->render();
509
+ $expected = '<p>Yes, peace is good for everybody!<br/> Man kind.</p>';
510
+
511
+ $this->assertEquals($expected, $result);
512
+ }
513
+
514
+ public function testGetEmptyFirstParagraph()
515
+ {
516
+ $article =
517
+ InstantArticle::create();
518
+ $result = $article->getFirstParagraph()->render();
519
+ $expected = '';
520
+
521
+ $this->assertEquals($expected, $result);
522
+ }
523
+
524
+ public function testDeleteChildren()
525
+ {
526
+ $article =
527
+ InstantArticle::create()
528
+ ->withCanonicalURL('http://www.facebook-IA-test.com/category/test')
529
+ ->enableAutomaticAdPlacement()
530
+ ->withHeader(
531
+ Header::create()
532
+ ->withTitle(
533
+ H1::create()->appendText('A good test')
534
+ )
535
+ ->addAuthor(
536
+ Author::create()->withName('Dan')
537
+ )
538
+ ->withPublishTime(
539
+ Time::create(Time::PUBLISHED)
540
+ ->withDatetime(
541
+ \DateTime::createFromFormat(
542
+ 'j-M-Y G:i:s',
543
+ '09-Jan-2016 20:30:00'
544
+ )
545
+ )
546
+ )
547
+ )
548
+ ->addChild(
549
+ Paragraph::create()
550
+ ->appendText('Just testing a deletion.')
551
+ )
552
+ ->addChild(
553
+ Paragraph::create()
554
+ ->appendText('This should not render afterwards.')
555
+ );
556
+ $article->deleteChild(1);
557
+ $result = $article->render();
558
+
559
+ $expected =
560
+ '<!doctype html>'.
561
+ '<html>'.
562
+ '<head>'.
563
+ '<link rel="canonical" href="http://www.facebook-IA-test.com/category/test"/>'.
564
+ '<meta charset="utf-8"/>'.
565
+ '<meta property="op:generator" content="facebook-instant-articles-sdk-php"/>'.
566
+ '<meta property="op:generator:version" content="'.InstantArticle::CURRENT_VERSION.'"/>'.
567
+ '<meta property="op:markup_version" content="v1.0"/>'.
568
+ '</head>'.
569
+ '<body>'.
570
+ '<article>'.
571
+ '<header>'.
572
+ '<h1>A good test</h1>'.
573
+ '<time class="op-published" datetime="2016-01-09T20:30:00+00:00">January 9th, 8:30pm</time>'.
574
+ '<address>'.
575
+ '<a>Dan</a>'.
576
+ '</address>'.
577
+ '</header>'.
578
+ '<p>Just testing a deletion.</p>'.
579
+ '</article>'.
580
+ '</body>'.
581
+ '</html>';
582
+
583
+ $this->assertEquals($expected, $result);
584
+ }
585
+
586
+ public function testDeleteOnlyChild()
587
+ {
588
+ $article =
589
+ InstantArticle::create()
590
+ ->withCanonicalURL('http://www.facebook-IA-test.com/category/test')
591
+ ->enableAutomaticAdPlacement()
592
+ ->withHeader(
593
+ Header::create()
594
+ ->withTitle(
595
+ H1::create()->appendText('A good test')
596
+ )
597
+ ->addAuthor(
598
+ Author::create()->withName('Dan')
599
+ )
600
+ ->withPublishTime(
601
+ Time::create(Time::PUBLISHED)
602
+ ->withDatetime(
603
+ \DateTime::createFromFormat(
604
+ 'j-M-Y G:i:s',
605
+ '09-Jan-2016 20:30:00'
606
+ )
607
+ )
608
+ )
609
+ )
610
+ ->addChild(
611
+ Paragraph::create()
612
+ ->appendText('Single paragraph to delete.')
613
+ );
614
+ $article->deleteChild(0);
615
+ $result = $article->render();
616
+
617
+ $expected =
618
+ '<!doctype html>'.
619
+ '<html>'.
620
+ '<head>'.
621
+ '<link rel="canonical" href="http://www.facebook-IA-test.com/category/test"/>'.
622
+ '<meta charset="utf-8"/>'.
623
+ '<meta property="op:generator" content="facebook-instant-articles-sdk-php"/>'.
624
+ '<meta property="op:generator:version" content="'.InstantArticle::CURRENT_VERSION.'"/>'.
625
+ '<meta property="op:markup_version" content="v1.0"/>'.
626
+ '</head>'.
627
+ '<body>'.
628
+ '<article>'.
629
+ '<header>'.
630
+ '<h1>A good test</h1>'.
631
+ '<time class="op-published" datetime="2016-01-09T20:30:00+00:00">January 9th, 8:30pm</time>'.
632
+ '<address>'.
633
+ '<a>Dan</a>'.
634
+ '</address>'.
635
+ '</header>'.
636
+ '</article>'.
637
+ '</body>'.
638
+ '</html>';
639
+
640
+ $this->assertEquals($expected, $result);
641
+ }
642
+
643
+ public function testReplaceChildren()
644
+ {
645
+ $article =
646
+ InstantArticle::create()
647
+ ->withCanonicalURL('http://www.facebook-IA-test.com/category/test')
648
+ ->enableAutomaticAdPlacement()
649
+ ->withHeader(
650
+ Header::create()
651
+ ->withTitle(
652
+ H1::create()->appendText('A replacing test')
653
+ )
654
+ ->addAuthor(
655
+ Author::create()->withName('Dan')
656
+ )
657
+ ->withPublishTime(
658
+ Time::create(Time::PUBLISHED)
659
+ ->withDatetime(
660
+ \DateTime::createFromFormat(
661
+ 'j-M-Y G:i:s',
662
+ '09-Jan-2016 20:30:00'
663
+ )
664
+ )
665
+ )
666
+ )
667
+ ->addChild(
668
+ Paragraph::create()
669
+ ->appendText('Ye olde body')
670
+ );
671
+
672
+ $newBody = array(
673
+ Paragraph::create()
674
+ ->appendText('The new body.'),
675
+ Paragraph::create()
676
+ ->appendText('With two paragraphs!')
677
+ );
678
+
679
+ $article->withChildren($newBody);
680
+ $result = $article->render();
681
+
682
+ $expected =
683
+ '<!doctype html>'.
684
+ '<html>'.
685
+ '<head>'.
686
+ '<link rel="canonical" href="http://www.facebook-IA-test.com/category/test"/>'.
687
+ '<meta charset="utf-8"/>'.
688
+ '<meta property="op:generator" content="facebook-instant-articles-sdk-php"/>'.
689
+ '<meta property="op:generator:version" content="'.InstantArticle::CURRENT_VERSION.'"/>'.
690
+ '<meta property="op:markup_version" content="v1.0"/>'.
691
+ '</head>'.
692
+ '<body>'.
693
+ '<article>'.
694
+ '<header>'.
695
+ '<h1>A replacing test</h1>'.
696
+ '<time class="op-published" datetime="2016-01-09T20:30:00+00:00">January 9th, 8:30pm</time>'.
697
+ '<address>'.
698
+ '<a>Dan</a>'.
699
+ '</address>'.
700
+ '</header>'.
701
+ '<p>The new body.</p>'.
702
+ '<p>With two paragraphs!</p>'.
703
+ '</article>'.
704
+ '</body>'.
705
+ '</html>';
706
+
707
+ $this->assertEquals($expected, $result);
708
+ }
709
  }
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Elements/Validators/TypeTest.php CHANGED
@@ -350,4 +350,29 @@ class TypeTest extends \PHPUnit_Framework_TestCase
350
  $this->assertTrue(Type::isTextEmpty("&nbsp;"));
351
  $this->assertTrue(Type::isTextEmpty("\n"));
352
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  }
350
  $this->assertTrue(Type::isTextEmpty("&nbsp;"));
351
  $this->assertTrue(Type::isTextEmpty("\n"));
352
  }
353
+
354
+ public function testEnforceElementTag()
355
+ {
356
+ $document = new \DOMDocument();
357
+ Type::enforceElementTag($document->createElement('img'), 'img');
358
+ }
359
+
360
+ public function testEnforceElementTagFalse()
361
+ {
362
+ $document = new \DOMDocument();
363
+ $this->setExpectedException('InvalidArgumentException');
364
+ Type::enforceElementTag($document->createElement('body'), 'img');
365
+ }
366
+
367
+ public function testIsElementTag()
368
+ {
369
+ $document = new \DOMDocument();
370
+ $this->assertTrue(Type::isElementTag($document->createElement('img'), 'img'));
371
+ }
372
+
373
+ public function testIsElementTagFalse()
374
+ {
375
+ $document = new \DOMDocument();
376
+ $this->assertFalse(Type::isElementTag($document->createElement('body'), 'img'));
377
+ }
378
  }
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Parser/instant-article-example.html CHANGED
@@ -7,6 +7,7 @@
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>
12
  <article>
@@ -182,7 +183,10 @@
182
  <p>Some plaintext credits to<a href="http://facebook.com/author" rel="facebook">Author</a></p>
183
  <p>Paragraph text as credits</p>
184
  </aside>
185
- <ul class="op-related-articles" title="The related ones in the footer">
 
 
 
186
  <li>
187
  <a href="http://example.com/article.html"></a>
188
  </li>
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
+ <meta property="fb:article_style" content="wod-gray"/>
11
  </head>
12
  <body>
13
  <article>
183
  <p>Some plaintext credits to<a href="http://facebook.com/author" rel="facebook">Author</a></p>
184
  <p>Paragraph text as credits</p>
185
  </aside>
186
+ <small>
187
+ Copyright <a href="http://example.com">with link</a> and <b>inline style</b>
188
+ </small>
189
+ <ul class="op-related-articles">
190
  <li>
191
  <a href="http://example.com/article.html"></a>
192
  </li>
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/CustomHTMLTransformerTest.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (c) 2016-present, Facebook, Inc.
4
+ * All rights reserved.
5
+ *
6
+ * This source code is licensed under the license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ namespace Facebook\InstantArticles\Transformer\CMS;
10
+
11
+ use Facebook\InstantArticles\Transformer\Transformer;
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
+
17
+ class CustomHTMLTransformerTest extends \PHPUnit_Framework_TestCase
18
+ {
19
+ protected function setUp()
20
+ {
21
+ \Logger::configure(
22
+ [
23
+ 'rootLogger' => [
24
+ 'appenders' => ['facebook-instantarticles-transformer']
25
+ ],
26
+ 'appenders' => [
27
+ 'facebook-instantarticles-transformer' => [
28
+ 'class' => 'LoggerAppenderConsole',
29
+ 'threshold' => 'INFO',
30
+ 'layout' => [
31
+ 'class' => 'LoggerLayoutSimple'
32
+ ]
33
+ ]
34
+ ]
35
+ ]
36
+ );
37
+ }
38
+
39
+ public function testTransformerCustomHTML()
40
+ {
41
+ $json_file = file_get_contents(__DIR__ . '/custom-html-rules.json');
42
+
43
+ $instant_article = InstantArticle::create();
44
+ $transformer = new Transformer();
45
+ $transformer->loadRules($json_file);
46
+
47
+ $html_file = file_get_contents(__DIR__ . '/custom.html');
48
+
49
+ libxml_use_internal_errors(true);
50
+ $document = new \DOMDocument();
51
+ $document->loadHTML($html_file);
52
+ libxml_use_internal_errors(false);
53
+
54
+ $instant_article
55
+ ->withCanonicalURL('http://localhost/article')
56
+ ->withHeader(
57
+ Header::create()
58
+ ->withTitle('Peace on <b>earth</b>')
59
+ ->addAuthor(Author::create()->withName('bill'))
60
+ ->withPublishTime(Time::create(Time::PUBLISHED)->withDatetime(
61
+ \DateTime::createFromFormat(
62
+ 'j-M-Y G:i:s',
63
+ '12-Apr-2016 19:46:51'
64
+ )
65
+ ))
66
+ );
67
+
68
+ $transformer->transform($instant_article, $document);
69
+ $instant_article->addMetaProperty('op:generator:version', '1.0.0');
70
+ $instant_article->addMetaProperty('op:generator:transformer:version', '1.0.0');
71
+ $result = $instant_article->render('', true)."\n";
72
+ $expected = file_get_contents(__DIR__ . '/custom-html-ia.xml');
73
+
74
+ $this->assertEquals($expected, $result);
75
+ // there must be 3 warnings related to <img> inside <li> that is not supported by IA
76
+ $this->assertEquals(3, count($transformer->getWarnings()));
77
+ }
78
+ }
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Example/simple-ia.html CHANGED
@@ -36,6 +36,31 @@
36
  <h1>Custom code for your social embed</h1>
37
  <script>alert("test & more test");</script></iframe>
38
  </figure>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  </article>
40
  </body>
41
  </html>
36
  <h1>Custom code for your social embed</h1>
37
  <script>alert("test & more test");</script></iframe>
38
  </figure>
39
+ <figure>
40
+ <img src="http://domain.com/image-header.png"/>
41
+ <figcaption>Some amazing moment captured by Photographer</figcaption>
42
+ </figure>
43
+ <figure>
44
+ <img src="http://domain.com/image-header.png?suffix=yes"/>
45
+ <figcaption>Some amazing moment captured by Photographer</figcaption>
46
+ </figure>
47
+ <figure>
48
+ <img src="http://domain.com/image-header.png?suffix=yes"/>
49
+ <figcaption>Some amazing moment captured by Photographer</figcaption>
50
+ </figure>
51
+ <footer>
52
+ <ul class="op-related-articles">
53
+ <li>
54
+ <a href="http://example.com/article.html"></a>
55
+ </li>
56
+ <li data-sponsored="true">
57
+ <a href="http://example.com/sponsored-article.html"></a>
58
+ </li>
59
+ <li>
60
+ <a href="http://example.com/another-article.html"></a>
61
+ </li>
62
+ </ul>
63
+ </footer>
64
  </article>
65
  </body>
66
  </html>
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Example/simple-rules.json CHANGED
@@ -84,6 +84,55 @@
84
  }
85
  }
86
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  {
88
  "class": "HeaderImageRule",
89
  "selector" : "div.hero-image",
@@ -108,6 +157,42 @@
108
  "selector" : "*"
109
  }
110
  }
111
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  ]
113
  }
84
  }
85
  }
86
  },
87
+ {
88
+ "class": "ImageRule",
89
+ "selector" : "div.prefix",
90
+ "properties" : {
91
+ "image.url" : {
92
+ "type" : "string",
93
+ "selector" : "img",
94
+ "attribute": "src",
95
+ "prefix": "http:"
96
+ },
97
+ "image.caption" : {
98
+ "type" : "element",
99
+ "selector" : "div.image-caption"
100
+ }
101
+ }
102
+ },
103
+ {
104
+ "class": "ImageRule",
105
+ "selector" : "div.suffix",
106
+ "properties" : {
107
+ "image.url" : {
108
+ "type" : "string",
109
+ "selector" : "img",
110
+ "attribute": "src",
111
+ "suffix": "?suffix=yes"
112
+ },
113
+ "image.caption" : {
114
+ "type" : "element",
115
+ "selector" : "div.image-caption"
116
+ }
117
+ }
118
+ },
119
+ {
120
+ "class": "ImageRule",
121
+ "selector" : "div.prefixsuffix",
122
+ "properties" : {
123
+ "image.url" : {
124
+ "type" : "string",
125
+ "selector" : "img",
126
+ "attribute": "src",
127
+ "prefix" : "http:",
128
+ "suffix": "?suffix=yes"
129
+ },
130
+ "image.caption" : {
131
+ "type" : "element",
132
+ "selector" : "div.image-caption"
133
+ }
134
+ }
135
+ },
136
  {
137
  "class": "HeaderImageRule",
138
  "selector" : "div.hero-image",
157
  "selector" : "*"
158
  }
159
  }
160
+ },
161
+
162
+ {
163
+ "class" : "FooterRule",
164
+ "selector" : "footer"
165
+ },
166
+ {
167
+ "class" : "RelatedArticlesRule",
168
+ "selector" : "ul.op-related-articles",
169
+ "properties" : {
170
+ "related.title" : {
171
+ "type" : "exists",
172
+ "selector" : "ul.op-related-articles",
173
+ "attribute" : "title"
174
+ }
175
+ }
176
+ },
177
+ {
178
+ "class" : "FooterRelatedArticlesRule",
179
+ "selector" : "ul.op-related-articles"
180
+ },
181
+ {
182
+ "class" : "RelatedItemRule",
183
+ "selector" : "li",
184
+ "properties" : {
185
+ "related.sponsored" : {
186
+ "type" : "exists",
187
+ "selector" : "li",
188
+ "attribute": "data-sponsored"
189
+ },
190
+ "related.url" : {
191
+ "type" : "string",
192
+ "selector" : "a",
193
+ "attribute" : "href"
194
+ }
195
+ }
196
+ }
197
  ]
198
  }
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/Example/simple.html CHANGED
@@ -25,5 +25,30 @@
25
  <h1>Custom code for your social embed</h1>
26
  <script>alert("test & more test");</script>
27
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  </body>
29
  </html>
25
  <h1>Custom code for your social embed</h1>
26
  <script>alert("test & more test");</script>
27
  </div>
28
+ <div class="prefix">
29
+ <img src="//domain.com/image-header.png" />
30
+ <div class="image-caption">Some amazing moment captured by Photographer</div>
31
+ </div>
32
+ <div class="suffix">
33
+ <img src="http://domain.com/image-header.png" />
34
+ <div class="image-caption">Some amazing moment captured by Photographer</div>
35
+ </div>
36
+ <div class="prefixsuffix">
37
+ <img src="//domain.com/image-header.png" />
38
+ <div class="image-caption">Some amazing moment captured by Photographer</div>
39
+ </div>
40
+ <footer>
41
+ <ul class="op-related-articles">
42
+ <li>
43
+ <a href="http://example.com/article.html"></a>
44
+ </li>
45
+ <li data-sponsored="true">
46
+ <a href="http://example.com/sponsored-article.html"></a>
47
+ </li>
48
+ <li>
49
+ <a href="http://example.com/another-article.html"></a>
50
+ </li>
51
+ </ul>
52
+ </footer>
53
  </body>
54
  </html>
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/custom-html-ia.xml ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <link rel="canonical" href="http://localhost/article"/>
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>
12
+ <article>
13
+ <header>
14
+ <h1>Peace on &lt;b&gt;earth&lt;/b&gt;</h1>
15
+ <time class="op-published" datetime="2016-04-12T19:46:51+00:00">April 12th, 7:46pm</time>
16
+ <address><a>bill</a></address>
17
+ </header>
18
+ <p>Yes, peace is good for everybody!<br/>
19
+ Man kind.</p>
20
+ <figure>
21
+ <img src="http://example.com/image0.jpg"/>
22
+ </figure>
23
+ <p>Some text after img.</p>
24
+ <p>Some text before img</p>
25
+ <figure>
26
+ <img src="http://example.com/image1.jpg"/>
27
+ </figure>
28
+ <p>Some text before img</p>
29
+ <figure>
30
+ <img src="http://example.com/image2.jpg"/>
31
+ </figure>
32
+ <p> and some after img.</p>
33
+ <figure class="op-interactive">
34
+ <iframe src="http://example.com/0/" class="no-margin" width="300" height="200"></iframe>
35
+ </figure>
36
+ <p>Some text before iframe</p>
37
+ <figure class="op-interactive">
38
+ <iframe src="http://example.com/1/" class="no-margin" width="300" height="200"></iframe>
39
+ </figure>
40
+ <figure class="op-interactive">
41
+ <iframe src="http://example.com/2/" class="no-margin" width="300" height="200"></iframe>
42
+ </figure>
43
+ <p> some after iframe.</p>
44
+ <p>Some text before iframe</p>
45
+ <figure class="op-interactive">
46
+ <iframe src="http://example.com/3/" class="no-margin" width="300" height="200"></iframe>
47
+ </figure>
48
+ <p> and some after iframe.</p>
49
+ <figure class="op-interactive">
50
+ <iframe src="http://example.com/loose/with_url" class="no-margin" width="300" height="200"></iframe>
51
+ </figure>
52
+ <figure class="op-interactive">
53
+ <iframe class="no-margin">
54
+ <div>
55
+ <h1>Iframe loose without url</h1>
56
+ </div>
57
+ </iframe>
58
+ </figure>
59
+ <figure class="op-interactive">
60
+ <iframe class="no-margin">
61
+ <div>
62
+ <h1>some embed here</h1>
63
+ </div>
64
+ </iframe>
65
+ </figure>
66
+ <figure class="op-interactive">
67
+ <iframe class="no-margin">
68
+ <div>
69
+ <h1>some embed here</h1>
70
+ </div>
71
+ </iframe>
72
+ </figure>
73
+ <figure class="op-interactive">
74
+ <iframe class="no-margin">
75
+ <div>some content</div>
76
+ <script>alert('hi & hello to you @ testing!');</script></iframe>
77
+ </figure>
78
+ <figure class="op-interactive">
79
+ <iframe src="http://example.com/4/" class="no-margin" width="300" height="200"></iframe>
80
+ </figure>
81
+ <figure class="op-interactive">
82
+ <iframe class="no-margin">
83
+ <div>some content</div>
84
+ <script>alert('hi & hello to you @ testing!');</script></iframe>
85
+ </figure>
86
+ <figure class="op-interactive">
87
+ <iframe src="http://example.com/4/" class="no-margin" width="300" height="200"></iframe>
88
+ </figure>
89
+ <figure class="op-interactive">
90
+ <iframe class="no-margin">
91
+ <div>some content</div>
92
+ <script>alert('hi & hello to you @ testing!');</script></iframe>
93
+ </figure>
94
+ <figure class="op-interactive">
95
+ <iframe class="no-margin" height="200">
96
+ <table width="200" height="200">
97
+ <thead><td>header 1</td>
98
+ <td>header 2</td>
99
+ </thead>
100
+ <tbody>
101
+ <tr><td>Line 1 column 1</td>
102
+ <td>Line 1 column 2</td>
103
+ </tr>
104
+ <tr><td>Line 2 column 1</td>
105
+ <td>Line 2 column 2</td>
106
+ </tr>
107
+ </tbody>
108
+ </table>
109
+ </iframe>
110
+ </figure>
111
+ <ul>
112
+ <li>Some text on li before img</li>
113
+ <li>Some text on li before imgand after img</li>
114
+ <li>Some text after img</li>
115
+ </ul>
116
+ <figure class="op-slideshow">
117
+ <figure>
118
+ <img src="http://example.com/img0.jpg"/>
119
+ </figure>
120
+ <figure>
121
+ <img src="http://example.com/img1.jpg"/>
122
+ </figure>
123
+ <figure>
124
+ <img src="http://example.com/img2.jpg"/>
125
+ <figcaption>Image 2</figcaption>
126
+ </figure>
127
+ <figure>
128
+ <img src="http://example.com/img3.jpg"/>
129
+ <figcaption>Image 3</figcaption>
130
+ </figure>
131
+ <figure>
132
+ <img src="http://example.com/img4.jpg"/>
133
+ </figure>
134
+ </figure>
135
+ <figure class="op-slideshow">
136
+ <figure>
137
+ <img src="http://example.com/img1.jpg"/>
138
+ <figcaption> Image 1 </figcaption>
139
+ </figure>
140
+ <figure>
141
+ <img src="http://example.com/img2.jpg"/>
142
+ <figcaption> Image 2 </figcaption>
143
+ </figure>
144
+ <figure>
145
+ <img src="http://example.com/img3.jpg"/>
146
+ <figcaption> Image 3 </figcaption>
147
+ </figure>
148
+ </figure>
149
+ <figure class="op-interactive">
150
+ <iframe class="no-margin">
151
+ <blockquote class="instagram-media" data-instgrm-captioned="" data-instgrm-version="6" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);">
152
+ <div style="padding:8px;">
153
+ <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:62.5% 0; text-align:center; width:100%;">
154
+ <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nqgdz/TvBbBnr6GBReqn/nRmDgaQEej7WhonozjF+Y2I/fZou/qAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;"></div>
155
+ </div>
156
+ <p style=" margin:8px 0 0 0; padding:0 4px;">
157
+ <a href="https://www.instagram.com/p/BAXbKP1POQe/" style=" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;" target="_blank">📸 @natthaponwuttipetch</a>
158
+ </p>
159
+ <p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;">
160
+ A photo posted by Ann Hathairat Vidhyaphum (@annvidh) on <time style=" font-family:Arial,sans-serif; font-size:14px; line-height:17px;" datetime="2016-01-10T16:56:06+00:00">Jan 10, 2016 at 8:56am PST</time></p>
161
+ </div>
162
+ </blockquote>
163
+ <script async="" defer="defer" src="//platform.instagram.com/en_US/embeds.js"></script>
164
+ </iframe>
165
+ </figure>
166
+ <figure>
167
+ <img src="http://example.com/img.jpg"/>
168
+ <figcaption>blue eyes</figcaption>
169
+ </figure>
170
+ <figure class="op-interactive">
171
+ <iframe class="no-margin">
172
+ <h1>Sibling content</h1>
173
+ <div>sibling body</div><script src="//sibling.com/brother.js"></script></iframe>
174
+ </figure>
175
+ <p>Standard paragraph that <b>shouldn't</b> lie within the interactive block.</p>
176
+ <figure class="op-interactive">
177
+ <iframe class="no-margin">
178
+ <p>Extra markup</p>
179
+ <div class="fb-post" data-href="https://www.facebook.com/some-page/posts/some-post"></div>
180
+ </iframe>
181
+ </figure>
182
+ <figure class="op-slideshow">
183
+ <figure>
184
+ <img src="http://example.com/konservnye-banki-osobenno-lyubyat-yaponcy-810x471.jpg"/>
185
+ <figcaption>Caption Img 1</figcaption>
186
+ </figure>
187
+ <figure>
188
+ <img src="http://example.com/a-vot-chto-vnutri.jpg"/>
189
+ <figcaption>Alternative text </figcaption>
190
+ </figure>
191
+ <figure>
192
+ <img src="http://example.com/brelok-s-bezopasnostyu-vsegda-s-soboj.jpg"/>
193
+ <figcaption>Caption img 3</figcaption>
194
+ </figure>
195
+ </figure>
196
+ <figure>
197
+ <img src="http://example.com/image.jpg"/>
198
+ <figcaption>caption</figcaption>
199
+ </figure>
200
+ </article>
201
+ </body>
202
+ </html>
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/custom-html-rules.json ADDED
@@ -0,0 +1,606 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "rules":
3
+ [{
4
+ "class": "TextNodeRule"
5
+ }, {
6
+ "class": "PassThroughRule",
7
+ "selector": "html"
8
+ }, {
9
+ "class": "PassThroughRule",
10
+ "selector": "head"
11
+ }, {
12
+ "class": "PassThroughRule",
13
+ "selector": "body"
14
+ }, {
15
+ "class": "PassThroughRule",
16
+ "selector" : "code"
17
+ },{
18
+ "class": "PassThroughRule",
19
+ "selector" : "del"
20
+ },{
21
+ "class": "PassThroughRule",
22
+ "selector" : "mark"
23
+ }, {
24
+ "class": "PassThroughRule",
25
+ "selector" : "span"
26
+ }, {
27
+ "class": "ParagraphRule",
28
+ "selector": "p"
29
+ }, {
30
+ "class": "LineBreakRule",
31
+ "selector": "br"
32
+ }, {
33
+ "class": "AnchorRule",
34
+ "selector": "a",
35
+ "properties": {
36
+ "anchor.href": {
37
+ "type": "string",
38
+ "selector": "a",
39
+ "attribute": "href"
40
+ },
41
+ "anchor.rel": {
42
+ "type": "string",
43
+ "selector": "a",
44
+ "attribute": "rel"
45
+ }
46
+ }
47
+ }, {
48
+ "class": "BoldRule",
49
+ "selector": "b"
50
+ }, {
51
+ "class": "BoldRule",
52
+ "selector": "strong"
53
+ }, {
54
+ "class": "ItalicRule",
55
+ "selector": "i"
56
+ }, {
57
+ "class": "ItalicRule",
58
+ "selector": "em"
59
+ }, {
60
+ "class": "BlockquoteRule",
61
+ "selector": "blockquote"
62
+ }, {
63
+ "class": "PassThroughRule",
64
+ "selector": "blockquote p"
65
+ }, {
66
+ "class": "ImageInsideParagraphRule",
67
+ "selector": "img",
68
+ "properties": {
69
+ "image.url": {
70
+ "type": "string",
71
+ "selector": "img",
72
+ "attribute": "src"
73
+ }
74
+ }
75
+ },{
76
+ "class": "ImageRule",
77
+ "selector": "img",
78
+ "properties": {
79
+ "image.url": {
80
+ "type": "string",
81
+ "selector": "img",
82
+ "attribute": "src"
83
+ }
84
+ }
85
+ }, {
86
+ "class": "ListItemRule",
87
+ "selector" : "li"
88
+ }, {
89
+ "class": "ListElementRule",
90
+ "selector" : "ul"
91
+ }, {
92
+ "class": "ListElementRule",
93
+ "selector" : "ol"
94
+ }, {
95
+ "class": "BlockquoteRule",
96
+ "selector" : "blockquote"
97
+ }, {
98
+ "class": "H1Rule",
99
+ "selector" : "h1",
100
+ "properties" : {
101
+ "h1.class" : {
102
+ "type" : "string",
103
+ "selector" : "link",
104
+ "attribute": "class"
105
+ }
106
+ }
107
+ }, {
108
+ "class": "H1Rule",
109
+ "selector" : "title"
110
+ }, {
111
+ "class": "H2Rule",
112
+ "selector" : "h2",
113
+ "properties" : {
114
+ "h2.class" : {
115
+ "type" : "string",
116
+ "selector" : "link",
117
+ "attribute": "class"
118
+ }
119
+ }
120
+ }, {
121
+ "class": "H2Rule",
122
+ "selector" : "h3,h4,h5,h6"
123
+ }, {
124
+ "class": "InteractiveRule",
125
+ "selector" : "blockquote.instagram-media",
126
+ "properties" : {
127
+ "interactive.iframe" : {
128
+ "type" : "multiple",
129
+ "children": [
130
+ {
131
+ "type": "element",
132
+ "selector": "blockquote"
133
+ }, {
134
+ "type": "next-sibling-element-of",
135
+ "selector": "blockquote"
136
+ }
137
+ ]
138
+ }
139
+ }
140
+ }, {
141
+ "class": "InteractiveRule",
142
+ "selector" : "iframe",
143
+ "properties" : {
144
+ "interactive.url" : {
145
+ "type" : "string",
146
+ "selector" : "iframe",
147
+ "attribute": "src"
148
+ },
149
+ "interactive.width" : {
150
+ "type" : "int",
151
+ "selector" : "iframe",
152
+ "attribute": "width"
153
+ },
154
+ "interactive.height" : {
155
+ "type" : "int",
156
+ "selector" : "iframe",
157
+ "attribute": "height"
158
+ },
159
+ "interactive.iframe" : {
160
+ "type" : "children",
161
+ "selector" : "iframe"
162
+ }
163
+ }
164
+ }, {
165
+ "class": "InteractiveRule",
166
+ "selector" : "div.embed",
167
+ "properties" : {
168
+ "interactive.iframe" : {
169
+ "type" : "children",
170
+ "selector" : "div.embed"
171
+ },
172
+ "interactive.height" : {
173
+ "type" : "int",
174
+ "selector" : "iframe",
175
+ "attribute": "height"
176
+ },
177
+ "interactive.width" : {
178
+ "type" : "int",
179
+ "selector" : "iframe",
180
+ "attribute": "width"
181
+ }
182
+ }
183
+ }, {
184
+ "class": "InteractiveRule",
185
+ "selector" : "div.interactive",
186
+ "properties" : {
187
+ "interactive.iframe" : {
188
+ "type" : "children",
189
+ "selector" : "div.interactive"
190
+ },
191
+ "interactive.height" : {
192
+ "type" : "int",
193
+ "selector" : "iframe",
194
+ "attribute": "height"
195
+ },
196
+ "interactive.width" : {
197
+ "type" : "int",
198
+ "selector" : "iframe",
199
+ "attribute": "width"
200
+ }
201
+ }
202
+ }, {
203
+ "class": "InteractiveRule",
204
+ "selector" : "//div[@class='embed' and iframe]",
205
+ "properties" : {
206
+ "interactive.url" : {
207
+ "type" : "string",
208
+ "selector" : "iframe",
209
+ "attribute": "src"
210
+ },
211
+ "interactive.iframe" : {
212
+ "type" : "children",
213
+ "selector" : "iframe",
214
+ "attribute": "src"
215
+ },
216
+ "interactive.width" : {
217
+ "type" : "int",
218
+ "selector" : "iframe",
219
+ "attribute": "width"
220
+ },
221
+ "interactive.height" : {
222
+ "type" : "int",
223
+ "selector" : "iframe",
224
+ "attribute": "height"
225
+ }
226
+ }
227
+ }, {
228
+ "class": "InteractiveRule",
229
+ "selector" : "//div[@class='interactive' and iframe]",
230
+ "properties" : {
231
+ "interactive.url" : {
232
+ "type" : "string",
233
+ "selector" : "iframe",
234
+ "attribute": "src"
235
+ },
236
+ "interactive.iframe" : {
237
+ "type" : "children",
238
+ "selector" : "iframe"
239
+ },
240
+ "interactive.height" : {
241
+ "type" : "int",
242
+ "selector" : "iframe",
243
+ "attribute": "height"
244
+ },
245
+ "interactive.width" : {
246
+ "type" : "int",
247
+ "selector" : "iframe",
248
+ "attribute": "width"
249
+ }
250
+ }
251
+ }, {
252
+ "class": "InteractiveRule",
253
+ "selector" : "table",
254
+ "properties" : {
255
+ "interactive.iframe" : {
256
+ "type" : "element",
257
+ "selector" : "table"
258
+ },
259
+ "interactive.height" : {
260
+ "type" : "int",
261
+ "selector" : "table",
262
+ "attribute": "height"
263
+ },
264
+ "interactive.width" : {
265
+ "type" : "int",
266
+ "selector" : "iframe",
267
+ "attribute": "width"
268
+ }
269
+ }
270
+ }, {
271
+ "class": "InteractiveRule",
272
+ "selector" : "div.fb-post",
273
+ "properties" : {
274
+ "interactive.iframe" : {
275
+ "type": "multiple",
276
+ "children": [
277
+ {
278
+ "type": "fragment",
279
+ "fragment": "<p>Extra markup</p>"
280
+ },
281
+ {
282
+ "type" : "element",
283
+ "selector" : "div.fb-post"
284
+ }
285
+ ]
286
+ }
287
+ }
288
+ }, {
289
+ "class": "InteractiveInsideParagraphRule",
290
+ "selector" : "iframe",
291
+ "properties" : {
292
+ "interactive.url" : {
293
+ "type" : "string",
294
+ "selector" : "iframe",
295
+ "attribute": "src"
296
+ },
297
+ "interactive.height" : {
298
+ "type" : "int",
299
+ "selector" : "iframe",
300
+ "attribute": "height"
301
+ },
302
+ "interactive.width" : {
303
+ "type" : "int",
304
+ "selector" : "iframe",
305
+ "attribute": "width"
306
+ }
307
+ }
308
+ },{
309
+ "class": "InteractiveInsideParagraphRule",
310
+ "selector" : "div.embed",
311
+ "properties" : {
312
+ "interactive.iframe" : {
313
+ "type" : "children",
314
+ "selector" : "div.embed"
315
+ },
316
+ "interactive.height" : {
317
+ "type" : "int",
318
+ "selector" : "iframe",
319
+ "attribute": "height"
320
+ },
321
+ "interactive.width" : {
322
+ "type" : "int",
323
+ "selector" : "iframe",
324
+ "attribute": "width"
325
+ }
326
+ }
327
+ }, {
328
+ "class": "InteractiveInsideParagraphRule",
329
+ "selector" : "div.interactive",
330
+ "properties" : {
331
+ "interactive.iframe" : {
332
+ "type" : "children",
333
+ "selector" : "div.interactive"
334
+ },
335
+ "interactive.height" : {
336
+ "type" : "int",
337
+ "selector" : "iframe",
338
+ "attribute": "height"
339
+ },
340
+ "interactive.width" : {
341
+ "type" : "int",
342
+ "selector" : "iframe",
343
+ "attribute": "width"
344
+ }
345
+ }
346
+ }, {
347
+ "class": "InteractiveInsideParagraphRule",
348
+ "selector" : "//div[@class='embed' and iframe]",
349
+ "properties" : {
350
+ "interactive.url" : {
351
+ "type" : "string",
352
+ "selector" : "iframe",
353
+ "attribute": "src"
354
+ },
355
+ "interactive.iframe" : {
356
+ "type" : "children",
357
+ "selector" : "iframe",
358
+ "attribute": "src"
359
+ },
360
+ "interactive.width" : {
361
+ "type" : "int",
362
+ "selector" : "iframe",
363
+ "attribute": "width"
364
+ },
365
+ "interactive.height" : {
366
+ "type" : "int",
367
+ "selector" : "iframe",
368
+ "attribute": "height"
369
+ }
370
+ }
371
+ }, {
372
+ "class": "InteractiveInsideParagraphRule",
373
+ "selector" : "//div[@class='interactive' and iframe]",
374
+ "properties" : {
375
+ "interactive.url" : {
376
+ "type" : "string",
377
+ "selector" : "iframe",
378
+ "attribute": "src"
379
+ },
380
+ "interactive.iframe" : {
381
+ "type" : "children",
382
+ "selector" : "iframe",
383
+ "attribute": "src"
384
+ },
385
+ "interactive.height" : {
386
+ "type" : "int",
387
+ "selector" : "iframe",
388
+ "attribute": "height"
389
+ },
390
+ "interactive.width" : {
391
+ "type" : "int",
392
+ "selector" : "iframe",
393
+ "attribute": "width"
394
+ }
395
+ }
396
+ }, {
397
+ "class": "InteractiveInsideParagraphRule",
398
+ "selector" : "table",
399
+ "properties" : {
400
+ "interactive.iframe" : {
401
+ "type" : "element",
402
+ "selector" : "table"
403
+ },
404
+ "interactive.height" : {
405
+ "type" : "int",
406
+ "selector" : "table",
407
+ "attribute": "height"
408
+ },
409
+ "interactive.width" : {
410
+ "type" : "int",
411
+ "selector" : "table",
412
+ "attribute": "width"
413
+ }
414
+ }
415
+ }, {
416
+ "class": "SlideshowImageRule",
417
+ "selector" : "figure",
418
+ "properties" : {
419
+ "image.url" : {
420
+ "type" : "string",
421
+ "selector" : "img",
422
+ "attribute": "src"
423
+ },
424
+ "caption.title" : {
425
+ "type" : "string",
426
+ "selector" : "figcaption"
427
+ }
428
+ }
429
+ }, {
430
+ "class": "SlideshowRule",
431
+ "selector" : "div.gallery"
432
+ }, {
433
+ "class": "CaptionRule",
434
+ "selector" : "figcaption"
435
+ }, {
436
+ "class": "CaptionRule",
437
+ "selector" : "p.wp-caption-text"
438
+ }, {
439
+ "class": "ImageRule",
440
+ "selector" : "figure",
441
+ "properties" : {
442
+ "image.url" : {
443
+ "type" : "string",
444
+ "selector" : "img",
445
+ "attribute": "src"
446
+ }
447
+ }
448
+ }, {
449
+ "class": "VideoRule",
450
+ "selector" : "div.wp-video",
451
+ "containsChild": "video",
452
+ "properties" : {
453
+ "video.url" : {
454
+ "type" : "string",
455
+ "selector" : "source",
456
+ "attribute": "src"
457
+ },
458
+ "video.type" : {
459
+ "type" : "string",
460
+ "selector" : "source",
461
+ "attribute": "type"
462
+ }
463
+ }
464
+ },
465
+
466
+
467
+
468
+ {
469
+ "class" : "IgnoreRule",
470
+ "selector" : "p.jetpack-slideshow-noscript"
471
+ },
472
+ {
473
+ "class": "CaptionRule",
474
+ "selector" : "div.wp-caption-text"
475
+ },
476
+ {
477
+ "class" : "PassThroughRule",
478
+ "selector" : "div.gallery-row"
479
+ },
480
+ {
481
+ "class" : "PassThroughRule",
482
+ "selector" : "div.tiled-gallery p"
483
+ },
484
+ {
485
+ "class" : "PassThroughRule",
486
+ "selector" : "div.gallery-row p"
487
+ },
488
+ {
489
+ "class" : "PassThroughRule",
490
+ "selector" : "div.gallery-group p"
491
+ },
492
+ {
493
+ "class" : "PassThroughRule",
494
+ "selector" : "div.gallery-group"
495
+ },
496
+ {
497
+ "class": "ImageRule",
498
+ "selector" : "div.wp-caption",
499
+ "properties" : {
500
+ "image.url" : {
501
+ "type" : "string",
502
+ "selector" : "img",
503
+ "attribute": "src"
504
+ }
505
+ }
506
+ },
507
+ {
508
+ "class": "SlideshowImageRule",
509
+ "selector" : "div.tiled-gallery-item",
510
+ "properties" : {
511
+ "image.url" : {
512
+ "type" : "string",
513
+ "selector" : "img",
514
+ "attribute": "data-orig-file"
515
+ },
516
+ "caption.title" : {
517
+ "type" : "string",
518
+ "selector" : "div.tiled-gallery-caption"
519
+ }
520
+ }
521
+ },
522
+ {
523
+ "class": "SlideshowRule",
524
+ "selector" : "div.tiled-gallery"
525
+ },
526
+ {
527
+ "class": "SlideshowRule",
528
+ "selector" : "div.tiled-gallery"
529
+ },
530
+ {
531
+ "class": "Compat\\JetpackSlideshowRule",
532
+ "selector" : "div.jetpack-slideshow",
533
+ "properties": {
534
+ "jetpack.data-gallery": {
535
+ "type": "json",
536
+ "selector": "div.jetpack-slideshow",
537
+ "attribute": "data-gallery"
538
+ }
539
+ }
540
+ },
541
+ {
542
+ "class": "CaptionRule",
543
+ "selector" : "div.tiled-gallery-caption"
544
+ },
545
+ {
546
+ "class" : "PassThroughRule",
547
+ "selector" : "div.vce-gallery-big"
548
+ },
549
+ {
550
+ "class" : "PassThroughRule",
551
+ "selector" : "div.vce-gallery-small"
552
+ },
553
+ {
554
+ "class" : "IgnoreRule",
555
+ "selector" : "div.vce-gallery-slider"
556
+ },
557
+ {
558
+ "class": "SlideshowImageRule",
559
+ "selector" : "div.big-gallery-item",
560
+ "properties" : {
561
+ "image.url" : {
562
+ "type" : "string",
563
+ "selector" : "img",
564
+ "attribute": "src"
565
+ },
566
+ "caption.title" : {
567
+ "type" : "string",
568
+ "selector" : "figcaption.wp-caption-text"
569
+ }
570
+ }
571
+ },
572
+
573
+
574
+ {
575
+ "class": "ImageInsideParagraphRule",
576
+ "selector": "figure.wp-caption",
577
+ "properties": {
578
+ "image.url": {
579
+ "type": "string",
580
+ "selector": "img",
581
+ "attribute": "src"
582
+ }
583
+ }
584
+ },
585
+
586
+ {
587
+ "class": "InteractiveRule",
588
+ "selector" : "iframe.sibling",
589
+ "properties" : {
590
+ "interactive.iframe" : {
591
+ "type" : "multiple",
592
+ "children": [
593
+ {
594
+ "type": "children",
595
+ "selector": "iframe"
596
+ }, {
597
+ "type": "next-sibling-element-of",
598
+ "selector": "iframe",
599
+ "sibling.selector": "script"
600
+ }
601
+ ]
602
+ }
603
+ }
604
+ }
605
+ ]
606
+ }
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/custom.html ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <body>
4
+ <p>Yes, peace is good for everybody!<br>
5
+ Man kind.</p>
6
+ <p><img src="http://example.com/image0.jpg" />Some text after img.</p>
7
+ <p>Some text before img<img src="http://example.com/image1.jpg" /></p>
8
+ <p>Some text before img<img src="http://example.com/image2.jpg" /> and some after img.</p>
9
+ <p><iframe width="300" height="200" src="http://example.com/0/"/></p>
10
+ <p>Some text before iframe<iframe width="300" height="200" src="http://example.com/1/"/></p>
11
+ <p><iframe width="300" height="200" src="http://example.com/2/"></iframe> some after iframe.</p>
12
+ <p>Some text before iframe<iframe width="300" height="200" src="http://example.com/3/"/> and some after iframe.</p>
13
+ <iframe width="300" height="200" src="http://example.com/loose/with_url"></iframe>
14
+ <iframe>
15
+ <div>
16
+ <h1>Iframe loose without url</h1>
17
+ </div>
18
+ </iframe>
19
+ <div class="embed">
20
+ <div>
21
+ <h1>some embed here</h1>
22
+ </div>
23
+ </div>
24
+ <div class="interactive">
25
+ <div>
26
+ <h1>some embed here</h1>
27
+ </div>
28
+ </div>
29
+ <div class="interactive">
30
+ <iframe>
31
+ <div>some content</div>
32
+ <script>alert('hi & hello to you @ testing!');</script>
33
+ </iframe>
34
+ </div>
35
+ <div class="interactive">
36
+ <iframe width="300" height="200" src="http://example.com/4/"></iframe>
37
+ </div>
38
+ <div class="interactive">
39
+ <iframe>
40
+ <div>some content</div>
41
+ <script>alert('hi & hello to you @ testing!');</script>
42
+ </iframe>
43
+ </div>
44
+ <div class="embed">
45
+ <iframe width="300" height="200" src="http://example.com/4/"></iframe>
46
+ </div>
47
+ <div class="embed">
48
+ <iframe>
49
+ <div>some content</div>
50
+ <script>alert('hi & hello to you @ testing!');</script>
51
+ </iframe>
52
+ </div>
53
+ <table width="200" height="200">
54
+ <thead>
55
+ <td>header 1</td>
56
+ <td>header 2</td>
57
+ </thead>
58
+ <tbody>
59
+ <tr>
60
+ <td>Line 1 column 1</td>
61
+ <td>Line 1 column 2</td>
62
+ </tr>
63
+ <tr>
64
+ <td>Line 2 column 1</td>
65
+ <td>Line 2 column 2</td>
66
+ </tr>
67
+ </tbody>
68
+ </table>
69
+ <ul>
70
+ <li>Some text on li before img<img src="http://example.com/image.jpg" width="600" height="360"/></li>
71
+ <li>Some text on li before img<img src="http://example.com/image.jpg" width="600" height="360"/>and after img</li>
72
+ <li><img src="http://example.com/image.jpg" width="600" height="360"/>Some text after img</li>
73
+ </ul>
74
+ <p class="jetpack-slideshow-noscript robots-nocontent">This slideshow requires JavaScript.</p>
75
+ <div
76
+ class="slideshow-window jetpack-slideshow slideshow-black"
77
+ data-trans="fade" data-autostart="1"
78
+ data-gallery="[{&quot;src&quot;:&quot;http:\/\/example.com/img0.jpg&quot;,&quot;id&quot;:&quot;434&quot;,&quot;title&quot;:&quot;img0&quot;,&quot;alt&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;itemprop&quot;:&quot;image&quot;},{&quot;src&quot;:&quot;http:\/\/example.com\/img1.jpg&quot;,&quot;id&quot;:&quot;474&quot;,&quot;title&quot;:&quot;img1&quot;,&quot;alt&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;itemprop&quot;:&quot;image&quot;},{&quot;src&quot;:&quot;http:\/\/example.com\/img2.jpg&quot;,&quot;id&quot;:&quot;470&quot;,&quot;title&quot;:&quot;img2&quot;,&quot;alt&quot;:&quot;&quot;,&quot;caption&quot;:&quot;Image 2&quot;,&quot;itemprop&quot;:&quot;image&quot;},{&quot;src&quot;:&quot;http:\/\/example.com\/img3.jpg&quot;,&quot;id&quot;:&quot;466&quot;,&quot;title&quot;:&quot;Image 3&quot;,&quot;alt&quot;:&quot;&quot;,&quot;caption&quot;:&quot;Image 3&quot;,&quot;itemprop&quot;:&quot;image&quot;},{&quot;src&quot;:&quot;http:\/\/example.com\/img4.jpg&quot;,&quot;id&quot;:&quot;462&quot;,&quot;title&quot;:&quot;img4&quot;,&quot;alt&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;itemprop&quot;:&quot;image&quot;}]"
79
+ itemscope itemtype="http://schema.org/ImageGallery">
80
+ </div>
81
+
82
+ <div class="tiled-gallery type-rectangular tiled-gallery-unresized" >
83
+ <div class="gallery-row">
84
+ <div class="gallery-group images-1">
85
+ <div class="tiled-gallery-item tiled-gallery-item-large">
86
+ <a href="http://www.diegoquinteiro.com/15-razoes-para-ser-contra-o-impeachment/forum/">
87
+ <meta itemprop="width" content="318">
88
+ <meta itemprop="height" content="211">
89
+ <img data-orig-file="http://example.com/img1.jpg"
90
+ data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Forum" data-image-description="" data-medium-file="http://http://example.com/img1.jpg" data-large-file="http://example.com/img1.jpg" src="http://example.com/img1.jpg?resize=318%2C211"
91
+ width="318" height="211" data-original-width="318" data-original-height="211" title="Forum" alt="riots" style="width: 318px; height: 211px;" />
92
+ </a>
93
+ <div class="tiled-gallery-caption" itemprop="caption description"> Image 1 </div>
94
+ </p>
95
+ </div>
96
+ </p>
97
+ </div>
98
+ <p> <!-- close group -->
99
+ <div class="gallery-group images-2">
100
+ <div class="tiled-gallery-item tiled-gallery-item-small" itemprop="associatedMedia">
101
+ <a href="http://example.com/link" border="0" itemprop="url">
102
+ <meta itemprop="width" content="174">
103
+ <meta itemprop="height" content="109">
104
+ <img data-attachment-id="519" data-orig-file="http://example.com/img2.jpg" data-orig-size="2078,1310" data-comments-opened="" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Chaplin &#8211; Fábrica" data-image-description="" data-medium-file="http://example.com/img2.jpg" data-large-file="http://example.com/img2.jpg" src="http://example.com/img2.jpg?resize=174%2C109" width="174" height="109" data-original-width="174" data-original-height="109" itemprop="http://schema.org/image" title="Image Title" alt="chaplin" style="width: 174px; height: 109px;" />
105
+ </a>
106
+ <div class="tiled-gallery-caption" itemprop="caption description"> Image 2 </div>
107
+ </p>
108
+ </div>
109
+ <div class="tiled-gallery-item tiled-gallery-item-small" itemprop="associatedMedia">
110
+ <a href="http://example.com/link" border="0" itemprop="url">
111
+ <meta itemprop="width" content="174">
112
+ <meta itemprop="height" content="98">
113
+ <img data-attachment-id="532" data-orig-file="http://example.com/img3.jpg" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="highlight image" data-image-description="" data-medium-file="http://www.diegoquinteiro.com/wp-content/uploads/2016/06/highlight-image-300x169.jpg" data-large-file="http://www.diegoquinteiro.com/wp-content/uploads/2016/06/highlight-image-1024x576.jpg" src="http://i1.wp.com/www.diegoquinteiro.com/wp-content/uploads/2016/06/highlight-image.jpg?resize=174%2C98" width="174" height="98" data-original-width="174" data-original-height="98" itemprop="http://schema.org/image" title="highlight image" alt="Dog cat" style="width: 174px; height: 98px;" />
114
+ </a>
115
+ <div class="tiled-gallery-caption" itemprop="caption description"> Image 3 </div>
116
+ </p>
117
+ </div>
118
+ </p>
119
+ </div>
120
+ <p> <!-- close group -->
121
+ </div>
122
+ <p> <!-- close row -->
123
+ </div>
124
+ <blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="6" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);">
125
+ <div style="padding:8px;">
126
+ <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:62.5% 0; text-align:center; width:100%;">
127
+ <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nqgdz/TvBbBnr6GBReqn/nRmDgaQEej7WhonozjF+Y2I/fZou/qAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;"></div>
128
+ </div>
129
+ <p style=" margin:8px 0 0 0; padding:0 4px;">
130
+ <a href="https://www.instagram.com/p/BAXbKP1POQe/" style=" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;" target="_blank">📸 @natthaponwuttipetch</a>
131
+ </p>
132
+ <p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;">
133
+ A photo posted by Ann Hathairat Vidhyaphum (@annvidh) on <time style=" font-family:Arial,sans-serif; font-size:14px; line-height:17px;" datetime="2016-01-10T16:56:06+00:00">Jan 10, 2016 at 8:56am PST</time>
134
+ </p>
135
+ </div>
136
+ </blockquote>
137
+ <script async defer src="//platform.instagram.com/en_US/embeds.js"></script>
138
+ <p>
139
+ <figure style="width: 1280px" class="wp-caption alignnone">
140
+ <img src="http://example.com/img.jpg" width="1280" height="740" class />
141
+ <br />
142
+ <figcaption class="wp-caption-text">blue eyes</figcaption>
143
+ </figure>
144
+ </p>
145
+ <iframe class="sibling">
146
+ <h1>Sibling content</h1>
147
+ <div>sibling body</div></iframe>
148
+ <script src="//sibling.com/brother.js"></script>
149
+ <p>Standard paragraph that <b>shouldn't</b> lie within the interactive block.</p>
150
+ <div class="fb-post" data-href="https://www.facebook.com/some-page/posts/some-post"></div>
151
+
152
+ <div id="gallery-3" class="vce-gallery gallery galleryid-15219 gallery-columns-3 gallery-size-vce-lay-b">
153
+ <div class="vce-gallery-big">
154
+ <div class="big-gallery-item item-0">
155
+ <div class="gallery-icon">
156
+ <a href="http://example.com/konservnye-banki-osobenno-lyubyat-yaponcy.jpg"><img width="810" height="471" src="http://example.com/konservnye-banki-osobenno-lyubyat-yaponcy-810x471.jpg" class="attachment-vce-lay-a size-vce-lay-a" alt="Caption Img 1" srcset="http://example.com/konservnye-banki-osobenno-lyubyat-yaponcy-810x471.jpg 810w, http://example.com/konservnye-banki-osobenno-lyubyat-yaponcy-300x174.jpg 300w, http://example.com/konservnye-banki-osobenno-lyubyat-yaponcy-768x447.jpg 768w, http://example.com/konservnye-banki-osobenno-lyubyat-yaponcy.jpg 860w" sizes="(max-width: 810px) 100vw, 810px"></a>
157
+ </div>
158
+ <figcaption class="wp-caption-text gallery-caption">Caption Img 1</figcaption>
159
+ </div>
160
+ <div class="big-gallery-item item-1" style="display:none;">
161
+ <div class="gallery-icon">
162
+ <a href="http://example.com/a-vot-chto-vnutri.jpg">
163
+ <img width="699" height="443" src="http://example.com/a-vot-chto-vnutri.jpg" class="attachment-vce-lay-a size-vce-lay-a" alt="Alternative text" srcset="http://example.com/a-vot-chto-vnutri.jpg 699w, http://example.com/a-vot-chto-vnutri-300x190.jpg 300w" sizes="(max-width: 699px) 100vw, 699px">
164
+ </a>
165
+ </div>
166
+ <figcaption class="wp-caption-text gallery-caption">Alternative text </figcaption>
167
+ </div>
168
+ <div class="big-gallery-item item-2" style="display:none;">
169
+ <div class="gallery-icon">
170
+ <a href="http://example.com/brelok-s-bezopasnostyu-vsegda-s-soboj.jpg">
171
+ <img width="700" height="467" src="http://example.com/brelok-s-bezopasnostyu-vsegda-s-soboj.jpg" class="attachment-vce-lay-a size-vce-lay-a" alt="Caption img 3" srcset="http://example.com/brelok-s-bezopasnostyu-vsegda-s-soboj.jpg 700w, http://example.com/brelok-s-bezopasnostyu-vsegda-s-soboj-300x200.jpg 300w" sizes="(max-width: 700px) 100vw, 700px">
172
+ </a>
173
+ </div>
174
+ <figcaption class="wp-caption-text gallery-caption">Caption img 3</figcaption>
175
+ </div>
176
+ </div>
177
+ <div class="vce-gallery-slider owl-carousel owl-theme owl-loaded owl-text-select-on" data-columns="3">
178
+ <div class="owl-stage-outer">
179
+ <div class="owl-stage" style="transform: translate3d(-761px, 0px, 0px); transition: 0s; width: 3551.34px;">
180
+ <div class="owl-item active" style="width: 252.667px; margin-right: 1px;">
181
+ <figure class="gallery-item" data-item="0">
182
+ <div class="gallery-icon landscape">
183
+ <a href="http://example.com/konservnye-banki-osobenno-lyubyat-yaponcy.jpg"><img width="375" height="195" src="http://example.com/konservnye-banki-osobenno-lyubyat-yaponcy-375x195.jpg" class="attachment-vce-lay-b size-vce-lay-b" alt="Caption Img 1"></a>
184
+ </div>
185
+ </figure>
186
+ </div>
187
+ <div class="owl-item active" style="width: 252.667px; margin-right: 1px;">
188
+ <figure class="gallery-item" data-item="1">
189
+ <div class="gallery-icon landscape">
190
+ <a href="http://example.com/a-vot-chto-vnutri.jpg"><img width="375" height="195" src="http://example.com/a-vot-chto-vnutri-375x195.jpg" class="attachment-vce-lay-b size-vce-lay-b" alt="Alternative text"></a>
191
+ </div>
192
+ </figure>
193
+ </div>
194
+ <div class="owl-item active" style="width: 252.667px; margin-right: 1px;">
195
+ <figure class="gallery-item" data-item="2">
196
+ <div class="gallery-icon landscape">
197
+ <a href="http://example.com/brelok-s-bezopasnostyu-vsegda-s-soboj.jpg"><img width="375" height="195" src="http://example.com/brelok-s-bezopasnostyu-vsegda-s-soboj-375x195.jpg" class="attachment-vce-lay-b size-vce-lay-b" alt="Caption img 3"></a>
198
+ </div>
199
+ </figure>
200
+ </div>
201
+ </div>
202
+ </div>
203
+ <div class="owl-controls">
204
+ <div class="owl-nav">
205
+ <div class="owl-prev" style=""><i class="fa fa-angle-left"></i></div>
206
+ <div class="owl-next" style=""><i class="fa fa-angle-right"></i></div>
207
+ </div>
208
+ <div class="owl-dots" style="">
209
+ <div class="owl-dot active"><span></span></div>
210
+ <div class="owl-dot"><span></span></div>
211
+ <div class="owl-dot"><span></span></div>
212
+ </div>
213
+ </div>
214
+ </div>
215
+ </div>
216
+ <div id="attachment_22553" style="width: 800px" class="wp-caption alignnone">
217
+ <img class="wp-image-22553 size-large" src="http://example.com/image.jpg" alt="alt text" width="800" height="552" srcset="http://example.com/image-800.jpg 800w, http://example.com/image-400.jpg 400w, http://example.com/image-768.jpg 768w" sizes="(max-width: 800px) 100vw, 800px" />
218
+ <p class="wp-caption-text">caption</p>
219
+ </div>
220
+ </body>
221
+ </html>
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/instant-article-example-multibyte.html CHANGED
@@ -187,7 +187,7 @@
187
  <p><a href="http://facebook.com/author" rel="facebook">著者</a>へのクレジット情報</p>
188
  <p>クレジットとしてのパラグラフ</p>
189
  </aside>
190
- <ul class="op-related-articles" title="The related ones in the footer">
191
  <li>
192
  <a href="http://example.com/article.html"></a>
193
  </li>
187
  <p><a href="http://facebook.com/author" rel="facebook">著者</a>へのクレジット情報</p>
188
  <p>クレジットとしてのパラグラフ</p>
189
  </aside>
190
+ <ul class="op-related-articles">
191
  <li>
192
  <a href="http://example.com/article.html"></a>
193
  </li>
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/instant-article-example-nonutf8.html CHANGED
@@ -187,7 +187,7 @@
187
  <p><a href="http://facebook.com/author" rel="facebook">����</a>�ؤΥ��쥸�åȾ���</p>
188
  <p>���쥸�åȤȤ��ƤΥѥ饰���</p>
189
  </aside>
190
- <ul class="op-related-articles" title="The related ones in the footer">
191
  <li>
192
  <a href="http://example.com/article.html"></a>
193
  </li>
187
  <p><a href="http://facebook.com/author" rel="facebook">����</a>�ؤΥ��쥸�åȾ���</p>
188
  <p>���쥸�åȤȤ��ƤΥѥ饰���</p>
189
  </aside>
190
+ <ul class="op-related-articles">
191
  <li>
192
  <a href="http://example.com/article.html"></a>
193
  </li>
vendor/facebook/facebook-instant-articles-sdk-php/tests/Facebook/InstantArticles/Transformer/instant-article-example.html CHANGED
@@ -187,7 +187,7 @@
187
  <p>Some plaintext credits to<a href="http://facebook.com/author" rel="facebook">Author</a></p>
188
  <p>Paragraph text as credits</p>
189
  </aside>
190
- <ul class="op-related-articles" title="The related ones in the footer">
191
  <li>
192
  <a href="http://example.com/article.html"></a>
193
  </li>
187
  <p>Some plaintext credits to<a href="http://facebook.com/author" rel="facebook">Author</a></p>
188
  <p>Paragraph text as credits</p>
189
  </aside>
190
+ <ul class="op-related-articles">
191
  <li>
192
  <a href="http://example.com/article.html"></a>
193
  </li>
vendor/facebook/graph-sdk/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2016 Facebook, Inc.
2
 
3
  You are hereby granted a non-exclusive, worldwide, royalty-free license to
4
  use, copy, modify, and distribute this software in source code or binary
1
+ Copyright 2017 Facebook, Inc.
2
 
3
  You are hereby granted a non-exclusive, worldwide, royalty-free license to
4
  use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Authentication/AccessToken.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Authentication/AccessTokenMetadata.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Authentication/OAuth2Client.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookAuthenticationException.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookAuthorizationException.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookClientException.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookOtherException.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookResumableUploadException.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookSDKException.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookServerException.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookThrottleException.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Facebook.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
@@ -53,12 +53,12 @@ class Facebook
53
  /**
54
  * @const string Version number of the Facebook PHP SDK.
55
  */
56
- const VERSION = '5.4.2';
57
 
58
  /**
59
  * @const string Default Graph API version for requests.
60
  */
61
- const DEFAULT_GRAPH_VERSION = 'v2.8';
62
 
63
  /**
64
  * @const string The name of the environment variable that contains the app ID.
@@ -494,6 +494,27 @@ class Facebook
494
  return $this->lastResponse = $this->client->sendBatchRequest($batchRequest);
495
  }
496
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
497
  /**
498
  * Instantiates a new FacebookRequest entity.
499
  *
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
53
  /**
54
  * @const string Version number of the Facebook PHP SDK.
55
  */
56
+ const VERSION = '5.5.0';
57
 
58
  /**
59
  * @const string Default Graph API version for requests.
60
  */
61
+ const DEFAULT_GRAPH_VERSION = 'v2.9';
62
 
63
  /**
64
  * @const string The name of the environment variable that contains the app ID.
494
  return $this->lastResponse = $this->client->sendBatchRequest($batchRequest);
495
  }
496
 
497
+ /**
498
+ * Instantiates an empty FacebookBatchRequest entity.
499
+ *
500
+ * @param AccessToken|string|null $accessToken The top-level access token. Requests with no access token
501
+ * will fallback to this.
502
+ * @param string|null $graphVersion The Graph API version to use.
503
+ * @return FacebookBatchRequest
504
+ */
505
+ public function newBatchRequest($accessToken = null, $graphVersion = null)
506
+ {
507
+ $accessToken = $accessToken ?: $this->defaultAccessToken;
508
+ $graphVersion = $graphVersion ?: $this->defaultGraphVersion;
509
+
510
+ return new FacebookBatchRequest(
511
+ $this->app,
512
+ [],
513
+ $accessToken,
514
+ $graphVersion
515
+ );
516
+ }
517
+
518
  /**
519
  * Instantiates a new FacebookRequest entity.
520
  *
vendor/facebook/graph-sdk/src/Facebook/FacebookApp.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/FacebookBatchRequest.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
@@ -62,16 +62,17 @@ class FacebookBatchRequest extends FacebookRequest implements IteratorAggregate,
62
  }
63
 
64
  /**
65
- * A a new request to the array.
66
  *
67
  * @param FacebookRequest|array $request
68
- * @param string|null $name
 
69
  *
70
  * @return FacebookBatchRequest
71
  *
72
  * @throws \InvalidArgumentException
73
  */
74
- public function add($request, $name = null)
75
  {
76
  if (is_array($request)) {
77
  foreach ($request as $key => $req) {
@@ -85,17 +86,28 @@ class FacebookBatchRequest extends FacebookRequest implements IteratorAggregate,
85
  throw new \InvalidArgumentException('Argument for add() must be of type array or FacebookRequest.');
86
  }
87
 
 
 
 
 
 
 
88
  $this->addFallbackDefaults($request);
 
 
 
 
 
 
 
 
89
  $requestToAdd = [
90
  'name' => $name,
91
  'request' => $request,
 
 
92
  ];
93
 
94
- // File uploads
95
- $attachedFiles = $this->extractFileAttachments($request);
96
- if ($attachedFiles) {
97
- $requestToAdd['attached_files'] = $attachedFiles;
98
- }
99
  $this->requests[] = $requestToAdd;
100
 
101
  return $this;
@@ -189,8 +201,15 @@ class FacebookBatchRequest extends FacebookRequest implements IteratorAggregate,
189
  {
190
  $requests = [];
191
  foreach ($this->requests as $request) {
192
- $attachedFiles = isset($request['attached_files']) ? $request['attached_files'] : null;
193
- $requests[] = $this->requestEntityToBatchArray($request['request'], $request['name'], $attachedFiles);
 
 
 
 
 
 
 
194
  }
195
 
196
  return json_encode($requests);
@@ -215,14 +234,22 @@ class FacebookBatchRequest extends FacebookRequest implements IteratorAggregate,
215
  /**
216
  * Converts a Request entity into an array that is batch-friendly.
217
  *
218
- * @param FacebookRequest $request The request entity to convert.
219
- * @param string|null $requestName The name of the request.
220
- * @param string|null $attachedFiles Names of files associated with the request.
 
221
  *
222
  * @return array
223
  */
224
- public function requestEntityToBatchArray(FacebookRequest $request, $requestName = null, $attachedFiles = null)
225
  {
 
 
 
 
 
 
 
226
  $compiledHeaders = [];
227
  $headers = $request->getHeaders();
228
  foreach ($headers as $name => $value) {
@@ -242,18 +269,12 @@ class FacebookBatchRequest extends FacebookRequest implements IteratorAggregate,
242
  $batch['body'] = $body;
243
  }
244
 
245
- if (isset($requestName)) {
246
- $batch['name'] = $requestName;
247
- }
248
 
249
- if (isset($attachedFiles)) {
250
  $batch['attached_files'] = $attachedFiles;
251
  }
252
 
253
- // @TODO Add support for "omit_response_on_success"
254
- // @TODO Add support for "depends_on"
255
- // @TODO Add support for JSONP with "callback"
256
-
257
  return $batch;
258
  }
259
 
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
62
  }
63
 
64
  /**
65
+ * Adds a new request to the array.
66
  *
67
  * @param FacebookRequest|array $request
68
+ * @param string|null|array $options Array of batch request options e.g. 'name', 'omit_response_on_success'.
69
+ * If a string is given, it is the value of the 'name' option.
70
  *
71
  * @return FacebookBatchRequest
72
  *
73
  * @throws \InvalidArgumentException
74
  */
75
+ public function add($request, $options = null)
76
  {
77
  if (is_array($request)) {
78
  foreach ($request as $key => $req) {
86
  throw new \InvalidArgumentException('Argument for add() must be of type array or FacebookRequest.');
87
  }
88
 
89
+ if (null === $options) {
90
+ $options = [];
91
+ } elseif (!is_array($options)) {
92
+ $options = ['name' => $options];
93
+ }
94
+
95
  $this->addFallbackDefaults($request);
96
+
97
+ // File uploads
98
+ $attachedFiles = $this->extractFileAttachments($request);
99
+
100
+ $name = isset($options['name']) ? $options['name'] : null;
101
+
102
+ unset($options['name']);
103
+
104
  $requestToAdd = [
105
  'name' => $name,
106
  'request' => $request,
107
+ 'options' => $options,
108
+ 'attached_files' => $attachedFiles,
109
  ];
110
 
 
 
 
 
 
111
  $this->requests[] = $requestToAdd;
112
 
113
  return $this;
201
  {
202
  $requests = [];
203
  foreach ($this->requests as $request) {
204
+ $options = [];
205
+
206
+ if (null !== $request['name']) {
207
+ $options['name'] = $request['name'];
208
+ }
209
+
210
+ $options += $request['options'];
211
+
212
+ $requests[] = $this->requestEntityToBatchArray($request['request'], $options, $request['attached_files']);
213
  }
214
 
215
  return json_encode($requests);
234
  /**
235
  * Converts a Request entity into an array that is batch-friendly.
236
  *
237
+ * @param FacebookRequest $request The request entity to convert.
238
+ * @param string|null|array $options Array of batch request options e.g. 'name', 'omit_response_on_success'.
239
+ * If a string is given, it is the value of the 'name' option.
240
+ * @param string|null $attachedFiles Names of files associated with the request.
241
  *
242
  * @return array
243
  */
244
+ public function requestEntityToBatchArray(FacebookRequest $request, $options = null, $attachedFiles = null)
245
  {
246
+
247
+ if (null === $options) {
248
+ $options = [];
249
+ } elseif (!is_array($options)) {
250
+ $options = ['name' => $options];
251
+ }
252
+
253
  $compiledHeaders = [];
254
  $headers = $request->getHeaders();
255
  foreach ($headers as $name => $value) {
269
  $batch['body'] = $body;
270
  }
271
 
272
+ $batch += $options;
 
 
273
 
274
+ if (null !== $attachedFiles) {
275
  $batch['attached_files'] = $attachedFiles;
276
  }
277
 
 
 
 
 
278
  return $batch;
279
  }
280
 
vendor/facebook/graph-sdk/src/Facebook/FacebookBatchResponse.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/FacebookClient.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/FacebookRequest.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
@@ -108,7 +108,7 @@ class FacebookRequest
108
  /**
109
  * Set the access token for this request.
110
  *
111
- * @param AccessToken|string
112
  *
113
  * @return FacebookRequest
114
  */
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
108
  /**
109
  * Set the access token for this request.
110
  *
111
+ * @param AccessToken|string|null
112
  *
113
  * @return FacebookRequest
114
  */
vendor/facebook/graph-sdk/src/Facebook/FacebookResponse.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/FileUpload/FacebookFile.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/FileUpload/FacebookResumableUploader.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/FileUpload/FacebookTransferChunk.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/FileUpload/FacebookVideo.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/FileUpload/Mimetypes.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
@@ -724,6 +724,7 @@ class Mimetypes
724
  'spq' => 'application/scvp-vp-request',
725
  'spx' => 'audio/ogg',
726
  'src' => 'application/x-wais-source',
 
727
  'sru' => 'application/sru+xml',
728
  'srx' => 'application/sparql-results+xml',
729
  'sse' => 'application/vnd.kodak-descriptor',
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
724
  'spq' => 'application/scvp-vp-request',
725
  'spx' => 'audio/ogg',
726
  'src' => 'application/x-wais-source',
727
+ 'srt' => 'application/octet-stream',
728
  'sru' => 'application/sru+xml',
729
  'srx' => 'application/sparql-results+xml',
730
  'sse' => 'application/vnd.kodak-descriptor',
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/Birthday.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/Collection.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphAchievement.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphAlbum.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphApplication.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphCoverPhoto.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphEdge.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
@@ -235,4 +235,18 @@ class GraphEdge extends Collection
235
 
236
  return null;
237
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  }
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
235
 
236
  return null;
237
  }
238
+
239
+ /**
240
+ * @inheritDoc
241
+ */
242
+ public function map(\Closure $callback)
243
+ {
244
+ return new static(
245
+ $this->request,
246
+ array_map($callback, $this->items, array_keys($this->items)),
247
+ $this->metaData,
248
+ $this->parentEdgeEndpoint,
249
+ $this->subclassName
250
+ );
251
+ }
252
  }
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphEvent.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphGroup.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphList.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphLocation.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphNode.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphNodeFactory.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphObject.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphObjectFactory.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphPage.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphPicture.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphSessionInfo.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/GraphNodes/GraphUser.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookCanvasHelper.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookJavaScriptHelper.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookPageTabHelper.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Http/GraphRawResponse.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Http/RequestBodyInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Http/RequestBodyMultipart.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Http/RequestBodyUrlEncoded.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookCurl.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookGuzzleHttpClient.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookHttpClientInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookStream.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/HttpClients/FacebookStreamHttpClient.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/HttpClients/HttpClientsFactory.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PersistentData/FacebookMemoryPersistentDataHandler.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PersistentData/FacebookSessionPersistentDataHandler.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PersistentData/PersistentDataFactory.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PersistentData/PersistentDataInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/McryptPseudoRandomStringGenerator.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/PseudoRandomStringGeneratorFactory.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/PseudoRandomStringGeneratorInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/PseudoRandomStringGeneratorTrait.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/RandomBytesPseudoRandomStringGenerator.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/PseudoRandomString/UrandomPseudoRandomStringGenerator.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/SignedRequest.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Url/FacebookUrlManipulator.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/Url/UrlDetectionInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/autoload.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/facebook/graph-sdk/src/Facebook/polyfills.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Copyright 2016 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
1
  <?php
2
  /**
3
+ * Copyright 2017 Facebook, Inc.
4
  *
5
  * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
  * use, copy, modify, and distribute this software in source code or binary
vendor/symfony/css-selector/Exception/SyntaxErrorException.php CHANGED
@@ -27,7 +27,7 @@ class SyntaxErrorException extends ParseException
27
  * @param string $expectedValue
28
  * @param Token $foundToken
29
  *
30
- * @return SyntaxErrorException
31
  */
32
  public static function unexpectedToken($expectedValue, Token $foundToken)
33
  {
@@ -38,7 +38,7 @@ class SyntaxErrorException extends ParseException
38
  * @param string $pseudoElement
39
  * @param string $unexpectedLocation
40
  *
41
- * @return SyntaxErrorException
42
  */
43
  public static function pseudoElementFound($pseudoElement, $unexpectedLocation)
44
  {
@@ -48,7 +48,7 @@ class SyntaxErrorException extends ParseException
48
  /**
49
  * @param int $position
50
  *
51
- * @return SyntaxErrorException
52
  */
53
  public static function unclosedString($position)
54
  {
@@ -56,7 +56,7 @@ class SyntaxErrorException extends ParseException
56
  }
57
 
58
  /**
59
- * @return SyntaxErrorException
60
  */
61
  public static function nestedNot()
62
  {
@@ -64,7 +64,7 @@ class SyntaxErrorException extends ParseException
64
  }
65
 
66
  /**
67
- * @return SyntaxErrorException
68
  */
69
  public static function stringAsFunctionArgument()
70
  {
27
  * @param string $expectedValue
28
  * @param Token $foundToken
29
  *
30
+ * @return self
31
  */
32
  public static function unexpectedToken($expectedValue, Token $foundToken)
33
  {
38
  * @param string $pseudoElement
39
  * @param string $unexpectedLocation
40
  *
41
+ * @return self
42
  */
43
  public static function pseudoElementFound($pseudoElement, $unexpectedLocation)
44
  {
48
  /**
49
  * @param int $position
50
  *
51
+ * @return self
52
  */
53
  public static function unclosedString($position)
54
  {
56
  }
57
 
58
  /**
59
+ * @return self
60
  */
61
  public static function nestedNot()
62
  {
64
  }
65
 
66
  /**
67
+ * @return self
68
  */
69
  public static function stringAsFunctionArgument()
70
  {
vendor/symfony/css-selector/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2016 Fabien Potencier
2
 
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
  of this software and associated documentation files (the "Software"), to deal
1
+ Copyright (c) 2004-2017 Fabien Potencier
2
 
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
  of this software and associated documentation files (the "Software"), to deal
vendor/symfony/css-selector/Node/Specificity.php CHANGED
@@ -61,7 +61,7 @@ class Specificity
61
  /**
62
  * @param Specificity $specificity
63
  *
64
- * @return Specificity
65
  */
66
  public function plus(Specificity $specificity)
67
  {
61
  /**
62
  * @param Specificity $specificity
63
  *
64
+ * @return self
65
  */
66
  public function plus(Specificity $specificity)
67
  {
vendor/symfony/css-selector/Parser/Reader.php CHANGED
@@ -97,7 +97,7 @@ class Reader
97
  /**
98
  * @param string $pattern
99
  *
100
- * @return bool
101
  */
102
  public function findPattern($pattern)
103
  {
97
  /**
98
  * @param string $pattern
99
  *
100
+ * @return array|false
101
  */
102
  public function findPattern($pattern)
103
  {
vendor/symfony/css-selector/Parser/TokenStream.php CHANGED
@@ -61,7 +61,7 @@ class TokenStream
61
  *
62
  * @param Token $token
63
  *
64
- * @return TokenStream
65
  */
66
  public function push(Token $token)
67
  {
@@ -73,7 +73,7 @@ class TokenStream
73
  /**
74
  * Freezes stream.
75
  *
76
- * @return TokenStream
77
  */
78
  public function freeze()
79
  {
61
  *
62
  * @param Token $token
63
  *
64
+ * @return $this
65
  */
66
  public function push(Token $token)
67
  {
73
  /**
74
  * Freezes stream.
75
  *
76
+ * @return $this
77
  */
78
  public function freeze()
79
  {
vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php CHANGED
@@ -11,9 +11,10 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests;
13
 
 
14
  use Symfony\Component\CssSelector\CssSelectorConverter;
15
 
16
- class CssSelectorConverterTest extends \PHPUnit_Framework_TestCase
17
  {
18
  public function testCssToXPath()
19
  {
11
 
12
  namespace Symfony\Component\CssSelector\Tests;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\CssSelectorConverter;
16
 
17
+ class CssSelectorConverterTest extends TestCase
18
  {
19
  public function testCssToXPath()
20
  {
vendor/symfony/css-selector/Tests/Node/AbstractNodeTest.php CHANGED
@@ -11,9 +11,10 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Node;
13
 
 
14
  use Symfony\Component\CssSelector\Node\NodeInterface;
15
 
16
- abstract class AbstractNodeTest extends \PHPUnit_Framework_TestCase
17
  {
18
  /** @dataProvider getToStringConversionTestData */
19
  public function testToStringConversion(NodeInterface $node, $representation)
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Node;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\Node\NodeInterface;
16
 
17
+ abstract class AbstractNodeTest extends TestCase
18
  {
19
  /** @dataProvider getToStringConversionTestData */
20
  public function testToStringConversion(NodeInterface $node, $representation)
vendor/symfony/css-selector/Tests/Node/SpecificityTest.php CHANGED
@@ -11,9 +11,10 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Node;
13
 
 
14
  use Symfony\Component\CssSelector\Node\Specificity;
15
 
16
- class SpecificityTest extends \PHPUnit_Framework_TestCase
17
  {
18
  /** @dataProvider getValueTestData */
19
  public function testValue(Specificity $specificity, $value)
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Node;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\Node\Specificity;
16
 
17
+ class SpecificityTest extends TestCase
18
  {
19
  /** @dataProvider getValueTestData */
20
  public function testValue(Specificity $specificity, $value)
vendor/symfony/css-selector/Tests/Parser/Handler/AbstractHandlerTest.php CHANGED
@@ -11,6 +11,7 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
13
 
 
14
  use Symfony\Component\CssSelector\Parser\Reader;
15
  use Symfony\Component\CssSelector\Parser\Token;
16
  use Symfony\Component\CssSelector\Parser\TokenStream;
@@ -18,7 +19,7 @@ use Symfony\Component\CssSelector\Parser\TokenStream;
18
  /**
19
  * @author Jean-François Simon <contact@jfsimon.fr>
20
  */
21
- abstract class AbstractHandlerTest extends \PHPUnit_Framework_TestCase
22
  {
23
  /** @dataProvider getHandleValueTestData */
24
  public function testHandleValue($value, Token $expectedToken, $remainingContent)
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\Parser\Reader;
16
  use Symfony\Component\CssSelector\Parser\Token;
17
  use Symfony\Component\CssSelector\Parser\TokenStream;
19
  /**
20
  * @author Jean-François Simon <contact@jfsimon.fr>
21
  */
22
+ abstract class AbstractHandlerTest extends TestCase
23
  {
24
  /** @dataProvider getHandleValueTestData */
25
  public function testHandleValue($value, Token $expectedToken, $remainingContent)
vendor/symfony/css-selector/Tests/Parser/ParserTest.php CHANGED
@@ -11,13 +11,14 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser;
13
 
 
14
  use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
15
  use Symfony\Component\CssSelector\Node\FunctionNode;
16
  use Symfony\Component\CssSelector\Node\SelectorNode;
17
  use Symfony\Component\CssSelector\Parser\Parser;
18
  use Symfony\Component\CssSelector\Parser\Token;
19
 
20
- class ParserTest extends \PHPUnit_Framework_TestCase
21
  {
22
  /** @dataProvider getParserTestData */
23
  public function testParser($source, $representation)
@@ -88,7 +89,7 @@ class ParserTest extends \PHPUnit_Framework_TestCase
88
 
89
  /** @var FunctionNode $function */
90
  $function = $selectors[0]->getTree();
91
- $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
92
  Parser::parseSeries($function->getArguments());
93
  }
94
 
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
16
  use Symfony\Component\CssSelector\Node\FunctionNode;
17
  use Symfony\Component\CssSelector\Node\SelectorNode;
18
  use Symfony\Component\CssSelector\Parser\Parser;
19
  use Symfony\Component\CssSelector\Parser\Token;
20
 
21
+ class ParserTest extends TestCase
22
  {
23
  /** @dataProvider getParserTestData */
24
  public function testParser($source, $representation)
89
 
90
  /** @var FunctionNode $function */
91
  $function = $selectors[0]->getTree();
92
+ $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
93
  Parser::parseSeries($function->getArguments());
94
  }
95
 
vendor/symfony/css-selector/Tests/Parser/ReaderTest.php CHANGED
@@ -11,9 +11,10 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser;
13
 
 
14
  use Symfony\Component\CssSelector\Parser\Reader;
15
 
16
- class ReaderTest extends \PHPUnit_Framework_TestCase
17
  {
18
  public function testIsEOF()
19
  {
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\Parser\Reader;
16
 
17
+ class ReaderTest extends TestCase
18
  {
19
  public function testIsEOF()
20
  {
vendor/symfony/css-selector/Tests/Parser/Shortcut/ClassParserTest.php CHANGED
@@ -11,13 +11,14 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
13
 
 
14
  use Symfony\Component\CssSelector\Node\SelectorNode;
15
  use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser;
16
 
17
  /**
18
  * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
19
  */
20
- class ClassParserTest extends \PHPUnit_Framework_TestCase
21
  {
22
  /** @dataProvider getParseTestData */
23
  public function testParse($source, $representation)
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\Node\SelectorNode;
16
  use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser;
17
 
18
  /**
19
  * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
20
  */
21
+ class ClassParserTest extends TestCase
22
  {
23
  /** @dataProvider getParseTestData */
24
  public function testParse($source, $representation)
vendor/symfony/css-selector/Tests/Parser/Shortcut/ElementParserTest.php CHANGED
@@ -11,13 +11,14 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
13
 
 
14
  use Symfony\Component\CssSelector\Node\SelectorNode;
15
  use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser;
16
 
17
  /**
18
  * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
19
  */
20
- class ElementParserTest extends \PHPUnit_Framework_TestCase
21
  {
22
  /** @dataProvider getParseTestData */
23
  public function testParse($source, $representation)
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\Node\SelectorNode;
16
  use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser;
17
 
18
  /**
19
  * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
20
  */
21
+ class ElementParserTest extends TestCase
22
  {
23
  /** @dataProvider getParseTestData */
24
  public function testParse($source, $representation)
vendor/symfony/css-selector/Tests/Parser/Shortcut/EmptyStringParserTest.php CHANGED
@@ -11,13 +11,14 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
13
 
 
14
  use Symfony\Component\CssSelector\Node\SelectorNode;
15
  use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser;
16
 
17
  /**
18
  * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
19
  */
20
- class EmptyStringParserTest extends \PHPUnit_Framework_TestCase
21
  {
22
  public function testParse()
23
  {
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\Node\SelectorNode;
16
  use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser;
17
 
18
  /**
19
  * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
20
  */
21
+ class EmptyStringParserTest extends TestCase
22
  {
23
  public function testParse()
24
  {
vendor/symfony/css-selector/Tests/Parser/Shortcut/HashParserTest.php CHANGED
@@ -11,13 +11,14 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
13
 
 
14
  use Symfony\Component\CssSelector\Node\SelectorNode;
15
  use Symfony\Component\CssSelector\Parser\Shortcut\HashParser;
16
 
17
  /**
18
  * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
19
  */
20
- class HashParserTest extends \PHPUnit_Framework_TestCase
21
  {
22
  /** @dataProvider getParseTestData */
23
  public function testParse($source, $representation)
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\Node\SelectorNode;
16
  use Symfony\Component\CssSelector\Parser\Shortcut\HashParser;
17
 
18
  /**
19
  * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
20
  */
21
+ class HashParserTest extends TestCase
22
  {
23
  /** @dataProvider getParseTestData */
24
  public function testParse($source, $representation)
vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php CHANGED
@@ -11,10 +11,11 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser;
13
 
 
14
  use Symfony\Component\CssSelector\Parser\Token;
15
  use Symfony\Component\CssSelector\Parser\TokenStream;
16
 
17
- class TokenStreamTest extends \PHPUnit_Framework_TestCase
18
  {
19
  public function testGetNext()
20
  {
@@ -52,7 +53,7 @@ class TokenStreamTest extends \PHPUnit_Framework_TestCase
52
 
53
  public function testFailToGetNextIdentifier()
54
  {
55
- $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
56
 
57
  $stream = new TokenStream();
58
  $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2));
@@ -72,7 +73,7 @@ class TokenStreamTest extends \PHPUnit_Framework_TestCase
72
 
73
  public function testFailToGetNextIdentifierOrStar()
74
  {
75
- $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
76
 
77
  $stream = new TokenStream();
78
  $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2));
11
 
12
  namespace Symfony\Component\CssSelector\Tests\Parser;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\Parser\Token;
16
  use Symfony\Component\CssSelector\Parser\TokenStream;
17
 
18
+ class TokenStreamTest extends TestCase
19
  {
20
  public function testGetNext()
21
  {
53
 
54
  public function testFailToGetNextIdentifier()
55
  {
56
+ $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
57
 
58
  $stream = new TokenStream();
59
  $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2));
73
 
74
  public function testFailToGetNextIdentifierOrStar()
75
  {
76
+ $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
77
 
78
  $stream = new TokenStream();
79
  $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2));
vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php CHANGED
@@ -11,10 +11,11 @@
11
 
12
  namespace Symfony\Component\CssSelector\Tests\XPath;
13
 
 
14
  use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension;
15
  use Symfony\Component\CssSelector\XPath\Translator;
16
 
17
- class TranslatorTest extends \PHPUnit_Framework_TestCase
18
  {
19
  /** @dataProvider getXpathLiteralTestData */
20
  public function testXpathLiteral($value, $literal)
11
 
12
  namespace Symfony\Component\CssSelector\Tests\XPath;
13
 
14
+ use PHPUnit\Framework\TestCase;
15
  use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension;
16
  use Symfony\Component\CssSelector\XPath\Translator;
17
 
18
+ class TranslatorTest extends TestCase
19
  {
20
  /** @dataProvider getXpathLiteralTestData */
21
  public function testXpathLiteral($value, $literal)
vendor/symfony/css-selector/XPath/Extension/NodeExtension.php CHANGED
@@ -50,7 +50,7 @@ class NodeExtension extends AbstractExtension
50
  * @param int $flag
51
  * @param bool $on
52
  *
53
- * @return NodeExtension
54
  */
55
  public function setFlag($flag, $on)
56
  {
@@ -72,7 +72,7 @@ class NodeExtension extends AbstractExtension
72
  */
73
  public function hasFlag($flag)
74
  {
75
- return $this->flags & $flag;
76
  }
77
 
78
  /**
50
  * @param int $flag
51
  * @param bool $on
52
  *
53
+ * @return $this
54
  */
55
  public function setFlag($flag, $on)
56
  {
72
  */
73
  public function hasFlag($flag)
74
  {
75
+ return (bool) ($this->flags & $flag);
76
  }
77
 
78
  /**
vendor/symfony/css-selector/XPath/Translator.php CHANGED
@@ -146,7 +146,7 @@ class Translator implements TranslatorInterface
146
  *
147
  * @param Extension\ExtensionInterface $extension
148
  *
149
- * @return Translator
150
  */
151
  public function registerExtension(Extension\ExtensionInterface $extension)
152
  {
@@ -182,7 +182,7 @@ class Translator implements TranslatorInterface
182
  *
183
  * @param ParserInterface $shortcut
184
  *
185
- * @return Translator
186
  */
187
  public function registerParserShortcut(ParserInterface $shortcut)
188
  {
146
  *
147
  * @param Extension\ExtensionInterface $extension
148
  *
149
+ * @return $this
150
  */
151
  public function registerExtension(Extension\ExtensionInterface $extension)
152
  {
182
  *
183
  * @param ParserInterface $shortcut
184
  *
185
+ * @return $this
186
  */
187
  public function registerParserShortcut(ParserInterface $shortcut)
188
  {
vendor/symfony/css-selector/XPath/XPathExpr.php CHANGED
@@ -66,7 +66,7 @@ class XPathExpr
66
  /**
67
  * @param $condition
68
  *
69
- * @return XPathExpr
70
  */
71
  public function addCondition($condition)
72
  {
@@ -84,7 +84,7 @@ class XPathExpr
84
  }
85
 
86
  /**
87
- * @return XPathExpr
88
  */
89
  public function addNameTest()
90
  {
@@ -97,7 +97,7 @@ class XPathExpr
97
  }
98
 
99
  /**
100
- * @return XPathExpr
101
  */
102
  public function addStarPrefix()
103
  {
@@ -112,7 +112,7 @@ class XPathExpr
112
  * @param string $combiner
113
  * @param XPathExpr $expr
114
  *
115
- * @return XPathExpr
116
  */
117
  public function join($combiner, XPathExpr $expr)
118
  {
66
  /**
67
  * @param $condition
68
  *
69
+ * @return $this
70
  */
71
  public function addCondition($condition)
72
  {
84
  }
85
 
86
  /**
87
+ * @return $this
88
  */
89
  public function addNameTest()
90
  {
97
  }
98
 
99
  /**
100
+ * @return $this
101
  */
102
  public function addStarPrefix()
103
  {
112
  * @param string $combiner
113
  * @param XPathExpr $expr
114
  *
115
+ * @return $this
116
  */
117
  public function join($combiner, XPathExpr $expr)
118
  {
vendor/symfony/css-selector/composer.json CHANGED
@@ -20,7 +20,7 @@
20
  }
21
  ],
22
  "require": {
23
- "php": ">=5.3.9"
24
  },
25
  "autoload": {
26
  "psr-4": { "Symfony\\Component\\CssSelector\\": "" },
@@ -31,7 +31,7 @@
31
  "minimum-stability": "dev",
32
  "extra": {
33
  "branch-alias": {
34
- "dev-master": "2.8-dev"
35
  }
36
  }
37
  }
20
  }
21
  ],
22
  "require": {
23
+ "php": ">=5.5.9"
24
  },
25
  "autoload": {
26
  "psr-4": { "Symfony\\Component\\CssSelector\\": "" },
31
  "minimum-stability": "dev",
32
  "extra": {
33
  "branch-alias": {
34
+ "dev-master": "3.2-dev"
35
  }
36
  }
37
  }
vendor/symfony/css-selector/phpunit.xml.dist CHANGED
@@ -5,6 +5,8 @@
5
  backupGlobals="false"
6
  colors="true"
7
  bootstrap="vendor/autoload.php"
 
 
8
  >
9
  <php>
10
  <ini name="error_reporting" value="-1" />
5
  backupGlobals="false"
6
  colors="true"
7
  bootstrap="vendor/autoload.php"
8
+ failOnRisky="true"
9
+ failOnWarning="true"
10
  >
11
  <php>
12
  <ini name="error_reporting" value="-1" />
wizard/class-instant-articles-option-publishing.php CHANGED
@@ -54,6 +54,22 @@ class Instant_Articles_Option_Publishing extends Instant_Articles_Option {
54
  'default' => false,
55
  'checkbox_label' => 'Publish articles containing warnings',
56
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  );
58
 
59
  /**
54
  'default' => false,
55
  'checkbox_label' => 'Publish articles containing warnings',
56
  ),
57
+
58
+ 'likes_on_media' => array(
59
+ 'label' => 'Likes',
60
+ 'description' => 'With this option enabled, any image or video will have the like action enabled by default.',
61
+ 'render' => 'checkbox',
62
+ 'default' => false,
63
+ 'checkbox_label' => 'Enable like action on images and videos by default',
64
+ ),
65
+
66
+ 'comments_on_media' => array(
67
+ 'label' => 'Comments',
68
+ 'description' => 'With this option enabled, any image or video will have the comments enabled by default.',
69
+ 'render' => 'checkbox',
70
+ 'default' => false,
71
+ 'checkbox_label' => 'Enable comments on images and videos by default',
72
+ ),
73
  );
74
 
75
  /**
wizard/class-instant-articles-option-styles.php CHANGED
@@ -17,8 +17,7 @@ class Instant_Articles_Option_Styles extends Instant_Articles_Option {
17
  const OPTION_KEY = 'instant-articles-option-styles';
18
 
19
  public static $sections = array(
20
- 'title' => 'Styles',
21
- 'description' => '<p>Assign your Instant Articles a custom style. To begin, customize a template using the Style Editor. Next, input the name of the style below.</p><p><strong>Note:</strong> If this field is left blank, the plugin will enable the “Default” style. Learn more about Instant Articles style options in the <a href="https://developers.facebook.com/docs/instant-articles/guides/design" target="_blank">Design Guide</a>.</p>',
22
  );
23
 
24
  public static $fields = array(
@@ -26,6 +25,21 @@ class Instant_Articles_Option_Styles extends Instant_Articles_Option {
26
  'article_style' => array(
27
  'label' => 'Article Style',
28
  'default' => 'default',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  ),
30
 
31
  );
17
  const OPTION_KEY = 'instant-articles-option-styles';
18
 
19
  public static $sections = array(
20
+ 'title' => 'Appearance',
 
21
  );
22
 
23
  public static $fields = array(
25
  'article_style' => array(
26
  'label' => 'Article Style',
27
  'default' => 'default',
28
+ 'description' => '<p>Assign your Instant Articles a custom style. To begin, customize a template using the Style Editor. Next, input the name of the style below.</p><p><strong>Note:</strong> If this field is left blank, the plugin will enable the “Default” style. Learn more about Instant Articles style options in the <a href="https://developers.facebook.com/docs/instant-articles/guides/design" target="_blank">Design Guide</a>.</p>',
29
+ ),
30
+
31
+ 'copyright' => array(
32
+ 'label' => 'Copyright',
33
+ 'default' => '',
34
+ 'description' => 'The copyright details for your articles. Note: No markup tags can be used in this field. <a href="https://developers.facebook.com/docs/instant-articles/reference/footer" target="_blank">Learn more about Footer in Instant Articles</a>.',
35
+ ),
36
+
37
+ 'rtl_enabled' => array(
38
+ 'label' => 'Right-to-Left Publishing',
39
+ 'render' => 'checkbox',
40
+ 'default' => false,
41
+ 'description' => 'Body text will read right to left for all articles.',
42
+ 'checkbox_label' => 'Enable Right-to-Left (RTL) publishing',
43
  ),
44
 
45
  );
wpcom-helper.php CHANGED
@@ -1,8 +1,10 @@
1
  <?php
2
 
 
 
3
  // Wrap the wpcom tracking pixel to comply with the FBIA spec
4
  // https://developers.facebook.com/docs/instant-articles/reference/analytics
5
- function wpcom_fbia_stats_pixel() {
6
  global $post;
7
 
8
  if ( ! defined( 'INSTANT_ARTICLES_SLUG' ) ) {
@@ -16,34 +18,32 @@ function wpcom_fbia_stats_pixel() {
16
  // Stop wpcom adding the tracking pixel
17
  remove_filter( 'the_content', 'add_bug_to_feed', 100 );
18
 
19
- add_filter( 'the_content', '_wpcom_fbia_stats_pixel', 100 );
20
-
21
  }
22
- add_action( 'template_redirect', 'wpcom_fbia_stats_pixel' );
23
 
24
- function _wpcom_fbia_stats_pixel( $content ) {
25
- global $post, $current_blog;
26
 
27
- if ( ! is_feed() ) {
28
- return $content;
29
- }
30
 
 
31
  $hostname = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : ''; // input var okay
32
 
33
  $url = 'https://pixel.wp.com/b.gif?host=' . $hostname . '&blog=' . $current_blog->blog_id . '&post=' . $post->ID . '&subd=' . str_replace( '.wordpress.com', '', $current_blog->domain ) . '&ref=&feed=1';
34
 
35
- $fbia_pixel = '
36
- <figure class="op-tracker">
37
- <iframe>
38
- <script>
39
- var x = new Image(); x.src = "' . esc_js( $url ) . '&rand=" +Math.random();
40
- </script>
41
- </iframe>
42
- </figure>';
43
 
44
- return $content . $fbia_pixel;
 
45
 
46
  }
 
47
 
48
  // make sure these function run in wp.com environment where `plugins_loaded` is already fired when loading the plugin
49
  add_action( 'after_setup_theme', 'instant_articles_load_textdomain' );
1
  <?php
2
 
3
+ use Facebook\InstantArticles\Elements\Analytics;
4
+
5
  // Wrap the wpcom tracking pixel to comply with the FBIA spec
6
  // https://developers.facebook.com/docs/instant-articles/reference/analytics
7
+ function wpcom_fbia_remove_stats_pixel() {
8
  global $post;
9
 
10
  if ( ! defined( 'INSTANT_ARTICLES_SLUG' ) ) {
18
  // Stop wpcom adding the tracking pixel
19
  remove_filter( 'the_content', 'add_bug_to_feed', 100 );
20
 
 
 
21
  }
22
+ add_action( 'template_redirect', 'wpcom_fbia_remove_stats_pixel' );
23
 
24
+ function wpcom_fbia_add_stats_pixel( $ia_post ) {
 
25
 
26
+ // Get the IA article.
27
+ $instant_article = $ia_post->instant_article;
 
28
 
29
+ // Create the wpcom stats code.
30
  $hostname = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : ''; // input var okay
31
 
32
  $url = 'https://pixel.wp.com/b.gif?host=' . $hostname . '&blog=' . $current_blog->blog_id . '&post=' . $post->ID . '&subd=' . str_replace( '.wordpress.com', '', $current_blog->domain ) . '&ref=&feed=1';
33
 
34
+ $pixel_html = '<script>
35
+ var x = new Image(); x.src = "' . esc_js( $url ) . '&rand=" +Math.random();
36
+ </script>';
37
+
38
+ // Create our FBIA markup
39
+ $fbia_markup = Analytics::create();
40
+ $fbia_markup->withHTML( $pixel_html );
 
41
 
42
+ // Add the FBIA-compatible stats markup to the IA content
43
+ $instant_article->addChild( $fbia_markup );
44
 
45
  }
46
+ add_action( 'instant_articles_after_transform_post', 'wpcom_fbia_add_stats_pixel' );
47
 
48
  // make sure these function run in wp.com environment where `plugins_loaded` is already fired when loading the plugin
49
  add_action( 'after_setup_theme', 'instant_articles_load_textdomain' );