Skip to content
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

Make code php 7.3 lint-compatible #7325

Merged
merged 1 commit into from
Aug 2, 2018
Merged

Conversation

paxal
Copy link
Sponsor Contributor

@paxal paxal commented Jul 26, 2018

Current v2.6.2 raised a warning when ran on php 7.3 :

$ php7.3 -v ; find . -name '*.php' -exec php7.3 -l {} \;| grep -v '^No syntax errors'
PHP 7.3.0alpha4 (cli) (built: Jul 23 2018 11:02:37) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0alpha4, Copyright (c) 1999-2018, by Zend Technologies
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./lib/Doctrine/ORM/UnitOfWork.php on line 2718
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ./lib/Doctrine/ORM/UnitOfWork.php on line 2747

I changed the continue into break (meaning of continue; inside a switch), although continue 2 seems to be equivalent as there is no code after the switch statement.

Copy link
Contributor

@Majkl578 Majkl578 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
continue and break inside a switch behave identically and in both cases are used as early-exit here.

@Majkl578 Majkl578 added the Bug label Aug 2, 2018
@Majkl578 Majkl578 added this to the 2.6.3 milestone Aug 2, 2018
@Majkl578 Majkl578 merged commit f1143f5 into doctrine:2.6 Aug 2, 2018
@Majkl578
Copy link
Contributor

Majkl578 commented Aug 2, 2018

Note that the test suite was failing hard on 7.3 as well. :)

1) Doctrine\Tests\ORM\Persisters\BasicEntityPersisterCompositeTypeParametersTest::testExpandParametersWillExpandCompositeEntityKeys
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

/www/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:2718
/www/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:162
/www/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityManagerMock.php:81
/www/doctrine/orm/tests/Doctrine/Tests/OrmTestCase.php:163
/www/doctrine/orm/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeParametersTest.php:31

etc.

@Majkl578 Majkl578 self-assigned this Aug 2, 2018
@paxal paxal deleted the php73_compatible branch August 5, 2018 16:30
@paxal
Copy link
Sponsor Contributor Author

paxal commented Aug 6, 2018

Should I provide a patch for 2.7 as well, or will the same patch be applied as well ?

@andreybolonin
Copy link
Contributor

What about to release 2.6.3 with this bugfix ?

@Majkl578
Copy link
Contributor

Doesn't seem to be relevant to master, so not cherry-picking there.

@gudinoemiliano
Copy link

gudinoemiliano commented Oct 10, 2018

Anyone knows when this issue-fix will be available in a release? Thanks!

BenMorel added a commit to brick/geo that referenced this pull request Oct 14, 2018
@Ocramius
Copy link
Member

@gudinoemiliano most likely after 7.3.0 is released

@drzraf
Copy link

drzraf commented Nov 12, 2018

It not possible to run composer update --scripts on PHP 7.3 until the fixed release is actually published on packagist (since composer action are what trigger the bug).
Quite open and quite blocking.

@Ocramius
Copy link
Member

Closed, merged, handled. Will be released AFTER PHP 7.3 is out, as mentioned in #7325 (comment)

@teohhanhui
Copy link
Contributor

It means projects that depend on Doctrine cannot test their builds with PHP 7.3 before it's released. Not really an ideal situation...

@lcobucci
Copy link
Member

@gudinoemiliano @drzraf @teohhanhui we've just managed to release v2.6.3, have fun 👍

ixarlie added a commit to surexdirect/doctrine2 that referenced this pull request Jul 10, 2019
v2.6.3

[![Build Status](https://travis-ci.org/doctrine/doctrine2.svg?branch=v2.6.3)](https://travis-ci.org/doctrine/doctrine2)

This release provides fixes for many things, specially:

- Regression in commit order calculation
- BC-break in `EntityManager#find()` using optimistic lock outside of
  transaction
- PHP 7.3 compatibility issues

--------------------------------------------

- Total issues resolved: **8**
- Total pull requests resolved: **26**
- Total contributors: **26**

Documentation
-------------

 - [7472: fix incorrect phpdoc typehint](doctrine#7472) thanks to @seferov
 - [7465: Fixes tiny typo in the 'Working with DateTime instances' documentation](doctrine#7465) thanks to @unguul
 - [7444: Fixed URLs of doctrine-mapping.xsd in docs](doctrine#7444) thanks to @Naitsirch
 - [7441: $hydrationMode throughout can be a string as well as int (for custom modes)](doctrine#7441) thanks to @asgrim
 - [7435: Fix a typo on Documentation](doctrine#7435) thanks to @oguzdumanoglu
 - [7434: Removed FAQ paragraph stating public variables are disallowed](doctrine#7434) thanks to @Naitsirch and @flaushi
 - [7423: Update association-mapping.rst](doctrine#7423) thanks to @ThomasLandauer
 - [7421: JIRA to Github issues on Limitations and Known Issues](doctrine#7421) thanks to @seferov
 - [7412: Some formatting improvements](doctrine#7412) thanks to @ThomasLandauer
 - [7411: Autoload error when following the Getting Started Guide](doctrine#7411) thanks to @ThomasLandauer
 - [7401: &doctrine#91;docs&doctrine#93; Fix docblock in `inheritance-mapping.rst`](doctrine#7401) thanks to @bobdenotter
 - [7397: Update getting-started.rst](doctrine#7397) thanks to @eibt
 - [7394: Class 'Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver' not found](doctrine#7394) thanks to @ekosynth
 - [7378: Typo fix](doctrine#7378) thanks to @BenMorel
 - [7377: Fix query andX doctype](doctrine#7377) thanks to @sserbin
 - [7374: Deprecation message in documentation for YAML](doctrine#7374) thanks to @SenseException and @iltar
 - [7360: Document getPartialReference() properly](doctrine#7360) thanks to @lcobucci

Bug
---

 - [7471: Fix parameter value processing for objects with unloaded metadata](doctrine#7471) thanks to @alcaeus
 - [7367: Fix for BC break in 2.6.2 when calling EM::find() with LockMode::OPTIMISTIC outside of a TX](doctrine#7367) thanks to @timdev
 - [7328: Handle removed parameters by tree walker in Paginator](doctrine#7328) thanks to @plfort
 - [7325: Make code php 7.3 lint-compatible](doctrine#7325) thanks to @paxal
 - [7317: &doctrine#91;XML&doctrine#93; Fix default value of many-to-many order-by to ASC](doctrine#7317) thanks to @alexdenvir
 - [7260: Fix the handling of circular references in the commit order calculator](doctrine#7260) thanks to @stof
 - [6830: fix applying column options on foreign key columns](doctrine#6830) thanks to @Tobion

Improvement
-----------

 - [7428: CI: Test against PHP 7.3](doctrine#7428) thanks to @Majkl578
 - [7363: Fix compatibility with phan](doctrine#7363) thanks to @philippe-unitiz
 - [7345: Correct DOMDocument constructor in test](doctrine#7345) thanks to @guilliamxavier
 - [7307: Fix remaining usages of deprecated ClassLoader and Inflector from doctrine/common](doctrine#7307) thanks to @Majkl578 and @simonwelsh
stollr added a commit to stollr/doctrine-orm that referenced this pull request Oct 1, 2019
AkenRoberts added a commit to doctrine-extensions/DoctrineExtensions that referenced this pull request Aug 16, 2020
CI on PHP 7.3 is running into a nasty deprecation notice that was fixed upstream.

See doctrine/orm#7325
franmomu added a commit to franmomu/AliceDataFixtures that referenced this pull request Oct 2, 2020
There were some fixes for php 7.3 in doctrine/orm#7325
franmomu added a commit to franmomu/AliceDataFixtures that referenced this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants