Skip to content
Open
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 _build/build.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
define('PKG_NAME', 'pdoTools');
define('PKG_NAME_LOWER', strtolower(PKG_NAME));

define('PKG_VERSION', '2.13.2');
define('PKG_VERSION', '2.14.0');
define('PKG_RELEASE', 'pl');
define('PKG_AUTO_INSTALL', false);

Expand Down
2 changes: 1 addition & 1 deletion core/components/pdotools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "bezumkin/pdotools",
"type": "library",
"require": {
"fenom/fenom": "2.*"
"fenom/fenom": "3.*"
}
}
27 changes: 13 additions & 14 deletions core/components/pdotools/composer.lock

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

4 changes: 4 additions & 0 deletions core/components/pdotools/docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog for pdoTools.

2.14.0-pl (02.04.2023)
==============
- Fenom updated to 3.0 to be compatible with PHP 8.

2.13.2-pl (02.09.2021)
==============
- Fixed some snippets.
Expand Down
10 changes: 5 additions & 5 deletions core/components/pdotools/model/fenom/Providers/ModChunk.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function __construct(pdoTools $pdoTools)
*
* @return bool
*/
public function templateExists($tpl)
public function templateExists(string $tpl): bool
{
$c = is_numeric($tpl) && $tpl > 0
? $tpl
Expand All @@ -36,7 +36,7 @@ public function templateExists($tpl)
*
* @return string
*/
public function getSource($tpl, &$time)
public function getSource(string $tpl, float &$time): string
{
$content = '';
if ($pos = strpos($tpl, '@')) {
Expand Down Expand Up @@ -76,7 +76,7 @@ public function getSource($tpl, &$time)
*
* @return int
*/
public function getLastModified($tpl)
public function getLastModified(string $tpl): float
{
$c = is_numeric($tpl) && $tpl > 0
? $tpl
Expand All @@ -99,7 +99,7 @@ public function getLastModified($tpl)
*
* @return bool if true - all templates are valid else some templates are invalid
*/
public function verify(array $templates)
public function verify(array $templates): bool
{
return true;
}
Expand All @@ -109,7 +109,7 @@ public function verify(array $templates)
* Get all names of template from provider
* @return array|\Iterator
*/
public function getList()
public function getList(string $extension = "tpl"): iterable
{
$c = $this->modx->newQuery('modChunk');
$c->select('name');
Expand Down
10 changes: 5 additions & 5 deletions core/components/pdotools/model/fenom/Providers/ModTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function __construct(pdoTools $pdoTools)
*
* @return bool
*/
public function templateExists($tpl)
public function templateExists(string $tpl): bool
{
$c = is_numeric($tpl) && $tpl > 0
? $tpl
Expand All @@ -36,7 +36,7 @@ public function templateExists($tpl)
*
* @return string
*/
public function getSource($tpl, &$time)
public function getSource(string $tpl, float &$time): string
{
$content = '';
if ($pos = strpos($tpl, '@')) {
Expand Down Expand Up @@ -76,7 +76,7 @@ public function getSource($tpl, &$time)
*
* @return int
*/
public function getLastModified($tpl)
public function getLastModified(string $tpl): float
{
$c = is_numeric($tpl) && $tpl > 0
? $tpl
Expand All @@ -99,7 +99,7 @@ public function getLastModified($tpl)
*
* @return bool if true - all templates are valid else some templates are invalid
*/
public function verify(array $templates)
public function verify(array $templates): bool
{
return true;
}
Expand All @@ -109,7 +109,7 @@ public function verify(array $templates)
* Get all names of template from provider
* @return array|\Iterator
*/
public function getList()
public function getList(string $extension = "tpl"): iterable
{
$c = $this->modx->newQuery('modTemplate');
$c->select('templatename');
Expand Down
5 changes: 2 additions & 3 deletions core/components/pdotools/model/pdotools/_fenom.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

if (!class_exists('Fenom')) {
require dirname(dirname(dirname(__FILE__))) . '/vendor/autoload.php';
Fenom::registerAutoload();
}

class FenomX extends Fenom
Expand Down Expand Up @@ -73,7 +72,7 @@ public function __construct(pdoTools $pdoTools)
* @throws LogicException
* @return Fenom
*/
public function setCompileDir($dir)
public function setCompileDir(string $dir): static
{
$dir = str_replace(MODX_CORE_PATH, '', $dir);
$path = MODX_CORE_PATH;
Expand Down Expand Up @@ -647,7 +646,7 @@ protected function _assertNoEval($pattern)
*
* @return Closure
*/
protected function _loadModifier($name, $template)
protected function _loadModifier(string $name, Fenom\Template $template): ?string
{
$modx = $this->modx;
$pdo = $this->pdoTools;
Expand Down