diff vendor/zendframework/zend-feed/src/Reader/Reader.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents c2387f117808
children
line wrap: on
line diff
--- a/vendor/zendframework/zend-feed/src/Reader/Reader.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/zendframework/zend-feed/src/Reader/Reader.php	Thu Feb 28 13:21:36 2019 +0000
@@ -280,7 +280,7 @@
      *
      * @param  string $uri
      * @param  Http\ClientInterface $client
-     * @return self
+     * @return Feed\FeedInterface
      * @throws Exception\RuntimeException if response is not an Http\ResponseInterface
      */
     public static function importRemoteFeed($uri, Http\ClientInterface $client)
@@ -349,11 +349,11 @@
 
         static::registerCoreExtensions();
 
-        if (substr($type, 0, 3) == 'rss') {
+        if (0 === strpos($type, 'rss')) {
             $reader = new Feed\Rss($dom, $type);
-        } elseif (substr($type, 8, 5) == 'entry') {
+        } elseif (8 === strpos($type, 'entry')) {
             $reader = new Entry\Atom($dom->documentElement, 0, self::TYPE_ATOM_10);
-        } elseif (substr($type, 0, 4) == 'atom') {
+        } elseif (0 === strpos($type, 'atom')) {
             $reader = new Feed\Atom($dom, $type);
         } else {
             throw new Exception\RuntimeException('The URI used does not point to a '