Skip to content

PHP8 support #665

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
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
php-version:
- "7.4"
- "8.0"

steps:
- name: "Checkout"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ jobs:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
symfony-version:
- "4.4.x"
- "5.1.x"
- "5.2.x"
driver-version:
- "stable"
deps:
Expand Down
6 changes: 0 additions & 6 deletions Tests/Fixtures/Form/Guesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,12 @@ class Guesser
/** @ODM\Field(type="bool") */
public $boolField;

/** @ODM\Field(type="boolean") */
public $booleanField;

/** @ODM\Field(type="float") */
public $floatField;

/** @ODM\Field(type="int") */
public $intField;

/** @ODM\Field(type="integer") */
public $integerField;

/** @ODM\Field(type="collection") */
public $collectionField;

Expand Down
2 changes: 0 additions & 2 deletions Tests/Form/Type/GuesserTestType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('ts')
->add('categories', null, ['document_manager' => $options['dm']])
->add('boolField')
->add('booleanField')
->add('floatField')
->add('intField')
->add('integerField')
->add('collectionField')
->add('nonMappedField');
}
Expand Down
2 changes: 0 additions & 2 deletions Tests/Form/Type/TypeGuesserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ public function testTypesShouldBeGuessedCorrectly()
$this->assertType('datetime', $form->get('date'));
$this->assertType('datetime', $form->get('ts'));
$this->assertType('checkbox', $form->get('boolField'));
$this->assertType('checkbox', $form->get('booleanField'));
$this->assertType('number', $form->get('floatField'));
$this->assertType('integer', $form->get('intField'));
$this->assertType('integer', $form->get('integerField'));
$this->assertType('collection', $form->get('collectionField'));
$this->assertType('text', $form->get('nonMappedField'));
}
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
{"name": "Jonathan H. Wage", "email": "[email protected]"}
],
"require": {
"php": "^7.2",
"doctrine/annotations": "^1.2",
"doctrine/mongodb-odm": "^2.0.0",
"php": "^7.2 || ^8.0",

Choose a reason for hiding this comment

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

Would it make sense to use >=7.2 instead to keep it in line with Symfony's preferred versioning strategy?

Copy link
Member

Choose a reason for hiding this comment

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

No, that's a terrible strategy

"doctrine/annotations": "^1.6",
"doctrine/mongodb-odm": "^2.2",

Choose a reason for hiding this comment

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

Is this really necessary? The old ^2.0.0 would still allow 2.2 for PHP 8, but right now someone with PHP 7.2 would no longer be able to use doctrine/mongodb-odm 2.0/2.1.

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, the ^2.0.0 constraint should stay (unless there are some blockers but I don't think there'll be any)

Copy link
Author

Choose a reason for hiding this comment

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

Thank you guys for feedback reverted back to 2.0.0

"doctrine/persistence": "^1.3.6|^2.0",
"psr/log": "^1.0",
"symfony/config": "^4.3.3|^5.0",
"symfony/console": "^4.3.3|^5.0",
"symfony/dependency-injection": "^4.3.3|^5.0",
"symfony/doctrine-bridge": "^4.3.3|^5.0",
"symfony/config": "^4.3.3|^5.0",
"symfony/framework-bundle": "^4.3.3|^5.0",
"symfony/http-kernel": "^4.3.7|^5.0",
"symfony/options-resolver": "^4.3.3|^5.0"
Expand All @@ -29,7 +29,7 @@
"doctrine/data-fixtures": "<1.3"
},
"require-dev": {
"doctrine/coding-standard": "^6.0",
"doctrine/coding-standard": "^8.0",
"doctrine/data-fixtures": "^1.3",
"phpunit/phpunit": "^8.5 || ^9.3",
"squizlabs/php_codesniffer": "^3.5",
Expand Down