Kategorien
Amazon MWS PHP

Amazon MWS PHP: Compile Error: Redefinition of parameter $quotaMax

Die Amazon MWS Library hat zu Recht Probleme in PHP7.1 mit der Datei: /MarketplaceWebServiceProducts/Model/ResponseHeaderMetadata.php (line 31)

Vorher:

class MarketplaceWebServiceProducts_Model_ResponseHeaderMetadata {

...

  public function __construct($requestId = null, $responseContext = null, $timestamp = null,
                              $quotaMax = null, $quotaMax = null, $quotaResetsAt = null) {
    $this->metadata[self::REQUEST_ID] = $requestId;
    $this->metadata[self::RESPONSE_CONTEXT] = $responseContext;
    $this->metadata[self::TIMESTAMP] = $timestamp;
    $this->metadata[self::QUOTA_MAX] = $quotaMax;
    $this->metadata[self::QUOTA_REMAINING] = $quotaMax;
    $this->metadata[self::QUOTA_RESETS_AT] = $quotaResetsAt;
  }

Nach dem Fix:

public function __construct($requestId = null, $responseContext = null, $timestamp = null,
                            $quotaMax = null, $quotaMaxRemain = null, $quotaResetsAt = null) {
  $this->metadata[self::REQUEST_ID] = $requestId;
  $this->metadata[self::RESPONSE_CONTEXT] = $responseContext;
  $this->metadata[self::TIMESTAMP] = $timestamp;
  $this->metadata[self::QUOTA_MAX] = $quotaMax;
  $this->metadata[self::QUOTA_REMAINING] = $quotaMaxRemain;
  $this->metadata[self::QUOTA_RESETS_AT] = $quotaResetsAt;
}

Grund ist, dass die Variable $quotaMax doppelt benutzt wird in der Kontrultor Definition.