Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest']
php: ['8.1', '8.2', '8.3']
php: ['8.1', '8.2', '8.3', '8.4']
steps:
- name: Set locales
run: |
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
],
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"ext-dom": "*",
"ext-gettext": "*",
"ext-simplexml": "*",
Expand Down
62 changes: 31 additions & 31 deletions composer.lock

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

12 changes: 12 additions & 0 deletions doc/en/book.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,18 @@ this page has been readed ${page/countRead} times"/>
<code>NE</code> (not equal)
</para>
</listitem>
<listitem>
<para>
<code>!==</code> :
<code>EQQ</code> (strictly equal)
</para>
</listitem>
<listitem>
<para>
<code>===</code> :
<code>NEE</code> (strictly not equal)
</para>
</listitem>
<listitem>
<para>
<code>&amp;&amp;</code> :
Expand Down
4 changes: 0 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

declare(strict_types=1);

use Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector;
use Rector\Config\RectorConfig;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
Expand All @@ -19,14 +17,12 @@
->withImportNames()
->withSkip([
StringClassNameToClassConstantRector::class,
JsonThrowOnErrorRector::class,
FirstClassCallableRector::class,
MixedTypeRector::class,
])
->withPhpSets(php81: true)
->withPreparedSets(deadCode: true)
->withRules([
IntvalToTypeCastRector::class,
AddLiteralSeparatorToNumberRector::class,
ClosureToArrowFunctionRector::class,
]);
2 changes: 1 addition & 1 deletion src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ private static function pathError(mixed $base, string $path, string $current, ?s
*
* @throws Exception\VariableNotFoundException
*/
public static function path(mixed $base, string $path, bool $nothrow = null): mixed
public static function path(mixed $base, string $path, bool $nothrow = false): mixed
{
if ($base === null) {
if ($nothrow) {
Expand Down
2 changes: 1 addition & 1 deletion src/Dom/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ public function generateHead(CodeWriter $codewriter): void
}
}

public function generateContent(CodeWriter $codewriter, bool $realContent = null): void
public function generateContent(CodeWriter $codewriter, bool $realContent = false): void
{
if (!$this->isEmptyNode($codewriter->getOutputMode())) {
if ($realContent || count($this->contentAttributes) === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/Dom/SaxXmlParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function parseFile(DocumentBuilder $builder, string $src): DocumentBuilde
* @throws ParserException
* @throws TemplateException
*/
public function parseString(DocumentBuilder $builder, string $src, string $filename = null): DocumentBuilder
public function parseString(DocumentBuilder $builder, string $src, null|string $filename = null): DocumentBuilder
{
try {
$builder->setEncoding($this->input_encoding);
Expand Down
2 changes: 1 addition & 1 deletion src/Dom/XmlnsState.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class XmlnsState
/** Create a new XMLNS state inheriting provided aliases.
* @param array<string, string> $prefix_to_uri
*/
public function __construct(private array $prefix_to_uri, private string $current_default)
public function __construct(private array $prefix_to_uri, private readonly string $current_default)
{
}

Expand Down
3 changes: 0 additions & 3 deletions src/NothingKeyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ public function count(): int
{
return 0;
}
/**
* @return null
*/
public function jsonSerialize(): ?string
{
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/PHPTAL.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function setTemplate(?string $path): PhpTalInterface
*
* @return $this
*/
public function setSource(string $src, ?string $path = null): PhpTalInterface
public function setSource(string $src, null|string $path = null): PhpTalInterface
{
$this->prepared = false;
$this->functionName = null;
Expand Down
8 changes: 4 additions & 4 deletions src/Php/CodeWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function splitExpression(string $src): array
preg_match_all('/(?:[^;]+|;;)+/sm', $src, $array);
$array = $array[0];
foreach ($array as &$a) {
$a = str_replace(';;', ';', (string) $a);
$a = str_replace(';;', ';', $a);
}
return $array;
}
Expand Down Expand Up @@ -270,7 +270,7 @@ public function flushHtml(): void
*
* @param bool $called_from_macro for error checking: unbuffered output doesn't support that
*/
public function doDoctype(bool $called_from_macro = null): void
public function doDoctype(bool $called_from_macro = false): void
{
if ($this->doctype) {
$code = '$ctx->setDocType(' . $this->str($this->doctype) .
Expand All @@ -284,7 +284,7 @@ public function doDoctype(bool $called_from_macro = null): void
*
* @param bool $called_from_macro for error checking: unbuffered output doesn't support that
*/
public function doXmlDeclaration(bool $called_from_macro = null): void
public function doXmlDeclaration(bool $called_from_macro = false): void
{
if ($this->xmldeclaration && $this->getOutputMode() !== PHPTAL::HTML5) {
$code = '$ctx->setXmlDeclaration(' . $this->str($this->xmldeclaration) .
Expand Down Expand Up @@ -367,7 +367,7 @@ public function doForeach(string $out, string $source): void
/**
* @throws PhpTalException
*/
public function doEnd(string $expects = null): void
public function doEnd(null|string $expects = null): void
{
if (count($this->segments) === 0) {
if ($expects === null) {
Expand Down
2 changes: 2 additions & 0 deletions src/Php/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ class Transformer
private static array $TranslationTable = [
'not' => '!',
'ne' => '!=',
'nee' => '!==',
'and' => '&&',
'or' => '||',
'lt' => '<',
'gt' => '>',
'ge' => '>=',
'le' => '<=',
'eq' => '==',
'eqq' => '===',
];

/**
Expand Down
4 changes: 2 additions & 2 deletions src/PhpTalInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public function setTemplate(string $path): self;
* Use setTemplate() or addSourceResolver() whenever possible.
*
* @param string $src The phptal template source.
* @param string $path Fake and 'unique' template path.
* @param null|string $path Fake and 'unique' template path.
*
* @return $this
*/
public function setSource(string $src, string $path = null): self;
public function setSource(string $src, null|string $path = null): self;

/**
* Specify where to look for templates.
Expand Down
2 changes: 1 addition & 1 deletion tests/PhpModeTestTestCase.php → tests/PhpModeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Tests\Testcase\PhpTalTestCase;
use Tests\Testhelper\Helper;

class PhpModeTestTestCase extends PhpTalTestCase
class PhpModeTest extends PhpTalTestCase
{
public function tearDown(): void
{
Expand Down
Loading