From 479cfcfd46047f80624aba931d9789e50475b5c6 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 18 Mar 2024 23:02:54 +0100 Subject: [PATCH] remove nette/utils --- composer.json | 3 +-- src/ValueObject/RuleDefinition.php | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index b0b3432..14d017e 100644 --- a/composer.json +++ b/composer.json @@ -3,8 +3,7 @@ "description": "Contracts for production code of RuleDocGenerator", "license": "MIT", "require": { - "php": ">=8.1", - "nette/utils": "^3.2 || ^4.0" + "php": ">=8.1" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.3", diff --git a/src/ValueObject/RuleDefinition.php b/src/ValueObject/RuleDefinition.php index 8cffdaa..82fbcfe 100644 --- a/src/ValueObject/RuleDefinition.php +++ b/src/ValueObject/RuleDefinition.php @@ -4,7 +4,6 @@ namespace Symplify\RuleDocGenerator\ValueObject; -use Nette\Utils\Strings; use Symplify\RuleDocGenerator\Contract\CodeSampleInterface; use Symplify\RuleDocGenerator\Exception\PoorDocumentationException; use Symplify\RuleDocGenerator\Exception\ShouldNotHappenException; @@ -77,7 +76,8 @@ public function getRuleShortClass(): string throw new ShouldNotHappenException(); } - return (string) Strings::after($this->ruleClass, '\\', -1); + // get short class name + return basename(str_replace('\\', '/', $this->ruleClass)); } /**