From fc22e3b0c5e6e925c0c9ac2a315f4e432314b459 Mon Sep 17 00:00:00 2001 From: Jeffrey Wong Date: Tue, 21 May 2024 14:42:16 -0700 Subject: [PATCH] fix deprecations in generated code --- generator/lib/behavior/sluggable/SluggableBehavior.php | 2 +- generator/lib/builder/om/PHP5NestedSetBuilder.php | 2 +- generator/lib/builder/om/QueryBuilder.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generator/lib/behavior/sluggable/SluggableBehavior.php b/generator/lib/behavior/sluggable/SluggableBehavior.php index 3da9a49fe..bc643338e 100644 --- a/generator/lib/behavior/sluggable/SluggableBehavior.php +++ b/generator/lib/behavior/sluggable/SluggableBehavior.php @@ -231,7 +231,7 @@ protected static function cleanupSlugPart(\$slug, \$replacement = '" . $this->ge { // transliterate if (function_exists('iconv')) { - \$slug = iconv('utf-8', 'us-ascii//TRANSLIT', \$slug); + \$slug = iconv('utf-8', 'us-ascii//TRANSLIT', (string)\$slug); } // lowercase diff --git a/generator/lib/builder/om/PHP5NestedSetBuilder.php b/generator/lib/builder/om/PHP5NestedSetBuilder.php index b93caedcb..ea1a2a282 100644 --- a/generator/lib/builder/om/PHP5NestedSetBuilder.php +++ b/generator/lib/builder/om/PHP5NestedSetBuilder.php @@ -239,7 +239,7 @@ protected function addGetIterator(&$script) * * @return NodeIterator */ - public function getIterator() + public function getIterator(): Iterator { return new NestedSetRecursiveIterator(\$this); } diff --git a/generator/lib/builder/om/QueryBuilder.php b/generator/lib/builder/om/QueryBuilder.php index 682ad521a..79c43d9f6 100644 --- a/generator/lib/builder/om/QueryBuilder.php +++ b/generator/lib/builder/om/QueryBuilder.php @@ -931,7 +931,7 @@ public function filterBy$colPhpName(\$$variableName = null, \$comparison = null) if (null === \$comparison) { if (is_array(\$$variableName)) { \$comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', \$$variableName)) { + } elseif (preg_match('/[\%\*]/', (string)\$$variableName)) { \$$variableName = str_replace('*', '%', \$$variableName); \$comparison = Criteria::LIKE; }