Skip to content

Commit

Permalink
Merge pull request #662 from lepiaf/support-php8
Browse files Browse the repository at this point in the history
Add support for PHP 8
  • Loading branch information
malarzm authored Feb 1, 2021
2 parents 5335ca7 + 00b0dfd commit 3cc1392
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
matrix:
php-version:
- "7.4"
- "8.0"

steps:
- name: "Checkout"
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
symfony-version:
- "4.4.x"
- "5.1.x"
Expand Down Expand Up @@ -85,14 +86,20 @@ jobs:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist"

- name: "Run PHPUnit"
- name: "Run PHPUnit with coverage"
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
if: "${{ matrix.php-version != '8.0' }}"

- name: "Run PHPUnit without coverage"
run: "vendor/bin/phpunit"
if: "${{ matrix.php-version == '8.0' }}"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v2"
with:
name: "phpunit-${{ matrix.php-version }}.coverage"
path: "coverage.xml"
if: "${{ matrix.php-version != '8.0' }}"

upload_coverage:
name: "Upload coverage to Codecov"
Expand Down
1 change: 1 addition & 0 deletions Tests/DataCollector/CommandDataCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ public function testCollector(): void
$collector = new CommandDataCollector(new CommandLogger());

$collector->collect($request = new Request(['group' => '0']), $response = new Response());
$this->assertSame(0, $collector->getCommandCount());
}
}
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 @@ -22,10 +22,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 @@ -68,10 +68,8 @@ public function testTypesShouldBeGuessedCorrectly(): void
$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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{"name": "Jonathan H. Wage", "email": "jonwage@gmail.com"}
],
"require": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"doctrine/annotations": "^1.2",
"doctrine/mongodb-odm": "^2.0.0",
"doctrine/persistence": "^1.3.6|^2.0",
Expand Down

0 comments on commit 3cc1392

Please sign in to comment.