Skip to content

Commit

Permalink
Merge pull request #391 from bartmcleod/php8-support
Browse files Browse the repository at this point in the history
Php8 support
  • Loading branch information
bartmcleod authored Apr 5, 2021
2 parents 1ae3f19 + e38c0f0 commit 14f7178
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: false

php:
- 7.4
# - 8.0 PHP 7.1 requires a version of PHPUnit (7.5.2) that is too old for 8.0
- 8.0

matrix:
fast_finish: true
Expand All @@ -14,7 +14,6 @@ services:
- mysql

env:
- SYMFONY_VERSION=5.0.* DB=pdo_mysql DB_USER=root DB_NAME=lexik_test DEPENDENCIES=alpha
- SYMFONY_VERSION=5.2.* DB=pdo_mysql DB_USER=root DB_NAME=lexik_test DEPENDENCIES=alpha
cache:
directories:
Expand Down
8 changes: 4 additions & 4 deletions Tests/Command/ImportTranslationsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ImportTranslationsCommandTest extends WebTestCase
/**
*
*/
public function setUp()
public function setUp(): void
{
static::$kernel = static::createKernel();
static::$kernel->boot();
Expand Down Expand Up @@ -102,9 +102,9 @@ public function testExecute()
$resultLines = explode("\n", $commandTester->getDisplay());

$this->assertEquals('# LexikTranslationBundle:', $resultLines[0]);
$this->assertRegExp('/Using dir (.)+\/Resources\/translations to lookup translation files/', $resultLines[1]);
$this->assertRegExp('/translations\/LexikTranslationBundle\.((fr)|(en))\.yml" \.\.\. 30 translations/', $resultLines[2]);
$this->assertRegExp('/translations\/LexikTranslationBundle\.((fr)|(en))\.yml" \.\.\. 30 translations/', $resultLines[3]);
$this->assertMatchesRegularExpression('/Using dir (.)+\/Resources\/translations to lookup translation files/', $resultLines[1]);
$this->assertMatchesRegularExpression('/translations\/LexikTranslationBundle\.((fr)|(en))\.yml" \.\.\. 30 translations/', $resultLines[2]);
$this->assertMatchesRegularExpression('/translations\/LexikTranslationBundle\.((fr)|(en))\.yml" \.\.\. 30 translations/', $resultLines[3]);
$this->assertEquals('Removing translations cache files ...', $resultLines[4]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CleanTranslationCacheListenerTest extends TestCase

private $tempDir;

public function setUp()
public function setUp(): void
{
$this->tempDir = \sys_get_temp_dir() . '/translations';
}
Expand Down Expand Up @@ -81,7 +81,7 @@ private function countFiles($lastUpdateTime)
return $finder->count();
}

public function tearDown()
public function tearDown(): void
{
\array_map('unlink', \glob($this->tempDir . "/*"));
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Translation/Exporter/JsonExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class JsonExporterTest extends TestCase
{
private $outFileName = '/file.out';

public function tearDown()
public function tearDown(): void
{
if (file_exists(__DIR__.$this->outFileName)) {
unlink(__DIR__.$this->outFileName);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Translation/Exporter/PhpExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PhpExporterTest extends TestCase
{
private $outFileName = '/file.out';

public function tearDown()
public function tearDown(): void
{
$outFile = __DIR__.$this->outFileName;

Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Translation/Exporter/XliffExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class XliffExporterTest extends TestCase
{
private $outFileName = '/file.en.out';

public function tearDown()
public function tearDown(): void
{
$outFile = __DIR__ . $this->outFileName;

Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Translation/Exporter/YamlExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class YamlExporterTest extends TestCase
{
private $outFileName = '/file.out';

public function tearDown()
public function tearDown(): void
{
$outFile = __DIR__.$this->outFileName;

Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Translation/Manager/FileManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class FileManagerTest extends BaseUnitTestCase
*/
private $rootDir = '/test/root/dir/app';

public function setUp()
public function setUp(): void
{
$this->em = $this->getMockSqliteEntityManager();
$this->createSchema($this->em);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Translation/Manager/TransUnitManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TransUnitManagerTest extends BaseUnitTestCase
*/
private $rootDir = '/test/root/dir/app';

public function setUp()
public function setUp(): void
{
$this->em = $this->getMockSqliteEntityManager();
$this->createSchema($this->em);
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
}
],
"require": {
"php": "^7.4",
"symfony/framework-bundle": "~4.0|~5.0"
"php": "^7.4|^8.0",
"symfony/framework-bundle": "~5.2"
},
"require-dev": {
"ext-mongodb": "*",
Expand All @@ -27,11 +27,12 @@
"doctrine/doctrine-bundle": "^2.2",
"doctrine/data-fixtures": "~1.1",
"doctrine/mongodb-odm-bundle": "~4.2",
"propel/propel": "2.0.0-alpha10|dev-master",
"phpunit/phpunit": "~7.5.2",
"propel/propel": "2.0.0-alpha12|dev-master",
"phpunit/phpunit": "^9.5",
"doctrine/mongodb-odm": "^2.1",
"mongodb/mongodb": "^1.8",
"ext-pdo": "*"
"ext-pdo": "*",
"mikey179/vfsstream": "^1.6"
},
"suggest": {
"doctrine/orm": ">=2.4"
Expand Down

0 comments on commit 14f7178

Please sign in to comment.