diff --git a/README.md b/README.md
index 4e2773f..2bc30f9 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,14 @@
# [](https://www.pgs-soft.com) / HashId

-[](https://travis-ci.org/kjonski/HashId)
-[](https://scrutinizer-ci.com/g/kjonski/HashId/?branch=dev-master)
-[](https://scrutinizer-ci.com/g/kjonski/HashId/?branch=dev-master)
-
-Symfony 4 bundle for encoding integer route parameters and decoding request parameters with
+[](https://travis-ci.org/PGSSoft/HashId)
+[](https://scrutinizer-ci.com/g/PGSSoft/HashId/?branch=2.0)
+[](https://scrutinizer-ci.com/g/PGSSoft/HashId/?branch=2.0)
+
+Symfony bundle for encoding integer route parameters and decoding request parameters with
+***
+Please use this version with Symfony ≥4.4 and <5.0
+***
Replace predictable integer url parameters in easy way:
* `/hash-id/demo/decode/216/30` => `/hash-id/demo/decode/X46dBNxd79/30`
* `/order/315` => `/order/4w9aA11avM`
@@ -24,9 +27,11 @@ composer require pgs-soft/hashid-bundle
# config/packages/pgs_hash_id.yaml
pgs_hash_id:
- salt: 'my super salt'
- min_hash_length: 20
- alphabet: 'qwertyasdzxc098765-'
+ converter:
+ hashids:
+ salt: 'my super salt'
+ min_hash_length: 20
+ alphabet: 'qwertyasdzxc098765-'
```
## Controller configuration
diff --git a/composer.json b/composer.json
index e48fbf4..b3adc56 100644
--- a/composer.json
+++ b/composer.json
@@ -11,7 +11,7 @@
}
],
"require": {
- "php": "^7.1.3",
+ "php": ">=7.1.3",
"symfony/dependency-injection": "^4.1.12|^5.0",
"symfony/config": "~4.4|~5.0",
"doctrine/annotations": "^1.6",
@@ -29,14 +29,14 @@
"minimum-stability": "stable",
"extra": {
"branch-alias": {
- "dev-master": "master"
+ "dev-master": "2.0-dev"
}
},
"require-dev": {
"phpstan/phpstan": "^0.12",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.2",
- "symfony/http-kernel": "^4.4|^5.0",
+ "symfony/http-kernel": "^4.4.13|^5.1.5",
"sensio/framework-extra-bundle": "^5.1",
"friendsofphp/php-cs-fixer": "^2.10",
"phpunit/phpunit": "^7.0",
diff --git a/src/Controller/DemoController.php b/src/Controller/DemoController.php
index 71fea74..118289a 100644
--- a/src/Controller/DemoController.php
+++ b/src/Controller/DemoController.php
@@ -55,6 +55,29 @@ public function decodeMore(Request $request, int $id, int $other): Response
return new Response($this->getDecodeResponse($request, $id, $other));
}
+ /**
+ * @Hash("id")
+ *
+ * @param int $id
+ */
+ public function encodeLocalized($id): Response
+ {
+ $url1 = $this->generateUrl('pgs_hash_id_demo_encode_localized', ['id' => $id, '_locale' => 'pl']);
+ $url2 = $this->generateUrl('pgs_hash_id_demo_encode_localized', ['id' => $id]);
+
+ $response = <<
+
+ Provided id: $id
+ Localized url with encoded parameter and locale provided: $url1
+ Localized url with encoded parameter: $url2
+
+