Skip to content

Commit 383c96b

Browse files
committed
Updated Rector to commit 9c1b5fef3c949fc7271c75cc560d511711158282
rectorphp/rector-src@9c1b5fe Add note for substr() can return false on php 7.x on ClassLikeNameClassNameImportSkipVoter (#7438)
1 parent 55e8da6 commit 383c96b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

rules/CodingStyle/ClassNameImport/ClassNameImportSkipVoter/ClassLikeNameClassNameImportSkipVoter.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ public function shouldSkip(File $file, FullyQualifiedObjectType $fullyQualifiedO
4545
$namespace = $scope instanceof Scope ? $scope->getNamespace() : null;
4646
$namespace = strtolower((string) $namespace);
4747
$shortNameLowered = $fullyQualifiedObjectType->getShortNameLowered();
48-
$subClassName = substr($fullyQualifiedObjectType->getClassName(), 0, -strlen($fullyQualifiedObjectType->getShortName()) - 1);
49-
$fullyQualifiedObjectTypeNamespace = strtolower((string) $subClassName);
48+
/**
49+
* on php 7.x, substr() result can return false, so force (string) is needed
50+
* @see https://github.com/rectorphp/rector-src/pull/7436
51+
*/
52+
$subClassName = (string) substr($fullyQualifiedObjectType->getClassName(), 0, -strlen($fullyQualifiedObjectType->getShortName()) - 1);
53+
$fullyQualifiedObjectTypeNamespace = strtolower($subClassName);
5054
foreach ($classLikeNames as $classLikeName) {
5155
if (strtolower($classLikeName) !== $shortNameLowered) {
5256
continue;

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = '21b60910ad5526c24c3b812c7dec754e1be9ef52';
22+
public const PACKAGE_VERSION = '9c1b5fef3c949fc7271c75cc560d511711158282';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-10-07 04:09:59';
27+
public const RELEASE_DATE = '2025-10-06 21:19:22';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)