Skip to content

Commit

Permalink
Replace Uuid dependency with Yii's password for reducing dependencies…
Browse files Browse the repository at this point in the history
…, allow newer phpunit versions
  • Loading branch information
TonisOrmisson committed Oct 12, 2024
1 parent 2301d40 commit 14ab64b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@
],
"require": {
"yiisoft/yii2": "~2.0.0",
"solutosoft/yii2-plugin": "~1.0.0",
"pascaldevink/shortuuid": "^3.0 || ^4.0"
"solutosoft/yii2-plugin": "~1.0.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0 || ^9.0",
"phpunit/phpunit": "^8.0 || ^9.0 || ^10.0 || ^11.0",
"phpstan/phpstan": "^1"

},
Expand All @@ -46,7 +45,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.1.x-dev"
"dev-master": "3.2.x-dev"
}
},
"config": {
Expand Down
8 changes: 4 additions & 4 deletions src/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace leandrogehlen\querybuilder;

use PascalDeVink\ShortUuid\ShortUuid;
use Ramsey\Uuid\Uuid;
use yii\base\BaseObject;
use yii\base\Security;
use yii\helpers\ArrayHelper;

/**
Expand Down Expand Up @@ -189,8 +188,9 @@ public function params()
* @return string
*/
private function getNewParamName(){
$shortUUid = new ShortUuid();
return $shortUUid->encode(Uuid::uuid4());
/** @var Security $security */
$security = \Yii::createObject(Security::class);
return $security->generateRandomString(20);
}

/**
Expand Down

0 comments on commit 14ab64b

Please sign in to comment.