summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml4
-rw-r--r--README.md2
-rw-r--r--docker-compose.yml5
-rwxr-xr-xrun-tests-for-all-php-versions.sh1
-rw-r--r--src/Cacheresource/Base.php2
-rw-r--r--src/Cacheresource/Custom.php2
-rw-r--r--src/Cacheresource/File.php2
-rw-r--r--src/Cacheresource/KeyValueStore.php2
-rw-r--r--src/Compiler/CodeFrame.php2
-rw-r--r--src/Compiler/Template.php2
-rw-r--r--src/CompilerException.php4
-rw-r--r--src/Resource/BasePlugin.php2
-rw-r--r--src/Resource/CustomPlugin.php2
-rw-r--r--src/Resource/ExtendsPlugin.php2
-rw-r--r--src/Resource/FilePlugin.php2
-rw-r--r--src/Resource/StreamPlugin.php2
-rw-r--r--src/Resource/StringPlugin.php2
-rw-r--r--src/Runtime/InheritanceRuntime.php2
-rw-r--r--src/Template.php6
-rw-r--r--src/Template/Source.php6
-rw-r--r--src/TemplateBase.php2
-rw-r--r--tests/PHPUnit_Smarty.php2
-rw-r--r--tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/resource.filetest.php2
-rw-r--r--tests/UnitTests/ResourceTests/Custom/Ambiguous/PHPunitplugins/resource.ambiguous.php2
-rw-r--r--tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db.php2
-rw-r--r--tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db2.php2
-rw-r--r--tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db3.php2
-rw-r--r--tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db4.php2
-rw-r--r--tests/UnitTests/__shared/resources/resource.extendsall.php2
-rw-r--r--utilities/testrunners/php84/Dockerfile10
30 files changed, 51 insertions, 31 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 12758b83..b842c53f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,6 +33,7 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
+ - "8.4"
compiler:
- default
@@ -50,6 +51,9 @@ jobs:
- os: ubuntu-latest
php-version: "8.3"
compiler: jit
+ - os: ubuntu-latest
+ php-version: "8.4"
+ compiler: jit
steps:
- name: Checkout
diff --git a/README.md b/README.md
index f73647e5..755d73ea 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Smarty is a template engine for PHP, facilitating the separation of presentation
Read the [documentation](https://smarty-php.github.io/smarty/) to find out how to use it.
## Requirements
-Smarty v5 can be run with PHP 7.2 to PHP 8.3.
+Smarty v5 can be run with PHP 7.2 to PHP 8.4.
## Installation
Smarty versions 3.1.11 or later can be installed with [Composer](https://getcomposer.org/).
diff --git a/docker-compose.yml b/docker-compose.yml
index 7ecd8b43..de519b2b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -42,6 +42,11 @@ services:
service: base
build:
dockerfile: ./utilities/testrunners/php83/Dockerfile
+ php84:
+ extends:
+ service: base
+ build:
+ dockerfile: ./utilities/testrunners/php84/Dockerfile
volumes:
smarty-code:
diff --git a/run-tests-for-all-php-versions.sh b/run-tests-for-all-php-versions.sh
index 494b127b..efff5713 100755
--- a/run-tests-for-all-php-versions.sh
+++ b/run-tests-for-all-php-versions.sh
@@ -14,3 +14,4 @@ $COMPOSE_CMD run --rm php80 ./run-tests.sh $@ && \
$COMPOSE_CMD run --rm php81 ./run-tests.sh $@ && \
$COMPOSE_CMD run --rm php82 ./run-tests.sh $@
$COMPOSE_CMD run --rm php83 ./run-tests.sh $@
+$COMPOSE_CMD run --rm php84 ./run-tests.sh $@
diff --git a/src/Cacheresource/Base.php b/src/Cacheresource/Base.php
index 54a14192..41c4f6bc 100644
--- a/src/Cacheresource/Base.php
+++ b/src/Cacheresource/Base.php
@@ -44,7 +44,7 @@ abstract class Base
*/
abstract public function process(
Template $_template,
- Cached $cached = null,
+ ?Cached $cached = null,
$update = false
);
diff --git a/src/Cacheresource/Custom.php b/src/Cacheresource/Custom.php
index c049246c..f9eb858e 100644
--- a/src/Cacheresource/Custom.php
+++ b/src/Cacheresource/Custom.php
@@ -139,7 +139,7 @@ abstract class Custom extends Base
*/
public function process(
Template $_smarty_tpl,
- \Smarty\Template\Cached $cached = null,
+ ?\Smarty\Template\Cached $cached = null,
$update = false
) {
if (!$cached) {
diff --git a/src/Cacheresource/File.php b/src/Cacheresource/File.php
index 538f0103..4b4198ec 100644
--- a/src/Cacheresource/File.php
+++ b/src/Cacheresource/File.php
@@ -99,7 +99,7 @@ class File extends Base
*/
public function process(
Template $_smarty_tpl,
- Cached $cached = null,
+ ?Cached $cached = null,
$update = false
) {
$_smarty_tpl->getCached()->setValid(false);
diff --git a/src/Cacheresource/KeyValueStore.php b/src/Cacheresource/KeyValueStore.php
index 733d2776..1953bb20 100644
--- a/src/Cacheresource/KeyValueStore.php
+++ b/src/Cacheresource/KeyValueStore.php
@@ -103,7 +103,7 @@ abstract class KeyValueStore extends Base
*/
public function process(
Template $_smarty_tpl,
- Cached $cached = null,
+ ?Cached $cached = null,
$update = false
) {
if (!$cached) {
diff --git a/src/Compiler/CodeFrame.php b/src/Compiler/CodeFrame.php
index 5e782150..d0e1cc12 100644
--- a/src/Compiler/CodeFrame.php
+++ b/src/Compiler/CodeFrame.php
@@ -41,7 +41,7 @@ class CodeFrame
$content = '',
$functions = '',
$cache = false,
- \Smarty\Compiler\Template $compiler = null
+ ?\Smarty\Compiler\Template $compiler = null
) {
// build property code
$properties[ 'version' ] = \Smarty\Smarty::SMARTY_VERSION;
diff --git a/src/Compiler/Template.php b/src/Compiler/Template.php
index 9b2c1a1f..de802e1c 100644
--- a/src/Compiler/Template.php
+++ b/src/Compiler/Template.php
@@ -374,7 +374,7 @@ class Template extends BaseCompiler {
* @throws CompilerException
* @throws Exception
*/
- public function compileTemplateSource(\Smarty\Template $template, \Smarty\Compiler\Template $parent_compiler = null) {
+ public function compileTemplateSource(\Smarty\Template $template, ?\Smarty\Compiler\Template $parent_compiler = null) {
try {
// save template object in compiler class
$this->template = $template;
diff --git a/src/CompilerException.php b/src/CompilerException.php
index e3d67b46..60af9db7 100644
--- a/src/CompilerException.php
+++ b/src/CompilerException.php
@@ -16,14 +16,14 @@ class CompilerException extends Exception {
* @param int $code The Exception code.
* @param string|null $filename The filename where the exception is thrown.
* @param int|null $line The line number where the exception is thrown.
- * @param Throwable|null $previous The previous exception used for the exception chaining.
+ * @param \Throwable|null $previous The previous exception used for the exception chaining.
*/
public function __construct(
string $message = "",
int $code = 0,
?string $filename = null,
?int $line = null,
- Throwable $previous = null
+ ?\Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
diff --git a/src/Resource/BasePlugin.php b/src/Resource/BasePlugin.php
index 56f7dfa0..6d222223 100644
--- a/src/Resource/BasePlugin.php
+++ b/src/Resource/BasePlugin.php
@@ -112,7 +112,7 @@ abstract class BasePlugin
* @param Source $source source object
* @param Template|null $_template template object
*/
- abstract public function populate(Source $source, \Smarty\Template $_template = null);
+ abstract public function populate(Source $source, ?\Smarty\Template $_template = null);
/**
* populate Source Object with timestamp and exists from Resource
diff --git a/src/Resource/CustomPlugin.php b/src/Resource/CustomPlugin.php
index b50ef7aa..895e9710 100644
--- a/src/Resource/CustomPlugin.php
+++ b/src/Resource/CustomPlugin.php
@@ -50,7 +50,7 @@ abstract class CustomPlugin extends BasePlugin {
* @param Source $source source object
* @param Template|null $_template template object
*/
- public function populate(Source $source, Template $_template = null) {
+ public function populate(Source $source, ?Template $_template = null) {
$source->uid = sha1($source->type . ':' . $source->name);
$mtime = $this->fetchTimestamp($source->name);
if ($mtime !== null) {
diff --git a/src/Resource/ExtendsPlugin.php b/src/Resource/ExtendsPlugin.php
index 0f9c9de2..960e3797 100644
--- a/src/Resource/ExtendsPlugin.php
+++ b/src/Resource/ExtendsPlugin.php
@@ -23,7 +23,7 @@ class ExtendsPlugin extends BasePlugin
*
* @throws Exception
*/
- public function populate(Source $source, Template $_template = null)
+ public function populate(Source $source, ?Template $_template = null)
{
$uid = '';
$sources = array();
diff --git a/src/Resource/FilePlugin.php b/src/Resource/FilePlugin.php
index c5959578..0033c834 100644
--- a/src/Resource/FilePlugin.php
+++ b/src/Resource/FilePlugin.php
@@ -32,7 +32,7 @@ class FilePlugin extends BasePlugin {
*
* @throws Exception
*/
- public function populate(Source $source, Template $_template = null) {
+ public function populate(Source $source, ?Template $_template = null) {
$source->uid = sha1(
$source->name . ($source->isConfig ? $source->getSmarty()->_joined_config_dir :
diff --git a/src/Resource/StreamPlugin.php b/src/Resource/StreamPlugin.php
index 91afffdc..9b5b3f57 100644
--- a/src/Resource/StreamPlugin.php
+++ b/src/Resource/StreamPlugin.php
@@ -33,7 +33,7 @@ class StreamPlugin extends RecompiledPlugin {
*
* @return void
*/
- public function populate(Source $source, Template $_template = null) {
+ public function populate(Source $source, ?Template $_template = null) {
$source->uid = false;
$source->content = $this->getContent($source);
$source->timestamp = $source->exists = !!$source->content;
diff --git a/src/Resource/StringPlugin.php b/src/Resource/StringPlugin.php
index 6b5bee4d..fb3692c7 100644
--- a/src/Resource/StringPlugin.php
+++ b/src/Resource/StringPlugin.php
@@ -31,7 +31,7 @@ class StringPlugin extends BasePlugin {
*
* @return void
*/
- public function populate(Source $source, Template $_template = null) {
+ public function populate(Source $source, ?Template $_template = null) {
$source->uid = sha1($source->name);
$source->timestamp = $source->exists = true;
}
diff --git a/src/Runtime/InheritanceRuntime.php b/src/Runtime/InheritanceRuntime.php
index ffd7aae6..74ea8544 100644
--- a/src/Runtime/InheritanceRuntime.php
+++ b/src/Runtime/InheritanceRuntime.php
@@ -162,7 +162,7 @@ class InheritanceRuntime {
private function processBlock(
Template $tpl,
\Smarty\Runtime\Block $block,
- \Smarty\Runtime\Block $parent = null
+ ?\Smarty\Runtime\Block $parent = null
) {
if ($block->hide && !isset($block->child)) {
return;
diff --git a/src/Template.php b/src/Template.php
index fcb0f58d..242fb238 100644
--- a/src/Template.php
+++ b/src/Template.php
@@ -115,7 +115,7 @@ class Template extends TemplateBase {
public function __construct(
$template_resource,
Smarty $smarty,
- \Smarty\Data $_parent = null,
+ ?\Smarty\Data $_parent = null,
$_cache_id = null,
$_compile_id = null,
$_caching = null,
@@ -248,7 +248,7 @@ class Template extends TemplateBase {
$caching,
$cache_lifetime,
array $extra_vars = [],
- int $scope = null,
+ ?int $scope = null,
?string $currentDir = null
) {
@@ -462,7 +462,7 @@ class Template extends TemplateBase {
* @return string
* @throws Exception
*/
- public function createCodeFrame($content = '', $functions = '', $cache = false, \Smarty\Compiler\Template $compiler = null) {
+ public function createCodeFrame($content = '', $functions = '', $cache = false, ?\Smarty\Compiler\Template $compiler = null) {
return $this->getCodeFrameCompiler()->create($content, $functions, $cache, $compiler);
}
diff --git a/src/Template/Source.php b/src/Template/Source.php
index 382e710a..2ef13a48 100644
--- a/src/Template/Source.php
+++ b/src/Template/Source.php
@@ -134,9 +134,9 @@ class Source {
* @throws Exception
*/
public static function load(
- Template $_template = null,
- Smarty $smarty = null,
- $template_resource = null
+ ?Template $_template = null,
+ ?Smarty $smarty = null,
+ $template_resource = null
) {
if ($_template) {
$smarty = $_template->getSmarty();
diff --git a/src/TemplateBase.php b/src/TemplateBase.php
index 3674edf7..f01d1107 100644
--- a/src/TemplateBase.php
+++ b/src/TemplateBase.php
@@ -179,7 +179,7 @@ abstract class TemplateBase extends Data {
* @api Smarty::createData()
*
*/
- public function createData(Data $parent = null, $name = null) {
+ public function createData(?Data $parent = null, $name = null) {
/* @var Smarty $smarty */
$smarty = $this->getSmarty();
$dataObj = new Data($parent, $smarty, $name);
diff --git a/tests/PHPUnit_Smarty.php b/tests/PHPUnit_Smarty.php
index 18b4112f..029c8f90 100644
--- a/tests/PHPUnit_Smarty.php
+++ b/tests/PHPUnit_Smarty.php
@@ -64,7 +64,7 @@ class PHPUnit_Smarty extends PHPUnit\Framework\TestCase
*/
public static function setUpBeforeClass(): void
{
- error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED & ~E_USER_DEPRECATED);
+ error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);
self::$init = true;
self::$pluginsdir =self::getSmartyPluginsDir();
}
diff --git a/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/resource.filetest.php b/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/resource.filetest.php
index 0aa280c4..40995a61 100644
--- a/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/resource.filetest.php
+++ b/tests/UnitTests/CacheResourceTests/_shared/PHPunitplugins/resource.filetest.php
@@ -12,7 +12,7 @@ class Smarty_Resource_FiletestPlugin extends FilePlugin
* @param Source $source source object
* @param Template $_template template object
*/
- public function populate(Source $source, Template $_template = null)
+ public function populate(Source $source, ?Template $_template = null)
{
parent::populate($source, $_template);
if ($source->exists) {
diff --git a/tests/UnitTests/ResourceTests/Custom/Ambiguous/PHPunitplugins/resource.ambiguous.php b/tests/UnitTests/ResourceTests/Custom/Ambiguous/PHPunitplugins/resource.ambiguous.php
index 85ffadd5..0e5d173d 100644
--- a/tests/UnitTests/ResourceTests/Custom/Ambiguous/PHPunitplugins/resource.ambiguous.php
+++ b/tests/UnitTests/ResourceTests/Custom/Ambiguous/PHPunitplugins/resource.ambiguous.php
@@ -34,7 +34,7 @@ class Smarty_Resource_AmbiguousPlugin extends FilePlugin
* @param Source $source source object
* @param Template $_template template object
*/
- public function populate(Source $source, Template $_template = null)
+ public function populate(Source $source, ?Template $_template = null)
{
$segment = '';
if ($this->segment) {
diff --git a/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db.php b/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db.php
index 59315504..9f983912 100644
--- a/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db.php
+++ b/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db.php
@@ -16,7 +16,7 @@ use Smarty\Template\Source;
class Smarty_Resource_Db extends RecompiledPlugin {
- public function populate(Source $source, Template $_template = null) {
+ public function populate(Source $source, ?Template $_template = null) {
$source->uid = sha1($source->resource);
$source->timestamp = 1000000000;
$source->exists = true;
diff --git a/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db2.php b/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db2.php
index a4f65402..2eefc6c9 100644
--- a/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db2.php
+++ b/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db2.php
@@ -16,7 +16,7 @@ use Smarty\Template\Source;
class Smarty_Resource_Db2 extends RecompiledPlugin
{
- public function populate(Source $source, Template $_template = null)
+ public function populate(Source $source, ?Template $_template = null)
{
$source->uid = sha1($source->resource);
$source->timestamp = 0;
diff --git a/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db3.php b/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db3.php
index 455255e2..7bd904e2 100644
--- a/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db3.php
+++ b/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db3.php
@@ -15,7 +15,7 @@ use Smarty\Template\Source;
class Smarty_Resource_Db3 extends Smarty\Resource\BasePlugin
{
- public function populate(Source $source, Template $_template = null)
+ public function populate(Source $source, ?Template $_template = null)
{
$source->uid = sha1($source->resource);
$source->timestamp = 0;
diff --git a/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db4.php b/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db4.php
index 571df0d8..51162a0b 100644
--- a/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db4.php
+++ b/tests/UnitTests/ResourceTests/ResourcePlugins/PHPunitplugins/resource.db4.php
@@ -16,7 +16,7 @@ use Smarty\Template\Source;
class Smarty_Resource_Db4 extends Smarty\Resource\BasePlugin
{
- public function populate(Source $source, Template $_template = null)
+ public function populate(Source $source, ?Template $_template = null)
{
$source->uid = sha1($source->resource);
$source->timestamp = 0;
diff --git a/tests/UnitTests/__shared/resources/resource.extendsall.php b/tests/UnitTests/__shared/resources/resource.extendsall.php
index 9ffddc05..14d37908 100644
--- a/tests/UnitTests/__shared/resources/resource.extendsall.php
+++ b/tests/UnitTests/__shared/resources/resource.extendsall.php
@@ -22,7 +22,7 @@ class My_Resource_Extendsall extends \Smarty\Resource\ExtendsPlugin
*
* @return void
*/
- public function populate(Source $source, Template $_template = null)
+ public function populate(Source $source, ?Template $_template = null)
{
$uid = '';
$sources = array();
diff --git a/utilities/testrunners/php84/Dockerfile b/utilities/testrunners/php84/Dockerfile
new file mode 100644
index 00000000..6050a3db
--- /dev/null
+++ b/utilities/testrunners/php84/Dockerfile
@@ -0,0 +1,10 @@
+FROM php:8.4-rc-cli-bullseye
+
+## Basic utilities
+RUN apt-get update -yqq && apt-get install -y curl apt-utils git zip unzip
+
+## Composer
+COPY ./utilities/testrunners/shared/install-composer.sh /root/install-composer.sh
+WORKDIR /root
+RUN sh ./install-composer.sh
+RUN mv ./composer.phar /usr/local/bin/composer