Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Also add results from a php-cs-fixer run
  • Loading branch information
usox committed Oct 7, 2022
1 parent b73fc61 commit 21c4dab
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 35 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ jobs:
steps:
- name: Set locales
run: |
sudo locale-gen en_GB
sudo locale-gen en_GB.utf8
sudo locale-gen fr_FR
sudo locale-gen fr_FR@euro
sudo locale-gen fr_FR.utf8
- uses: actions/checkout@v2

Expand All @@ -29,16 +33,7 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
if: ${{ matrix.php != '8.2' }}
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 3
command: composer update --no-interaction --no-progress

- name: Install Dependencies (ignore platform)
if: ${{ matrix.php == '8.2' }}
- name: Install Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@
}
],
"require": {
"php": "^8.1",
"ext-dom": "*",
"ext-gettext": "*",
"ext-simplexml": "*",
"php": "^8.1",
"symfony/polyfill-mbstring": "^1.12"
"symfony/polyfill-mbstring": "^1.12",
"symfony/polyfill-php82": "^1.26"
},
"require-dev": {
"ext-mbstring": "*",
"friendsofphp/php-cs-fixer": "^3",
"phpstan/phpstan": "^1.3",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.13.5"
"rector/rector": "^0.14"
},
"autoload": {
"classmap": [
Expand Down
3 changes: 2 additions & 1 deletion src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace PhpTal;

use AllowDynamicProperties;
use ArrayAccess;
use BadMethodCallException;
use Countable;
Expand All @@ -22,8 +23,8 @@
/**
* This class handles template execution context.
* Holds template variables and carries state/scope across macro executions.
*
*/
#[AllowDynamicProperties]
class Context
{
/**
Expand Down
5 changes: 2 additions & 3 deletions src/Dom/SaxXmlParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
*/
class SaxXmlParser
{

// available parser states
public const ST_ROOT = 0;
public const ST_TEXT = 1;
Expand Down Expand Up @@ -231,7 +230,7 @@ public function parseString(DocumentBuilder $builder, string $src, string $filen
$mark = $i + 1; // mark text start
$state = self::ST_TEXT;
$builder->onElementStart($tagname, $attributes);
} else /* isWhiteChar */ {
} else { /* isWhiteChar */
$state = self::ST_TAG_ATTRIBUTES;
}
}
Expand Down Expand Up @@ -342,7 +341,7 @@ public function parseString(DocumentBuilder $builder, string $src, string $filen

if ($c === '=') {
$state = self::ST_ATTR_VALUE;
} else /* white char */ {
} else { /* white char */
$state = self::ST_ATTR_EQ;
}
} elseif ($c === '/' || $c === '>') {
Expand Down
1 change: 0 additions & 1 deletion src/Php/Attribute/PHPTAL/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
class Debug extends Attribute
{

/**
* @var bool
*/
Expand Down
1 change: 0 additions & 1 deletion src/Php/Attribute/PHPTAL/Tales.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
class Tales extends Attribute
{

/**
* @var string
*/
Expand Down
26 changes: 13 additions & 13 deletions src/Php/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public static function transform(string $str, ?string $prefix = null): string
continue 2;
}

// no specific state defined, just eat char and see what to do with it.
// no break
// no specific state defined, just eat char and see what to do with it.
// no break
case self::ST_NONE:
// begin of eval without {
if ($c === '$' && $i + 1 < $len && self::isAlpha($str[$i + 1])) {
Expand Down Expand Up @@ -146,7 +146,7 @@ public static function transform(string $str, ?string $prefix = null): string
}
break;

// $xxx
// $xxx
case self::ST_EVAL:
if (!self::isVarNameChar($c)) {
$result .= $prefix . substr($str, $mark, $i - $mark);
Expand All @@ -155,7 +155,7 @@ public static function transform(string $str, ?string $prefix = null): string
}
break;

// single quoted string
// single quoted string
case self::ST_STR:
if ($c === '\\') {
$backslashed = true;
Expand All @@ -168,7 +168,7 @@ public static function transform(string $str, ?string $prefix = null): string
}
break;

// double quoted string
// double quoted string
case self::ST_ESTR:
if ($c === '\\') {
$backslashed = true;
Expand Down Expand Up @@ -197,7 +197,7 @@ public static function transform(string $str, ?string $prefix = null): string
}
break;

// var state
// var state
case self::ST_VAR:
if (self::isVarNameChar($c)) {
// noop
Expand Down Expand Up @@ -255,7 +255,7 @@ public static function transform(string $str, ?string $prefix = null): string
}
break;

// object member
// object member
case self::ST_MEMBER:
if (self::isVarNameChar($c)) {
// noop
Expand Down Expand Up @@ -310,7 +310,7 @@ public static function transform(string $str, ?string $prefix = null): string
}
break;

// wait for separator
// wait for separator
case self::ST_DEFINE:
if (self::isVarNameChar($c)) {
// noop
Expand All @@ -321,10 +321,10 @@ public static function transform(string $str, ?string $prefix = null): string
}
break;

// static call, can be const, static var, static method
// Klass::$static
// Klass::const
// Kclass::staticMethod()
// static call, can be const, static var, static method
// Klass::$static
// Klass::const
// Kclass::staticMethod()
//
case self::ST_STATIC:
if (self::isVarNameChar($c)) {
Expand Down Expand Up @@ -355,7 +355,7 @@ public static function transform(string $str, ?string $prefix = null): string
}
break;

// numeric value
// numeric value
case self::ST_NUM:
if (!self::isDigitCompound($c)) {
$var = substr($str, $mark, $i - $mark);
Expand Down
1 change: 0 additions & 1 deletion src/PhpTalInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
interface PhpTalInterface
{

/**
* Set template from file path.
*
Expand Down
1 change: 0 additions & 1 deletion src/TalesRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
*/
final class TalesRegistry implements TalesRegistryInterface
{

/**
* @var array<
* string,
Expand Down
1 change: 0 additions & 1 deletion tests/TalTestCaseCommentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public function setUp(): void
$state = new State($this->newPHPTAL());
$this->gen = new CodeWriter($state);
$this->tag = new DummyPhpNode();
$this->tag->codewriter = $this->gen;
}

private function newComment(string $expr): void
Expand Down

0 comments on commit 21c4dab

Please sign in to comment.