-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Added Rector and Drupal Check and fixed Drupal 10 compatibility. #250
Conversation
fbaa754
to
e45edff
Compare
.travis.yml
Outdated
@@ -1,8 +1,6 @@ | |||
language: php | |||
|
|||
php: | |||
- 7.4 | |||
- 8.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to stop testing on PHP 8.0? It is still supported until October 2023.
I think for as long as we declare in composer.json to be compatible with PHP 7.4 we should also keep testing on 7.4. Probably we shouldn't drop PHP 7.4 support unless we plan to release a new major version.
I suppose the ./vendor/bin/drupal-check
test only works on PHP 8.1, but we can still run the remainder of the suite on older PHP versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drupal 10's requirement is to use 8.1. The CI may fail for 8.0 on D10.
Let me try to get this back and see how CI reacts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHP8 did not work
Your requirements could not be resolved to an installable set of packages.
Problem 1
- drupal/core-recommended[10.0.0-beta1, ..., 10.0.0-beta2] require symfony/process ~v6.1.3 -> satisfiable by symfony/process[v6.1.3].
- symfony/process[v6.1.0-BETA1, ..., v6.1.3] require php >=8.1 -> your php version (8.0.23) does not satisfy that requirement.
- Root composer.json requires drupal/core-recommended ^10@beta -> satisfiable by drupal/core-recommended[10.0.0-beta1, 10.0.0-beta2].
The command "composer install" failed and exited with 2 during .
https://app.travis-ci.com/github/jhedstrom/DrupalDriver/jobs/585619255
I've reverted my change so that we are only testing on PHP 8.1
If there is a different way to test with PHP 8.0 - please let me know and I will update this PR.
composer.json
Outdated
"phpcs --standard=./phpcs-ruleset.xml ." | ||
|
||
"phpcs --standard=./phpcs-ruleset.xml --ignore=drupal .", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not add the --ignore
option inline. Let's instead update the ignored paths in phpcs-ruleset.xml
:
<exclude-pattern>./drupal/*</exclude-pattern>
src/Drupal/Driver/Cores/Drupal8.php
Outdated
public function expandEntityBaseFields($entity_type, \stdClass $entity, array $base_fields) { | ||
public function expandEntityBaseFields($entity_type, $entity, array $base_fields) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the \stdClass
type hint? This is here to clarify that this is not a real entity but rather a "mocked" value object. It is literally a \stdClass
object so the type hint is correct. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This, as well as other changes, is a result of Rector's and drupal-check report. I don't remember what static analysis rule this was violating specifically, but it would not pass those tools.
We can revert and add an ignore comment for those tools to ignore this.
Please advise
@pfrenssen |
This reverts commit 2143a50.
@pfrenssen |
re: testing on previous PHP versions I think it is these lines that are causing those to not work:
They can probably either be removed, or switched to allow the older versions of Drupal as in the
|
@jhedstrom |
I think they just need to allow 8.4 and 9 like we do for the
(we could probably drop 8.x for now too, and then drop 9 when it is eol.) |
thank you @jhedstrom |
@AlexSkrypnyk I've opened #254 to track that. It should be a relatively small effort. Also, there's #249 that might be relevant to the version changes happening here for core libraries. |
# Conflicts: # .travis.yml
@claudiu-cristea @jhedstrom |
Thanks! |
@jhedstrom This PR introduced a conflict with older Drupal versions which seems like something that shouldn't happen in a See goalgorilla/open_social_dev#51 for the conflict message that this causes. |
Symfony\Process
in Drush Driver (copied from Fixed compatibility with Symfony\Process v4+ for Drush driver. #251 - sorry, had to keep it in this branch for downstream projects)Please note that Rector and Drupal check are only scanning Drupal 8 driver.