# Basic plugin analysis failed: Parse Error im Subscriber bei SystemConfigService

**URL:** <https://forum.shopware.com/t/basic-plugin-analysis-failed-parse-error-im-subscriber-bei-systemconfigservice/98690>\
**Category:** Programmierung\
**Created:** [24. Februar 2023 um 07:25 UTC](https://forum.shopware.com/t/basic-plugin-analysis-failed-parse-error-im-subscriber-bei-systemconfigservice/98690 "2023-02-24T07:25:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pd3233](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@pd3233](https://forum.shopware.com/u/pd3233)\
**Post date:** [24. Februar 2023 um 07:25 UTC](https://forum.shopware.com/t/basic-plugin-analysis-failed-parse-error-im-subscriber-bei-systemconfigservice/98690/1 "2023-02-24T07:25:28Z")

</div>

Hallo Leute,

ich habe heute eine neue Version eines unserer Plugins versucht in den Store zu stellen und erhalte folgende Fehlermeldung:

```auto
Parse error: syntax error, unexpected 'SystemConfigService' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /PdweFeatureArticleBox6/src/Subscriber/CssSubscriber.php on line 12

```

So sieht der Subscriber aus (eigentlich ziemlich exakt das was [hier](https://developer.shopware.com/docs/guides/plugins/plugins/storefront/add-scss-variables-via-subscriber#plugin-config-values-as-scss-variable) in der Doku steht)

```auto
<?php declare(strict_types=1);

namespace Pdwe\PdweFeatureArticleBox6\Subscriber;

use Shopware\Core\System\SystemConfig\SystemConfigService;
use Shopware\Storefront\Event\ThemeCompilerEnrichScssVariablesEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter;

class CssSubscriber implements EventSubscriberInterface
{
    protected SystemConfigService $systemConfig;

    public function __construct(SystemConfigService $systemConfig)
    {
        $this->systemConfig = $systemConfig;
    }

    public static function getSubscribedEvents(): array
    {
        return [
            ThemeCompilerEnrichScssVariablesEvent::class => 'onAddVariables'
        ];
    }

    public function onAddVariables(ThemeCompilerEnrichScssVariablesEvent $event): void
    {
        $configFields = $this->systemConfig->get('PdweFeatureArticleBox6.config', $event->getSalesChannelId());

        foreach($configFields as $key => $value) {
            $kebabCased = str_replace('_', '-', (new CamelCaseToSnakeCaseNameConverter())->normalize($key));
            $event->addVariable($kebabCased, (string) $value);
        }
    }
}

```

Der Abschnitt in der services.xml sieht so aus:

```auto
 <service id="Pdwe\PdweFeatureArticleBox6\Subscriber\CssSubscriber">
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
			<tag name="kernel.event_subscriber"/>
        </service>

```

Ich stehe echt auf dem Schlauch, ich nutze es genauso auch in anderen Plugins und hatte nie Probleme. Es funktioniert auch in unserer Testumgebung, aber die Basis Plugin-Analyse bemängelt es. Hat Jemand eine Ahnung?
