Skip to content

Commit

Permalink
Bumping PHP min. requirement to 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsizemore committed Jan 12, 2024
1 parent 9ebd203 commit c71b894
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.1', '8.2', '8.3' ]
php: [ '8.2', '8.3' ]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.1', '8.2', '8.3', '8.4' ]
php: [ '8.2', '8.3', '8.4' ]
steps:
- uses: actions/checkout@v4
with:
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
"security": "https://github.com/ericsizemore/simple_tpl/security/policy"
},
"require": {
"php": "^8.1 <8.5"
"php": "^8.2 <8.5"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.45",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-phpunit": "^1.4",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "^10.5",
"rector/rector": "^0.19"
"friendsofphp/php-cs-fixer": ">=3.45",
"phpstan/phpstan": ">=1.11",
"phpstan/phpstan-phpunit": ">=1.4",
"phpstan/phpstan-strict-rules": ">=1.6",
"phpunit/phpunit": ">=10.5",
"rector/rector": "dev-main"
},
"minimum-stability": "dev",
"autoload": {
Expand Down
34 changes: 19 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
__DIR__ . '/tests/src',
]);

$rectorConfig->phpVersion(PhpVersion::PHP_81);
$rectorConfig->phpVersion(PhpVersion::PHP_82);
$rectorConfig->phpVersion(PhpVersion::PHP_83);
//$rectorConfig->importNames();
Expand All @@ -29,7 +28,7 @@
SetList::NAMING,
SetList::PRIVATIZATION,
SetList::EARLY_RETURN,
LevelSetList::UP_TO_PHP_81,
LevelSetList::UP_TO_PHP_82,
PHPUnitSetList::PHPUNIT_100,
]);
$rectorConfig->skip([LocallyCalledStaticMethodToNonStaticRector::class]);
Expand Down
16 changes: 13 additions & 3 deletions tests/src/TemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
#[CoversClass(Template::class)]
final class TemplateTest extends TestCase
{
protected static string $testDir;
private static string $testDir;

/**
* @var array<string>
*/
protected static array $testFiles;
private static array $testFiles;

public static function setUpBeforeClass(): void
{
self::$testDir = __DIR__ . \DIRECTORY_SEPARATOR . 'dir1';
Expand All @@ -62,16 +64,18 @@ public static function setUpBeforeClass(): void
\touch(self::$testFiles['file2']);
}
}

public static function tearDownAfterClass(): void
{
\unlink(self::$testFiles['file1']);
\unlink(self::$testFiles['file2']);
\usleep(90000);
\usleep(100000);
\rmdir(self::$testDir);

self::$testDir = '';
self::$testFiles = [];
}

/**
* Test setLeftDelimiter()
*/
Expand All @@ -85,6 +89,7 @@ public function testSetLeftDelimiter(): void
$template->setLeftDelimiter('{');
self::assertEquals('{', $template->getLeftDelimiter());
}

/**
* Test setRightDelimiter()
*/
Expand All @@ -98,6 +103,7 @@ public function testSetRightDelimiter(): void
$template->setRightDelimiter('}');
self::assertEquals('}', $template->getRightDelimiter());
}

/**
* Test assign() and toArray()
*/
Expand All @@ -115,6 +121,7 @@ public function testAssign(): void
'content' => 'This is a test of the Simple Template Engine class by Eric Sizemore.'
], $template->toArray());
}

/**
* Test display()
*/
Expand Down Expand Up @@ -168,6 +175,7 @@ public function testDisplay(): void
html_WRAP
, $data);
}

/**
* Test parse() with non-existent file
*/
Expand All @@ -180,6 +188,7 @@ public function testParseInvalidFile(): void

$template->parse('/this/should/not/exist.tpl');
}

/**
* Test parse() with empty file
*/
Expand All @@ -194,6 +203,7 @@ public function testParseEmptyFile(): void

$template->parse(self::$testFiles['file2']);
}

/**
* Test parse()
*/
Expand Down

0 comments on commit c71b894

Please sign in to comment.