Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Error while compile container #15

Closed
astronom opened this issue Apr 24, 2018 · 3 comments · Fixed by #16
Closed

Error while compile container #15

astronom opened this issue Apr 24, 2018 · 3 comments · Fixed by #16
Labels
bug Something isn't working

Comments

@astronom
Copy link

Environment

Sonata packages

$ composer show --latest 'sonata-project/*'
sonata-project/admin-bundle              3.35.1 3.35.1 The missing Symfony Admin Generator
sonata-project/block-bundle              3.12.1 3.12.1 Symfony SonataBlockBundle
sonata-project/cache                     2.0.1  2.0.1  Cache library
sonata-project/core-bundle               3.9.1  3.9.1  Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.3.1  2.3.1  Symfony SonataDatagridBundle
sonata-project/doctrine-orm-admin-bundle 3.6.0  3.6.0  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/exporter                  1.8.0  1.8.0  Lightweight Exporter library

Symfony packages

$ composer show --latest 'symfony/*'
symfony/asset                v4.0.8             v4.0.8             Symfony Asset Component
symfony/browser-kit          v4.0.8             v4.0.8             Symfony BrowserKit Component
symfony/cache                v4.0.8             v4.0.8             Symfony Cache component with PSR-6, PSR-16, and tags
symfony/class-loader         v3.4.8             v3.4.8             Symfony ClassLoader Component
symfony/config               v4.0.8             v4.0.8             Symfony Config Component
symfony/console              v4.0.8             v4.0.8             Symfony Console Component
symfony/css-selector         v4.0.8             v4.0.8             Symfony CssSelector Component
symfony/debug                v4.0.8             v4.0.8             Symfony Debug Component
symfony/dependency-injection v4.0.8             v4.0.8             Symfony DependencyInjection Component
symfony/doctrine-bridge      v4.0.8             v4.0.8             Symfony Doctrine Bridge
symfony/dom-crawler          v4.0.8             v4.0.8             Symfony DomCrawler Component
symfony/dotenv               v3.4.8             v4.0.8             Registers environment variables from a .env file
symfony/event-dispatcher     v4.0.8             v4.0.8             Symfony EventDispatcher Component
symfony/expression-language  v4.0.8             v4.0.8             Symfony ExpressionLanguage Component
symfony/filesystem           v4.0.8             v4.0.8             Symfony Filesystem Component
symfony/finder               v4.0.8             v4.0.8             Symfony Finder Component
symfony/flex                 v1.0.78            v1.0.78           
symfony/form                 v4.0.8             v4.0.8             Symfony Form Component
symfony/framework-bundle     v4.0.8             v4.0.8             Symfony FrameworkBundle
symfony/http-foundation      v4.0.8             v4.0.8             Symfony HttpFoundation Component
symfony/http-kernel          v4.0.8             v4.0.8             Symfony HttpKernel Component
symfony/inflector            v4.0.8             v4.0.8             Symfony Inflector Component
symfony/intl                 v4.0.8             v4.0.8             A PHP replacement layer for the C intl extension that includes additional data from the ICU library.
symfony/lts                  dev-master 6de50b2 dev-master 6de50b2 Enforces Long Term Supported versions of Symfony components
symfony/monolog-bridge       v4.0.8             v4.0.8             Symfony Monolog Bridge
symfony/monolog-bundle       v3.2.0             v3.2.0             Symfony MonologBundle
symfony/options-resolver     v4.0.8             v4.0.8             Symfony OptionsResolver Component
symfony/polyfill-apcu        v1.7.0             v1.7.0             Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu    v1.7.0             v1.7.0             Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring    v1.7.0             v1.7.0             Symfony polyfill for the Mbstring extension
symfony/polyfill-php56       v1.7.0             v1.7.0             Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70       v1.7.0             v1.7.0             Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-php72       v1.7.0             v1.7.0             Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-util        v1.7.0             v1.7.0             Symfony utilities for portability of PHP codes
symfony/process              v3.4.8             v4.0.8             Symfony Process Component
symfony/profiler-pack        v1.0.3             v1.0.3             A pack for the Symfony web profiler
symfony/property-access      v4.0.8             v4.0.8             Symfony PropertyAccess Component
symfony/property-info        v4.0.8             v4.0.8             Symfony Property Info Component
symfony/routing              v4.0.8             v4.0.8             Symfony Routing Component
symfony/security             v3.4.8             v4.0.8             Symfony Security Component
symfony/security-acl         v3.0.1             v3.0.1             Symfony Security Component - ACL (Access Control List)
symfony/security-bundle      v4.0.8             v4.0.8             Symfony SecurityBundle
symfony/security-csrf        v4.0.8             v4.0.8             Symfony Security Component - CSRF Library
symfony/stopwatch            v4.0.8             v4.0.8             Symfony Stopwatch Component
symfony/swiftmailer-bundle   v3.2.2             v3.2.2             Symfony SwiftmailerBundle
symfony/templating           v4.0.8             v4.0.8             Symfony Templating Component
symfony/translation          v4.0.8             v4.0.8             Symfony Translation Component
symfony/twig-bridge          v4.0.8             v4.0.8             Symfony Twig Bridge
symfony/twig-bundle          v4.0.8             v4.0.8             Symfony TwigBundle
symfony/validator            v4.0.8             v4.0.8             Symfony Validator Component
symfony/var-dumper           v4.0.8             v4.0.8             Symfony mechanism for exploring and dumping PHP variables
symfony/web-profiler-bundle  v4.0.8             v4.0.8             Symfony WebProfilerBundle
symfony/yaml                 v4.0.8             v4.0.8             Symfony Yaml Component

PHP version

$ php -v
PHP 7.2.4 (cli) (built: Apr  5 2018 00:37:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.4, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

Subject

in reader.xml there is config with bind key

        <defaults public="true">
            <bind key="$annotationReader" type="service" id="annotation_reader" />
        </defaults>

but when I change definition from

        <service id="sonata.annotation.reader.add_child" class="KunicMarko\SonataAnnotationBundle\Reader\AddChildReader" />

to

        <service id="sonata.annotation.reader.add_child" class="KunicMarko\SonataAnnotationBundle\Reader\AddChildReader" />
            <argument type="service" id="annotation_reader" />
        </service>

compiler pass and admin annotation works

Steps to reproduce

./bin/console cache:clear 

In AnnotationReaderTrait.php line 17:
                                                                               
  Type error: Too few arguments to function KunicMarko\SonataAnnotationBundle  
  \Reader\AddChildReader::__construct(), 0 passed and exactly 1 expected   

Expected results

compiler pass

@kunicmarko20
Copy link
Owner

Thank you for the report, the problem is that the service is used before the local service binding kicks in, so I have to add argument manually as you suggested.

@kunicmarko20
Copy link
Owner

@astronom I released new version https://github.com/kunicmarko20/SonataAnnotationBundle/releases/tag/1.1.1 , it should fix your problems.

@astronom
Copy link
Author

@kunicmarko20 thank you for bug fixing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants