# Fehler im Plugin nach Umstellung auf PHP7

**URL:** https://forum.shopware.com/t/fehler-im-plugin-nach-umstellung-auf-php7/47427
**Category:** Programmierung
**Created:** [9. August 2017 um 09:22 UTC](https://forum.shopware.com/t/fehler-im-plugin-nach-umstellung-auf-php7/47427 "2017-08-09T09:22:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Konrad](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Konrad](https://forum.shopware.com/u/Konrad)
#### Post date: [9. August 2017 um 09:22 UTC](https://forum.shopware.com/t/fehler-im-plugin-nach-umstellung-auf-php7/47427/1 "2017-08-09T09:22:23Z")

</div>

Hallo liebe Entwickler-Community,

ist Euch vielleicht schon so ein Fehler nach Umstellung auf PHP7 bekannt?

**Fatal error** : Uncaught TypeError: Argument 1 passed to Shopware\CustomModels\CountriesList\Repository::\_\_construct() must be an instance of Doctrine\DBAL\Connection, instance of Shopware\Components\Model\ModelManager given, called in /html/shopware/engine/Shopware/Components/Model/ProxyAwareRepositoryFactory.php on line 82 and defined in /html/shopware/engine/Shopware/Plugins/Community/Frontend/BogxPlugin/Models/CountriesList/Repository.php:20 Stack trace: #0 /html/shopware/engine/Shopware/Components/Model/ProxyAwareRepositoryFactory.php(82): Shopware\CustomModels\CountriesList\Repository-\>\_\_construct(Object(Shopware\Components\Model\ModelManager), Object(Doctrine\ORM\Mapping\ClassMetadata)) #1 /html/shopware/engine/Shopware/Components/Model/ProxyAwareRepositoryFactory.php(62): Shopware\Components\Model\ProxyAwareRepositoryFactory-\>createRepository(Object(Shopware\Components\Model\ModelManager), ‚Shopware\Custom…‘) #2 /html/shopware/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(698): Shopware\Components\Model\P in&nbsp; **/html/shopware/engine/Shopware/Plugins/Community/Frontend/BogxPlugin/Models/CountriesList/Repository.php** &nbsp;on line&nbsp; **20**  
503 Service Unavailable

&nbsp;

Die bemängelte Funktion:  
&nbsp;

```
connection = $connection;
        $this->eventManager = $eventManager;
    }
...
...
...

```

Irgendein ein Tipp was PHP7 in dem „\_\_construct“ nicht passt?

Best, Konrad

---

<div class="post-metadata">

### Author: ![Thomas](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/thomas/32/8167_2.png) [@Thomas](https://forum.shopware.com/u/Thomas)
#### Post date: [9. August 2017 um 09:30 UTC](https://forum.shopware.com/t/fehler-im-plugin-nach-umstellung-auf-php7/47427/2 "2017-08-09T09:30:12Z")

</div>

Das Plugin&nbsp; **BogxPlugin&nbsp;** gibt anstatt einer DbalConnection den ModelManager via Constructor rein. Daher die Exception.&nbsp;

---

<div class="post-metadata">

### Author: ![Konrad](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Konrad](https://forum.shopware.com/u/Konrad)
#### Post date: [9. August 2017 um 09:33 UTC](https://forum.shopware.com/t/fehler-im-plugin-nach-umstellung-auf-php7/47427/3 "2017-08-09T09:33:19Z")

</div>

Hi Thomas,

herzlichen Dank. Nur warum ausgerechnet unter PHP7?

Best, Konrad

---

<div class="post-metadata">

### Author: ![Thomas](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/thomas/32/8167_2.png) [@Thomas](https://forum.shopware.com/u/Thomas)
#### Post date: [9. August 2017 um 09:41 UTC](https://forum.shopware.com/t/fehler-im-plugin-nach-umstellung-auf-php7/47427/4 "2017-08-09T09:41:34Z")

</div>

Weil php7.0 die Typisierung&nbsp;verändert hat und somit mit den Fehlern die vorher tolleriert wurden mit Exceptions reagiert&nbsp;:)
