title: Prestashop Guzzle Conflict
body: <p>I am updating a <a href="/questions/tagged/prestashop" class="post-tag" title="show questions tagged &#39;prestashop&#39;" rel="tag">prestashop</a> module by including a package that uses <a href="/questions/tagged/guzzle" class="post-tag" title="show questions tagged &#39;guzzle&#39;" rel="tag">guzzle</a>6.0.</p>
  
  <p>Prestashop 1.7 uses an older version of Guzzle 5. </p>
  
  <p>When I install the plugin on Prestashop the included package's version of Guzzle conflicts with the Prestashop one resulting in the following <a href="/questions/tagged/php" class="post-tag" title="show questions tagged &#39;php&#39;" rel="tag">php</a> error.</p>
  
  <blockquote>
    <p>Uncaught PHP Exception InvalidArgumentException: "Magic request methods require a URI and optional options array" at /var/www/html/modules/package/vendorpackage/guzzlehttp/guzzle/src/Client.php line 81 {"exception":"[object] (InvalidArgumentException(code: 0):Magic request methods require a URI and optional options array at /var/www/html/modules/package/vendorpackage/guzzlehttp/guzzle/src/Client.php:81)"} []</p>
  </blockquote>
  
  <p>I have found a few other examples of similar issues:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/50236670/prestashop-module-classes-not-found-namespaces">PrestaShop module classes not found (namespaces)</a></li>
  <li><a href="http://forge.prestashop.com/browse/BOOM-2427" rel="noreferrer">http://forge.prestashop.com/browse/BOOM-2427</a></li>
  <li><a href="https://stackoverflow.com/questions/48385669/prestashop-1-6-conflict-2-different-modules-requiring-same-class-different-ve">Prestashop 1.6, conflict: 2 different modules requiring same class, different versions</a></li>
  <li><a href="https://github.com/Nexmo/nexmo-php/issues/77" rel="noreferrer">https://github.com/Nexmo/nexmo-php/issues/77</a></li>
  </ul>
  
  <p>Based on these I have a few ideas for how to get around the issue. None of these feel like the right way to do it. Surely there is a cleaner way to handle issues like this with <a href="/questions/tagged/composer" class="post-tag" title="show questions tagged &#39;composer&#39;" rel="tag">composer</a>?</p>
  
  <ul>
  <li><p><strong>Remove Guzzle from the included package</strong> - this is the simplest one, my problem with this is that if I remove this dependency where does it stop, whats to say any other dependencies wont clash later down the line that cant be removed?</p></li>
  <li><p><strong>Can check version of Guzzle in package and swap calls dependent on which one loads</strong> - similarly to the issue above I can hack a fix in to determine which type of call I should be using for this bug, but I cant tell what other issues this may raise and my code may end up littered with statements for each version.</p></li>
  <li><p><strong>Manually Change the namespaces of guzzle in the plugin</strong>. So I can go into the vendor folder of my package and force a specific namespace for the package, I am guessing this will solve my issue, but I am losing the point of installing a re-usable package.</p></li>
  <li><p><strong>Fork Guzzle and refer to that version</strong>. I could fork guzzle and include it as a VCS package in the plugin. Issue here being that I then have to keep that maintained moving forward.</p></li>
  </ul>