Commit d410a653 authored by Joël Pittet's avatar Joël Pittet
Browse files

Issue #3254188 by joelpittet, MegaChriz, frank.schram: PHP 8.0 compatibility

parent b7ac60be
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ class ParserCSVIterator implements Iterator {
  /**
   * {@inheritdoc}
   */
  #[\ReturnTypeWillChange]
  public function rewind($pos = 0) {
    if ($this->handle) {
      fseek($this->handle, $pos);
@@ -58,6 +59,7 @@ class ParserCSVIterator implements Iterator {
  /**
   * {@inheritdoc}
   */
  #[\ReturnTypeWillChange]
  public function next() {
    if ($this->handle) {
      $this->currentLine = feof($this->handle) ? NULL : fgets($this->handle);
@@ -69,6 +71,7 @@ class ParserCSVIterator implements Iterator {
  /**
   * {@inheritdoc}
   */
  #[\ReturnTypeWillChange]
  public function valid() {
    return isset($this->currentLine);
  }
@@ -76,6 +79,7 @@ class ParserCSVIterator implements Iterator {
  /**
   * {@inheritdoc}
   */
  #[\ReturnTypeWillChange]
  public function current() {
    return $this->currentLine;
  }
@@ -90,6 +94,7 @@ class ParserCSVIterator implements Iterator {
  /**
   * {@inheritdoc}
   */
  #[\ReturnTypeWillChange]
  public function key() {
    return 'line';
  }
@@ -126,7 +131,6 @@ class ParserCSV {
    $this->startByte = 0;
    $this->lineLimit = 0;
    $this->lastLinePos = 0;
    ini_set('auto_detect_line_endings', TRUE);
    if (extension_loaded('mbstring') && variable_get('feeds_use_mbstring', TRUE)) {
      $this->useMbString = TRUE;
    }
+2 −0
Original line number Diff line number Diff line
@@ -777,6 +777,7 @@ class FeedsDateTime extends DateTime {
  /**
   * Upon unserializing, we must re-build ourselves using local variables.
   */
  #[\ReturnTypeWillChange]
  public function __wakeup() {
    $this->__construct($this->_serialized_time, new DateTimeZone($this->_serialized_timezone));
  }
@@ -834,6 +835,7 @@ class FeedsDateTime extends DateTime {
   * In order to set a timezone for a datetime that doesn't have such
   * granularity, merge() it with one that does.
   */
  #[\ReturnTypeWillChange]
  public function setTimezone($tz, $force = FALSE) {
    // PHP 5.2.6 has a fatal error when setting a date's timezone to itself.
    // http://bugs.php.net/bug.php?id=45038
+13 −0
Original line number Diff line number Diff line
@@ -11,6 +11,13 @@
class FeedsWebTestCase extends DrupalWebTestCase {
  protected $profile = 'testing';

  /**
   * A user with permission to bypass node access and administer nodes.
   *
   * @var object
   */
  protected $admin_user;

  /**
   * {@inheritdoc}
   */
@@ -97,6 +104,12 @@ class FeedsWebTestCase extends DrupalWebTestCase {

    // Create an admin user and log in.
    $this->admin_user = $this->drupalCreateUser($permissions);
    // Track down which modules are not enabled.
    if (!$this->admin_user) {
      $enabled_modules = array_keys(system_list('module_enabled'));
      $result = array_intersect($modules, $enabled_modules);
      $this->assertEqual($modules, $result);
    }
    $this->drupalLogin($this->admin_user);

    // Create two content types if they don't exist yet.
+1 −0
Original line number Diff line number Diff line
@@ -773,6 +773,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
      'instance[settings][file_directory]' => '',
      'instance[settings][alt_field]' => 1,
      'instance[settings][title_field]' => 1,
      'instance[settings][file_directory]' => '',
    );
    $this->drupalPost("admin/structure/types/manage/$typename/fields/field_images", $edit, t('Save settings'));