From d3e02b7f14485c569b8520f43e817bb2942611ac Mon Sep 17 00:00:00 2001 From: Bastien Philippe Date: Mon, 30 Dec 2024 16:23:38 +0100 Subject: [PATCH] Small changes --- README.md | 2 +- composer.json | 4 ++-- .../Test/UnitTestGenerators/JsonResourceTestGenerator.php | 2 +- src/Support/Composer.php | 4 ++-- src/Support/Finder.php | 4 ++-- test-laravel/composer.json | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 834f2a1..c11507c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/soyhuce/laravel-somake.svg?style=flat-square)](https://packagist.org/packages/soyhuce/laravel-somake) [![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/soyhuce/laravel-somake/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/soyhuce/laravel-somake/actions?query=workflow%3Arun-tests+branch%3Amain) -[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/soyhuce/laravel-somake/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/soyhuce/laravel-somake/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) +[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/soyhuce/laravel-somake/php-cs-fixer.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/soyhuce/laravel-somake/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) [![GitHub PHPStan Action Status](https://img.shields.io/github/actions/workflow/status/soyhuce/laravel-somake/phpstan.yml?branch=main&label=PHPStan&style=flat-square)](https://github.com/soyhuce/laravel-somake/actions?query=workflow%3A"PHPStan"+branch%3Amain) [![Total Downloads](https://img.shields.io/packagist/dt/soyhuce/laravel-somake.svg?style=flat-square)](https://packagist.org/packages/soyhuce/laravel-somake) diff --git a/composer.json b/composer.json index 5bc395f..d5d7cea 100644 --- a/composer.json +++ b/composer.json @@ -33,8 +33,8 @@ "nunomaduro/collision": "^8.0", "larastan/larastan": "^3.0", "orchestra/testbench": "^9.0", - "pestphp/pest": "^2.12", - "pestphp/pest-plugin-laravel": "^2.0", + "pestphp/pest": "^3.0", + "pestphp/pest-plugin-laravel": "^3.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^2.0", "spatie/laravel-data": "^4.0", diff --git a/src/Domains/Test/UnitTestGenerators/JsonResourceTestGenerator.php b/src/Domains/Test/UnitTestGenerators/JsonResourceTestGenerator.php index a65e2de..2a8e095 100644 --- a/src/Domains/Test/UnitTestGenerators/JsonResourceTestGenerator.php +++ b/src/Domains/Test/UnitTestGenerators/JsonResourceTestGenerator.php @@ -47,7 +47,7 @@ public function data(string $class): array } [$modelFqcn, $modelClassBasename] = class_exists($modelMixin) - ? [ltrim($modelMixin, '\\'), class_basename($modelMixin)] + ? [mb_ltrim($modelMixin, '\\'), class_basename($modelMixin)] : [null, class_basename($modelMixin)]; return [ diff --git a/src/Support/Composer.php b/src/Support/Composer.php index b3eba52..86053ca 100644 --- a/src/Support/Composer.php +++ b/src/Support/Composer.php @@ -34,7 +34,7 @@ public function findPath(string $namespace): string $suffix = (string) Str::of($namespace)->after($rootNamespace)->replace('\\', DIRECTORY_SEPARATOR); - return rtrim(realpath($path) . DIRECTORY_SEPARATOR . $suffix, DIRECTORY_SEPARATOR); + return mb_rtrim(realpath($path) . DIRECTORY_SEPARATOR . $suffix, DIRECTORY_SEPARATOR); } /** @@ -56,6 +56,6 @@ public function findNamespace(string $path): string $suffix = (string) Str::of($path)->after($rootPath)->replace(DIRECTORY_SEPARATOR, '\\'); - return rtrim(rtrim((string) $rootNamespace, '\\') . $suffix, '\\'); + return mb_rtrim(mb_rtrim((string) $rootNamespace, '\\') . $suffix, '\\'); } } diff --git a/src/Support/Finder.php b/src/Support/Finder.php index 688345f..ba7264c 100644 --- a/src/Support/Finder.php +++ b/src/Support/Finder.php @@ -36,7 +36,7 @@ public function domains(): Collection public function domainPath(string $path): string { - return rtrim($this->domainRootPath() . Str::start($path, DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR); + return mb_rtrim($this->domainRootPath() . Str::start($path, DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR); } private function domainRootPath(): string @@ -55,7 +55,7 @@ public function applications(): Collection public function applicationPath(string $path): string { - return rtrim($this->applicationRootPath() . Str::start($path, DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR); + return mb_rtrim($this->applicationRootPath() . Str::start($path, DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR); } /** diff --git a/test-laravel/composer.json b/test-laravel/composer.json index d740d6c..20b70b5 100644 --- a/test-laravel/composer.json +++ b/test-laravel/composer.json @@ -8,7 +8,7 @@ ], "license": "MIT", "require": { - "php": "^8.2" + "php": "^8.3" }, "require-dev": { "spatie/laravel-data": "^4.0"