Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Container builder seems to create Invalid PHP Syntax #46627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexander-schranz opened this issue Jun 9, 2022 · 3 comments · Fixed by #46628
Closed

Container builder seems to create Invalid PHP Syntax #46627

alexander-schranz opened this issue Jun 9, 2022 · 3 comments · Fixed by #46628

Comments

@alexander-schranz
Copy link
Contributor

alexander-schranz commented Jun 9, 2022

Symfony version(s) affected

6.2.0@dev (not on 6.1.*)

Description

I'm running into a strange issues with building the container in @sulu: https://github.com/sulu/sulu/runs/6810915566?check_suite_focus=true#logs

The generated code looks like this:

<?php
        return $this->services['doctrine_phpcr.session'] = new \Sulu\Bundle\DocumentManagerBundle\Session\Session([$this->privates['doctrine_phpcr.jackalope.repository.factory.service.doctrinedbal']
            ??= new \Jackalope\RepositoryFactoryDoctrineDBAL()->getRepository([
                'jackalope.doctrine_dbal_connection' => (
                    $this->services['doctrine.dbal.default_connection'] 
                    ?? $this->getDoctrine_Dbal_DefaultConnectionService()
                ),
                'jackalope.data_caches' => ['meta' => ($this->privates['doctrine_phpcr.meta_cache_provider'] 
                    ?? $this->getDoctrinePhpcr_MetaCacheProviderService()), 'nodes' => ($this->privates['doctrine_phpcr.nodes_cache_provider'] 
                    ?? $this->getDoctrinePhpcr_NodesCacheProviderService())
                ],
                'jackalope.check_login_on_server' => false]), 'login'](
                    new \PHPCR\SimpleCredentials('admin', 'admin'),
                    $this->getEnv('PHPCR_WORKSPACE')
                )
        );

So it looks like ??= new \Jackalope\RepositoryFactoryDoctrineDBAL()->
Should be:
??= (new \Jackalope\RepositoryFactoryDoctrineDBAL()).

Used PHP version: 8.1.6

How to reproduce

Copy following snippet into your terminal to reproduce it (requires PHP 8.1):

git clone [email protected]:sulu/sulu.git
cd sulu
git remote add alex [email protected]:alexander-schranz/sulu.git
git checkout alex/enhancement/update-from-skeleton
composer config minimum-stability dev
composer update

bin/console cache:clear

Possible Solution

Not sure what does cause the issue yet. It does not appear on 6.1.0 so maybe its also just a current @dev problem. Just thought I already greate an issue so maybe avoiding that it maybe can be target before being tagged.

Additional Context

No response

@alexander-schranz alexander-schranz changed the title Container builder seems to create Invald PHP Syntax Container builder seems to create Invalid PHP Syntax Jun 9, 2022
@xabbuh
Copy link
Member

xabbuh commented Jun 10, 2022

@alexander-schranz The description says 6.1@dev. Did you mean 6.2@dev instead?

@alexander-schranz
Copy link
Contributor Author

@xabbuh yeah it was ^6.1@dev so it installed 6.2.

nicolas-grekas added a commit that referenced this issue Jun 10, 2022
This PR was merged into the 6.2 branch.

Discussion
----------

[DependencyInjection] fix dumped container

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #46627
| License       | MIT
| Doc PR        | -

Introduced in #46459

Commits
-------

8e1db2a [DependencyInjection] fix dumped container
@alexander-schranz
Copy link
Contributor Author

Thank you for the quick fix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants