Problem/Motivation
Running the tests at 9.1 with deprecations un-supressed produces the deprecation warning
Declaring ::setUp without a void return typehint in {...} is deprecated in drupal:9.0.0. Typehinting will be required before drupal:10.0.0. See https://www.drupal.org/node/3114724
The Change Record is https://www.drupal.org/node/3114724
There are 297 warnings, all with the same message, covering a large number of Unit, Kernel and Functional tests. The message says that this is deprecated in 9.0.0 but this warning is not produced at 9.0, neither on drupal.org nor travis testing. It is only shown for core 9.1
As per the Typed Data issue #3165602: Declaring ::setUp without a void return typehint is deprecated in drupal:9.0.0 this will probably be postponed until PHP7.1 is the minimum version we need to support.
Comments
Comment #2
tr commentedIn #3165602: Declaring ::setUp without a void return typehint is deprecated in drupal:9.0.0 I eventually agreed with you that we can do this now, at least in Typed Data, because this only affects the tests and because we do not run (and do not plant to ever run) PHP 7.0 tests in DrupalCI.
Because there is a BC layer for this change in Drupal 8, I think we should also be able to make this change now in Rules?
@jonathan1055: Can you roll a patch for this so that it can be tested here on DrupalCI? If it passes, I can commit it.
Comment #3
Pooja Ganjage commentedHi,
I am creating a patch for this issue.
Please review the patch.
Thanks.
Comment #4
Pooja Ganjage commentedComment #5
jonathan1055 commentedThanks Pooja, that's great. Good to see it runs OK at 8.8.
However, we need to check the deprecations at core 9.1. To do this, please can you make a new patch with everything from #3 plus the creation of the new file drupalci.yml as in patch #24 from #3089502-24: [meta] Rules deprecated code (you can take that patch #24 and append it to yours). Then test it at core 9.1. There will be other failures, due to other deprecations, but we can see if this particular message is removed with your changes.
Jonathan
Comment #6
Pooja Ganjage commentedUploading new patch.
Comment #7
Pooja Ganjage commentedComment #8
tr commented"Patch Failed to Apply"
Comment #9
Pooja Ganjage commentedUploading new patch.
Comment #10
Pooja Ganjage commentedComment #11
Pooja Ganjage commentedComment #12
jonathan1055 commentedHi Pooja,
Your patch #9 has
modules/contrib/rules/before every file name. This is wrong, as the patch is applied from within the Rules root folder. You patch in #6 was much closer to being correct. If you look at the test result for that patch, you can see the errorThe drupalci.yml file does not exist, and this patch should be creating the file. In the 3089502-24.show_deprecations_via_drupalci.patch you can see
whereas your patch has a/drupalci.yml instead of /dev/null. So, I suggest you go back to patch #6 and change it to /dev/null and forget #9. Hope that helps.
Comment #13
msutharsComment #14
tr commentedI didn't mean to change the title in #8.
@msuthars: Why did you assign this to yourself?
Comment #15
msutharsUpdated the patch as suggested by @jonathan1055. Please review.
Comment #16
jonathan1055 commentedThank you @msuthars, this looks good on first viewing. I have now queued it for testing at core 9.1 because that is where the deprecations are produced. This test will fail as there are other deprecations, but it should show that the ':setUp without a void return' message has been solved.
Comment #17
jonathan1055 commentedThis is good. You can see in Patch #15 test https://www.drupal.org/pift-ci-job/1836908 that there are no "void" messages and we get 272 pass, 19 fail. On the existing codebase Patch #24 on the meta issue https://www.drupal.org/pift-ci-job/1832280 there are many "void" messages and the numbers at the top show 71 pass, 82 fail.
It's unfortunate that the drupal.org testbot output does not have a simple summary consolidating the deprecation messages, but I can show via Travis testing that the deprecations have dropped from 863 to 566, i.e. all 297 'void typehint' are solved by this patch.
Patch #17 makes the identical code changes, but has the drupalci.yml file removed, and the necessary changes to .travis.yml added, so this is ready for committing.
Comment #18
jonathan1055 commentedPatch #18 only changes .travis.yml to cater for a new 13x deprecation which was committed to core 9.1 today. I will raise a Rules issue in due course, but good to get the travis tests passing with this.
Comment #19
tr commentedCommitted.
Comment #21
jonathan1055 commentedThanks @Pooja Ganjage, @msuthars and @TR