From f267cf2a507f6176393aeb45bb560a1d6157a45c Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Fri, 20 Dec 2019 00:27:47 +0000 Subject: [PATCH 01/71] Test on PHP 7.4 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 2b1277c..b0c581a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: php php: - 7.2 - 7.3 + - 7.4 install: - travis_retry composer install --no-interaction From 62e90ec94256122c30f8abea570b1a3a3c7bfed4 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 20 Jan 2020 15:52:49 +0100 Subject: [PATCH 02/71] Test syntax using php-cs-fixer --- .styleci.yml | 6 ------ .travis.yml | 1 + composer.json | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 .styleci.yml diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index 877e3c4..0000000 --- a/.styleci.yml +++ /dev/null @@ -1,6 +0,0 @@ -enabled: - - unalign_double_arrow - -disabled: - - align_double_arrow - - phpdoc_align diff --git a/.travis.yml b/.travis.yml index b0c581a..ee27034 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ install: - travis_retry composer install --no-interaction script: + - vendor/bin/php-cs-fixer --diff --dry-run --verbose fix . - vendor/bin/phpunit --coverage-clover clover.xml after_script: diff --git a/composer.json b/composer.json index 341d76d..39210f3 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ "illuminate/support": "^6.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16", "graham-campbell/analyzer": "^2.3", "graham-campbell/testbench": "^5.3", "mockery/mockery": "^1.2", From 8cb300ec09fe4892c08c216b279e569eb306edd7 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 20 Jan 2020 18:44:59 +0100 Subject: [PATCH 03/71] =?UTF-8?q?php-cs-fixer=20=E2=86=92=20phpcs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ee27034..9b80111 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ install: - travis_retry composer install --no-interaction script: - - vendor/bin/php-cs-fixer --diff --dry-run --verbose fix . - vendor/bin/phpunit --coverage-clover clover.xml + - vendor/bin/phpcs --standard=PSR12 --colors -n src tests after_script: - bash <(curl -s https://codecov.io/bash) diff --git a/composer.json b/composer.json index 39210f3..6919f9d 100644 --- a/composer.json +++ b/composer.json @@ -29,11 +29,11 @@ "illuminate/support": "^6.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", "graham-campbell/analyzer": "^2.3", "graham-campbell/testbench": "^5.3", "mockery/mockery": "^1.2", - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^8.0", + "squizlabs/php_codesniffer": "^3.5" }, "config": { "preferred-install": "dist" From b03dd6eb1129d626cf6e8de0a5cc871dbb2e81f9 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 20 Jan 2020 18:49:05 +0100 Subject: [PATCH 04/71] Fix PSR12 syntax --- src/HashidsServiceProvider.php | 2 +- tests/AnalysisTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HashidsServiceProvider.php b/src/HashidsServiceProvider.php index 404e8df..0ccf7b3 100644 --- a/src/HashidsServiceProvider.php +++ b/src/HashidsServiceProvider.php @@ -43,7 +43,7 @@ public function boot(): void */ protected function setupConfig(): void { - $source = realpath($raw = __DIR__.'/../config/hashids.php') ?: $raw; + $source = realpath($raw = __DIR__ . '/../config/hashids.php') ?: $raw; if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { $this->publishes([$source => config_path('hashids.php')]); diff --git a/tests/AnalysisTest.php b/tests/AnalysisTest.php index b3bbb6f..8e73b03 100644 --- a/tests/AnalysisTest.php +++ b/tests/AnalysisTest.php @@ -34,8 +34,8 @@ class AnalysisTest extends TestCase protected function getPaths() { return [ - realpath(__DIR__.'/../config'), - realpath(__DIR__.'/../src'), + realpath(__DIR__ . '/../config'), + realpath(__DIR__ . '/../src'), realpath(__DIR__), ]; } From e49b594a18d46c85089ffda64389d01edcf3dcd3 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 20 Jan 2020 19:00:26 +0100 Subject: [PATCH 05/71] Remove noice --- CHANGELOG.md | 95 ------------------------------------------------- CONTRIBUTING.md | 28 --------------- 2 files changed, 123 deletions(-) delete mode 100644 CHANGELOG.md delete mode 100644 CONTRIBUTING.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 91cece3..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,95 +0,0 @@ -# CHANGELOG - -## 7.0.0 (released 2019-08-28) - -- Added Laravel 6.0 support -- Dropped Laravel 5.8 support - -## 6.0.0 (released 2019-04-03) - -- Added hashids/hashids 4.0 support -- Removed php 7.1 support - -## 5.2.0 (released 2019-02-27) - -- Added laravel 5.8 support -- Removed laravel 5.7 support - -## 5.1.0 (released 2018-08-23) - -- Added laravel 5.7 support -- Removed laravel 5.6 support - -## 5.0.0 (released 2018-03-12) - -- Added Hashids 3.0 support - -## 4.0.0 (released 2018-02-11) - -- Added Laravel 5.6 support -- Added void return types -- Fixed config when inside phar -- Removed Laravel 5.5 support -- Removed PHP 7.0 support - -## 3.3.0 (released 2017-09-02) - -- Removed Laravel 5.3 and 5.4 support - -## 3.2.0 (released 2017-08-07) - -- Added Laravel 5.5 support - -## 3.1.0 (released 2017-01-01) - -- Added Laravel 5.4 support -- Dropped php 5.6 support - -## 3.0.0 (released 2016-11-15) - -- Updated to hashids 2.0 - -## 2.4.0 (released 2016-07-11) - -- Dropped php 5.5 support - -## 2.3.0 (released 2016-05-05) - -- Added Laravel 5.3 support - -## 2.2.2 (released 2016-01-30) - -- Improved service provider - -## 2.2.1 (released 2016-01-17) - -- Lumen 5.2 support - -## 2.2.0 (released 2015-11-14) - -- Laravel 5.2 support -- Update dependencies - -## 2.1.0 (released 2015-10-07) - -- Improved Lumen support - -## 2.0.1 (released 2015-07-06) - -- Don't require configuration - -## 2.0.0 (released 2015-06-30) - -- Official Lumen support -- Code cleanup -- Moved the factory -- Container binding improvements - -## 1.1.0 (released 2015-05-07) - -- Support both Laravel 5.0 and 5.1 -- Dropped PHP 5.4 support - -## 1.0.0 (released 2015-02-05) - -- Initial stable release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 7b01d4b..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,28 +0,0 @@ -# Contributing - -Contributions are welcome, and are accepted via pull requests. Please review these guidelines before submitting any pull requests. - -## Guidelines - -- Please follow the [PSR-2 Coding Style Guide](https://www.php-fig.org/psr/psr-2/), enforced by [StyleCI](https://styleci.io). -- Ensure that the current tests pass, and if you've added something new, add the tests where relevant. -- Send a coherent commit history, making sure each individual commit in your pull request is meaningful. -- You may need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts. -- If you are changing or adding to the behaviour or public API, you may need to update the docs. -- Please remember that we follow [SemVer](https://semver.org). - -## Running Tests - -First, install the dependencies using [Composer](https://getcomposer.org/): - -```sh -$ composer install -``` - -Then run [PHPUnit](https://phpunit.de/): - -```sh -$ vendor/bin/phpunit -``` - -The tests will be automatically run by [Travis CI](https://travis-ci.org/) against pull requests. From a8d61a66d90fad4e38fd16d4c9b2efd423466394 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 20 Jan 2020 19:02:46 +0100 Subject: [PATCH 06/71] Update .gitattributes --- .gitattributes | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 257d31d..a0c1407 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,9 +4,6 @@ /.editorconfig export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/.styleci.yml export-ignore /.travis.yml export-ignore /phpunit.xml.dist export-ignore -/CHANGELOG.md export-ignore -/CONTRIBUTING.md export-ignore /README.md export-ignore From 60265a0741dcb3adf7c9d60ff64ea922ed43817b Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Wed, 29 Jan 2020 19:00:27 +0100 Subject: [PATCH 07/71] Added laravel 7 support --- .travis.yml | 2 -- composer.json | 21 ++++++++-------- config/hashids.php | 8 +++--- src/Facades/Hashids.php | 17 +++---------- src/HashidsFactory.php | 36 +++------------------------ src/HashidsManager.php | 44 ++++----------------------------- src/HashidsServiceProvider.php | 45 +++------------------------------- tests/AbstractTestCase.php | 20 +++------------ tests/AnalysisTest.php | 23 +++-------------- tests/Facades/HashidsTest.php | 28 +++------------------ tests/HashidsFactoryTest.php | 13 +++------- tests/HashidsManagerTest.php | 13 +++------- tests/ServiceProviderTest.php | 13 +++------- 13 files changed, 55 insertions(+), 228 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b80111..b7620cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: php php: - - 7.2 - - 7.3 - 7.4 install: diff --git a/composer.json b/composer.json index 6919f9d..876cc9e 100644 --- a/composer.json +++ b/composer.json @@ -17,22 +17,21 @@ "authors": [ { "name": "Vincent Klaiber", - "email": "hello@doubledip.se", - "homepage": "https://doubledip.se/" + "email": "hello@doubledip.se" } ], "require": { - "php": "^7.2", - "graham-campbell/manager": "^4.3", + "php": "^7.4", + "graham-campbell/manager": "^4.4", "hashids/hashids": "^4.0", - "illuminate/contracts": "^6.0", - "illuminate/support": "^6.0" + "illuminate/contracts": "^7.0", + "illuminate/support": "^7.0" }, "require-dev": { - "graham-campbell/analyzer": "^2.3", - "graham-campbell/testbench": "^5.3", - "mockery/mockery": "^1.2", - "phpunit/phpunit": "^8.0", + "graham-campbell/analyzer": "^2.4", + "graham-campbell/testbench": "^5.4", + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "^3.5" }, "config": { @@ -40,7 +39,7 @@ }, "extra": { "branch-alias": { - "dev-master": "7.0-dev" + "dev-master": "8.0-dev" }, "laravel": { "providers": [ diff --git a/config/hashids.php b/config/hashids.php index f8d4d1e..689e06f 100644 --- a/config/hashids.php +++ b/config/hashids.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); diff --git a/src/Facades/Hashids.php b/src/Facades/Hashids.php index 80b2037..baca6d8 100644 --- a/src/Facades/Hashids.php +++ b/src/Facades/Hashids.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); @@ -16,10 +16,6 @@ use Illuminate\Support\Facades\Facade; /** - * This is the Hashids facade class. - * - * @author Vincent Klaiber - * * @method static string encode(mixed ...$numbers) Encode parameters to generate a hash. * @method static array decode(string $hash) Decode a hash to the original parameter values. * @method static string encodeHex(string $str) Encode hexadecimal values and generate a hash string. @@ -27,11 +23,6 @@ */ class Hashids extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ protected static function getFacadeAccessor(): string { return 'hashids'; diff --git a/src/HashidsFactory.php b/src/HashidsFactory.php index c082f0b..2c201e8 100644 --- a/src/HashidsFactory.php +++ b/src/HashidsFactory.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); @@ -16,20 +16,8 @@ use Hashids\Hashids; use Illuminate\Support\Arr; -/** - * This is the Hashids factory class. - * - * @author Vincent Klaiber - */ class HashidsFactory { - /** - * Make a new Hashids client. - * - * @param array $config - * - * @return \Hashids\Hashids - */ public function make(array $config): Hashids { $config = $this->getConfig($config); @@ -37,15 +25,6 @@ public function make(array $config): Hashids return $this->getClient($config); } - /** - * Get the configuration data. - * - * @param array $config - * - * @throws \InvalidArgumentException - * - * @return array - */ protected function getConfig(array $config): array { return [ @@ -55,13 +34,6 @@ protected function getConfig(array $config): array ]; } - /** - * Get the hashids client. - * - * @param array $config - * - * @return \Hashids\Hashids - */ protected function getClient(array $config): Hashids { return new Hashids($config['salt'], $config['length'], $config['alphabet']); diff --git a/src/HashidsManager.php b/src/HashidsManager.php index 3f27676..e746528 100644 --- a/src/HashidsManager.php +++ b/src/HashidsManager.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); @@ -18,32 +18,15 @@ use Illuminate\Contracts\Config\Repository; /** - * This is the Hashids manager class. - * * @method string encode(mixed ...$numbers) Encode parameters to generate a hash. * @method array decode(string $hash) Decode a hash to the original parameter values. * @method string encodeHex(string $str) Encode hexadecimal values and generate a hash string. * @method string decodeHex(string $hash) Decode a hexadecimal hash. - * - * @author Vincent Klaiber */ class HashidsManager extends AbstractManager { - /** - * The factory instance. - * - * @var \Vinkla\Hashids\HashidsFactory - */ - protected $factory; + protected HashidsFactory $factory; - /** - * Create a new Hashids manager instance. - * - * @param \Illuminate\Contracts\Config\Repository $config - * @param \Vinkla\Hashids\HashidsFactory $factory - * - * @return void - */ public function __construct(Repository $config, HashidsFactory $factory) { parent::__construct($config); @@ -51,33 +34,16 @@ public function __construct(Repository $config, HashidsFactory $factory) $this->factory = $factory; } - /** - * Create the connection instance. - * - * @param array $config - * - * @return \Hashids\Hashids - */ protected function createConnection(array $config): Hashids { return $this->factory->make($config); } - /** - * Get the configuration name. - * - * @return string - */ protected function getConfigName(): string { return 'hashids'; } - /** - * Get the factory instance. - * - * @return \Vinkla\Hashids\HashidsFactory - */ public function getFactory(): HashidsFactory { return $this->factory; diff --git a/src/HashidsServiceProvider.php b/src/HashidsServiceProvider.php index 0ccf7b3..ce5e967 100644 --- a/src/HashidsServiceProvider.php +++ b/src/HashidsServiceProvider.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); @@ -19,28 +19,13 @@ use Illuminate\Support\ServiceProvider; use Laravel\Lumen\Application as LumenApplication; -/** - * This is the Hashids service provider class. - * - * @author Vincent Klaiber - */ class HashidsServiceProvider extends ServiceProvider { - /** - * Boot the service provider. - * - * @return void - */ public function boot(): void { $this->setupConfig(); } - /** - * Setup the config. - * - * @return void - */ protected function setupConfig(): void { $source = realpath($raw = __DIR__ . '/../config/hashids.php') ?: $raw; @@ -54,11 +39,6 @@ protected function setupConfig(): void $this->mergeConfigFrom($source, 'hashids'); } - /** - * Register the service provider. - * - * @return void - */ public function register(): void { $this->registerFactory(); @@ -66,11 +46,6 @@ public function register(): void $this->registerBindings(); } - /** - * Register the factory class. - * - * @return void - */ protected function registerFactory(): void { $this->app->singleton('hashids.factory', function () { @@ -80,11 +55,6 @@ protected function registerFactory(): void $this->app->alias('hashids.factory', HashidsFactory::class); } - /** - * Register the manager class. - * - * @return void - */ protected function registerManager(): void { $this->app->singleton('hashids', function (Container $app) { @@ -97,11 +67,6 @@ protected function registerManager(): void $this->app->alias('hashids', HashidsManager::class); } - /** - * Register the bindings. - * - * @return void - */ protected function registerBindings(): void { $this->app->bind('hashids.connection', function (Container $app) { @@ -114,8 +79,6 @@ protected function registerBindings(): void } /** - * Get the services provided by the provider. - * * @return string[] */ public function provides(): array diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index b424ceb..8c62680 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); @@ -16,20 +16,8 @@ use GrahamCampbell\TestBench\AbstractPackageTestCase; use Vinkla\Hashids\HashidsServiceProvider; -/** - * This is the abstract test class. - * - * @author Vincent Klaiber - */ abstract class AbstractTestCase extends AbstractPackageTestCase { - /** - * Get the service provider class. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * - * @return string - */ protected function getServiceProviderClass($app) { return HashidsServiceProvider::class; diff --git a/tests/AnalysisTest.php b/tests/AnalysisTest.php index 8e73b03..99eef97 100644 --- a/tests/AnalysisTest.php +++ b/tests/AnalysisTest.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); @@ -17,20 +17,10 @@ use Laravel\Lumen\Application; use PHPUnit\Framework\TestCase; -/** - * This is the analysis test class. - * - * @author Vincent Klaiber - */ class AnalysisTest extends TestCase { use AnalysisTrait; - /** - * Get the code paths to analyze. - * - * @return string[] - */ protected function getPaths() { return [ @@ -40,11 +30,6 @@ protected function getPaths() ]; } - /** - * Get the classes to ignore not existing. - * - * @return string[] - */ protected function getIgnored() { return [Application::class]; diff --git a/tests/Facades/HashidsTest.php b/tests/Facades/HashidsTest.php index f102d24..463360c 100644 --- a/tests/Facades/HashidsTest.php +++ b/tests/Facades/HashidsTest.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); @@ -18,40 +18,20 @@ use Vinkla\Hashids\HashidsManager; use Vinkla\Tests\Hashids\AbstractTestCase; -/** - * This is the Hashids facade test class. - * - * @author Vincent Klaiber - */ class HashidsTest extends AbstractTestCase { use FacadeTrait; - /** - * Get the facade accessor. - * - * @return string - */ protected function getFacadeAccessor() { return 'hashids'; } - /** - * Get the facade class. - * - * @return string - */ protected function getFacadeClass() { return Hashids::class; } - /** - * Get the facade root. - * - * @return string - */ protected function getFacadeRoot() { return HashidsManager::class; diff --git a/tests/HashidsFactoryTest.php b/tests/HashidsFactoryTest.php index 77a2c15..91b2cb9 100644 --- a/tests/HashidsFactoryTest.php +++ b/tests/HashidsFactoryTest.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); @@ -16,11 +16,6 @@ use Hashids\Hashids; use Vinkla\Hashids\HashidsFactory; -/** - * This is the Hashids factory test class. - * - * @author Vincent Klaiber - */ class HashidsFactoryTest extends AbstractTestCase { public function testMakeStandard() diff --git a/tests/HashidsManagerTest.php b/tests/HashidsManagerTest.php index 90b6a2f..ec55c59 100644 --- a/tests/HashidsManagerTest.php +++ b/tests/HashidsManagerTest.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); @@ -20,11 +20,6 @@ use Vinkla\Hashids\HashidsFactory; use Vinkla\Hashids\HashidsManager; -/** - * This is the Hashids manager test class. - * - * @author Vincent Klaiber - */ class HashidsManagerTest extends AbstractTestBenchTestCase { public function testCreateConnection() diff --git a/tests/ServiceProviderTest.php b/tests/ServiceProviderTest.php index 23f9bb1..76860cd 100644 --- a/tests/ServiceProviderTest.php +++ b/tests/ServiceProviderTest.php @@ -1,12 +1,12 @@ +/** + * Copyright (c) Vincent Klaiber. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * + * @see https://github.com/vinkla/laravel-hashids */ declare(strict_types=1); @@ -18,11 +18,6 @@ use Vinkla\Hashids\HashidsFactory; use Vinkla\Hashids\HashidsManager; -/** - * This is the service provider test class. - * - * @author Vincent Klaiber - */ class ServiceProviderTest extends AbstractTestCase { use ServiceProviderTrait; From 9e5aa73cbc55acb2f4915537d41cdc66b7133af6 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Wed, 29 Jan 2020 19:01:58 +0100 Subject: [PATCH 08/71] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e62c652..7c86051 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ App::make('Foo')->bar(); ## Documentation -There are other classes in this package that are not documented here. This is because the package is a Laravel wrapper of [Ivan Akimov's](https://github.com/ivanakimov) [Hashids package](https://github.com/ivanakimov/hashids.php#readme). +There are other classes in this package that are not documented here. This is because the package is a Laravel wrapper of [Ivan Akimov's](https://github.com/ivanakimov) [Hashids package](https://github.com/vinkla/hashids.php#readme). ## License From 90dd3af022dc393d1b8f1c69530bd67dbb200aa7 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Wed, 29 Jan 2020 19:09:24 +0100 Subject: [PATCH 09/71] Update README.md --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 7c86051..582c1b4 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,6 @@ Require this package, with [Composer](https://getcomposer.org/), in the root dir $ composer require vinkla/hashids ``` -If you want you can use the [facade](http://laravel.com/docs/facades). Add the reference in `config/app.php` to your aliases array. - -```php -'Hashids' => Vinkla\Hashids\Facades\Hashids::class -``` - ## Configuration Laravel Hashids requires connection configuration. To get started, you'll need to publish all vendor assets: From 21fe03dec5d78df8ea74cfbafa38b612725596f5 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Wed, 29 Jan 2020 19:13:37 +0100 Subject: [PATCH 10/71] Update method docblocks --- src/Facades/Hashids.php | 8 ++++---- src/HashidsManager.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Facades/Hashids.php b/src/Facades/Hashids.php index baca6d8..24fd10c 100644 --- a/src/Facades/Hashids.php +++ b/src/Facades/Hashids.php @@ -16,10 +16,10 @@ use Illuminate\Support\Facades\Facade; /** - * @method static string encode(mixed ...$numbers) Encode parameters to generate a hash. - * @method static array decode(string $hash) Decode a hash to the original parameter values. - * @method static string encodeHex(string $str) Encode hexadecimal values and generate a hash string. - * @method static string decodeHex(string $hash) Decode a hexadecimal hash. + * @method \Hashids\Hashids encode(mixed ...$numbers) + * @method \Hashids\Hashids decode(string $hash) + * @method \Hashids\Hashids encodeHex(string $str) + * @method \Hashids\Hashids decodeHex(string $hash) */ class Hashids extends Facade { diff --git a/src/HashidsManager.php b/src/HashidsManager.php index e746528..350a685 100644 --- a/src/HashidsManager.php +++ b/src/HashidsManager.php @@ -18,10 +18,10 @@ use Illuminate\Contracts\Config\Repository; /** - * @method string encode(mixed ...$numbers) Encode parameters to generate a hash. - * @method array decode(string $hash) Decode a hash to the original parameter values. - * @method string encodeHex(string $str) Encode hexadecimal values and generate a hash string. - * @method string decodeHex(string $hash) Decode a hexadecimal hash. + * @method \Hashids\Hashids encode(mixed ...$numbers) + * @method \Hashids\Hashids decode(string $hash) + * @method \Hashids\Hashids encodeHex(string $str) + * @method \Hashids\Hashids decodeHex(string $hash) */ class HashidsManager extends AbstractManager { From a18a416c876d6349373e43083c25a1e280223280 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Wed, 29 Jan 2020 19:16:59 +0100 Subject: [PATCH 11/71] Update README.md --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 582c1b4..41cb398 100644 --- a/README.md +++ b/README.md @@ -69,11 +69,11 @@ Here you can see an example of just how simple this package is to use. Out of th // You can alias this in config/app.php. use Vinkla\Hashids\Facades\Hashids; -Hashids::encode(4815162342); // We're done here - how easy was that, it just works! +Hashids::encode(4815162342); -Hashids::decode('doyouthinkthatsairyourebreathingnow'); // This example is simple and there are far more methods available. +Hashids::decode('doyouthinkthatsairyourebreathingnow'); ``` The Hashids manager will behave like it is a `Hashids\Hashids`. If you want to call specific connections, you can do that with the connection method: @@ -81,10 +81,10 @@ The Hashids manager will behave like it is a `Hashids\Hashids`. If you want to c ```php use Vinkla\Hashids\Facades\Hashids; -// Writing this… +// Writing this... Hashids::connection('main')->encode($id); -// …is identical to writing this +// ...is identical to writing this Hashids::encode($id); // and is also identical to writing this. @@ -120,9 +120,7 @@ class Foo App::make('Foo')->bar(); ``` -## Documentation - -There are other classes in this package that are not documented here. This is because the package is a Laravel wrapper of [Ivan Akimov's](https://github.com/ivanakimov) [Hashids package](https://github.com/vinkla/hashids.php#readme). +For more information on how to use the `\Hashids\Hasdhids` class, check out the docs at [`hashids/hashids`](https://github.com/vinkla/hashids.php#readme). ## License From 1d97b87553dd33c53acfa7d043e8a7cb132f180f Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Wed, 29 Jan 2020 19:17:17 +0100 Subject: [PATCH 12/71] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41cb398..7a35048 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ class Foo App::make('Foo')->bar(); ``` -For more information on how to use the `\Hashids\Hasdhids` class, check out the docs at [`hashids/hashids`](https://github.com/vinkla/hashids.php#readme). +For more information on how to use the `\Hashids\Hashids` class, check out the docs at [`hashids/hashids`](https://github.com/vinkla/hashids.php#readme). ## License From a101bff484b92a068417c69fe012c93ac30b7548 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Wed, 29 Jan 2020 19:22:00 +0100 Subject: [PATCH 13/71] Update README.md --- README.md | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 7a35048..3976b35 100644 --- a/README.md +++ b/README.md @@ -47,23 +47,9 @@ This option `default` is where you may specify which of the connections below yo This option `connections` is where each of the connections are setup for your application. Example configuration has been included, but you may add as many connections as you would like. - ## Usage -#### HashidsManager - -This is the class of most interest. It is bound to the ioc container as `hashids` and can be accessed using the `Facades\Hashids` facade. This class implements the ManagerInterface by extending AbstractManager. The interface and abstract class are both part of the [Laravel Manager](https://github.com/GrahamCampbell/Laravel-Manager) package, so you may want to go and checkout the docs for how to use the manager class over at that repository. Note that the connection class returned will always be an instance of `Hashids\Hashids`. - -#### Facades\Hashids - -This facade will dynamically pass static method calls to the `hashids` object in the ioc container which by default is the `HashidsManager` class. - -#### HashidsServiceProvider - -This class contains no public methods of interest. This class should be added to the providers array in `config/app.php`. This class will setup ioc bindings. - -### Examples -Here you can see an example of just how simple this package is to use. Out of the box, the default adapter is `main`. After you enter your authentication details in the config file, it will just work: +Here you can see an example of you may use this package. Out of the box, the default adapter is `main`. After you enter your authentication details in the config file, it will just work: ```php // You can alias this in config/app.php. @@ -76,7 +62,7 @@ Hashids::encode(4815162342); Hashids::decode('doyouthinkthatsairyourebreathingnow'); ``` -The Hashids manager will behave like it is a `Hashids\Hashids`. If you want to call specific connections, you can do that with the connection method: +The manager will behave like it is a `Hashids\Hashids` class. If you want to call specific connections, you can do that with the connection method: ```php use Vinkla\Hashids\Facades\Hashids; @@ -97,7 +83,7 @@ Hashids::getDefaultConnection(); // This will return main. Hashids::setDefaultConnection('alternative'); // The default is now alternative. ``` -If you prefer to use dependency injection over facades like me, then you can inject the manager: +If you prefer to use dependency injection over facades, then you can inject the manager: ```php use Vinkla\Hashids\HashidsManager; @@ -120,7 +106,7 @@ class Foo App::make('Foo')->bar(); ``` -For more information on how to use the `\Hashids\Hashids` class, check out the docs at [`hashids/hashids`](https://github.com/vinkla/hashids.php#readme). +For more information on how to use the `\Hashids\Hashids` class, check out the docs at [`hashids/hashids`](https://github.com/vinkla/hashids.php). ## License From 20266758a232ac62ee1f632d7eb2c3937d2c7fb9 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Fri, 31 Jan 2020 17:12:24 +0100 Subject: [PATCH 14/71] Update keywords --- README.md | 2 +- composer.json | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3976b35..ba8abbf 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ class Foo App::make('Foo')->bar(); ``` -For more information on how to use the `\Hashids\Hashids` class, check out the docs at [`hashids/hashids`](https://github.com/vinkla/hashids.php). +For more information on how to use the `Hashids\Hashids` class, check out the docs at [`hashids/hashids`](https://github.com/vinkla/hashids.php). ## License diff --git a/composer.json b/composer.json index 876cc9e..ee882ac 100644 --- a/composer.json +++ b/composer.json @@ -2,16 +2,8 @@ "name": "vinkla/hashids", "description": "A Hashids bridge for Laravel", "keywords": [ - "laravel", "hashids", - "hashid", - "hash", - "ids", - "youtube", - "bitly", - "encrypt", - "decrypt", - "obfuscate" + "laravel" ], "license": "MIT", "authors": [ From 0c92485dea875863b1c6a0cbb3222219f4fc24c8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 07:48:42 +0100 Subject: [PATCH 15/71] Update phpunit/phpunit requirement from ^8.5 to ^9.0 (#120) Updates the requirements on [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) to permit the latest version. - [Release notes](https://github.com/sebastianbergmann/phpunit/releases) - [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.0.md) - [Commits](https://github.com/sebastianbergmann/phpunit/compare/8.5.0...9.0.0) Signed-off-by: dependabot-preview[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ee882ac..8cadf84 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "graham-campbell/analyzer": "^2.4", "graham-campbell/testbench": "^5.4", "mockery/mockery": "^1.3", - "phpunit/phpunit": "^8.5", + "phpunit/phpunit": "^9.0", "squizlabs/php_codesniffer": "^3.5" }, "config": { From d79b1d791982ca428b7ca6e5bd1feddc8115ce7a Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Fri, 14 Feb 2020 22:15:49 +0100 Subject: [PATCH 16/71] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba8abbf..5d9943d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ $hashidsManager->encode(911); [![Build Status](https://badgen.net/travis/vinkla/laravel-hashids/master)](https://travis-ci.org/vinkla/laravel-hashids) [![Coverage Status](https://badgen.net/codecov/c/github/vinkla/laravel-hashids)](https://codecov.io/github/vinkla/laravel-hashids) -[![Total Downloads](https://badgen.net/packagist/dt/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids) +[![Monthly Downloads](https://badgen.net/packagist/dm/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids) [![Latest Version](https://badgen.net/github/release/vinkla/hashids)](https://github.com/vinkla/hashids/releases) [![License](https://badgen.net/packagist/license/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids) From ee3e68e89fc38e79ab7d9e5f108a333ed79b620c Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sat, 15 Feb 2020 20:39:48 +0100 Subject: [PATCH 17/71] Update phpunit.xml.dist --- phpunit.xml.dist | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 10f462a..0b74e99 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,28 +1,12 @@ - + - + ./tests - + ./src From c740deb924d05c5152dc1bdfd47e6ecc7845413b Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 23 Feb 2020 19:02:50 +0100 Subject: [PATCH 18/71] =?UTF-8?q?Travis=20=E2=86=92=20GitHub=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 2 +- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ .travis.yml | 14 -------------- README.md | 8 +++----- 4 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.gitattributes b/.gitattributes index a0c1407..c3ab66e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,9 @@ * text=auto eol=lf /tests export-ignore +/.github export-ignore /.editorconfig export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/.travis.yml export-ignore /phpunit.xml.dist export-ignore /README.md export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6fd10e2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: [push, pull_request] + +jobs: + run: + runs-on: ubuntu-latest + + strategy: + matrix: + php: [7.4] + + name: PHP ${{ matrix.php }} + + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + - run: vendor/bin/phpunit --coverage-text + - run: vendor/bin/phpcs --standard=PSR12 --colors -n src tests + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b7620cd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: php - -php: - - 7.4 - -install: - - travis_retry composer install --no-interaction - -script: - - vendor/bin/phpunit --coverage-clover clover.xml - - vendor/bin/phpcs --standard=PSR12 --colors -n src tests - -after_script: - - bash <(curl -s https://codecov.io/bash) diff --git a/README.md b/README.md index 5d9943d..6fff85f 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,9 @@ Hashids::decode('1LLb3b4ck'); $hashidsManager->encode(911); ``` -[![Build Status](https://badgen.net/travis/vinkla/laravel-hashids/master)](https://travis-ci.org/vinkla/laravel-hashids) -[![Coverage Status](https://badgen.net/codecov/c/github/vinkla/laravel-hashids)](https://codecov.io/github/vinkla/laravel-hashids) -[![Monthly Downloads](https://badgen.net/packagist/dm/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids) -[![Latest Version](https://badgen.net/github/release/vinkla/hashids)](https://github.com/vinkla/hashids/releases) -[![License](https://badgen.net/packagist/license/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids) +[![Build Status](https://badgen.net/github/status/vinkla/laravel-hashids/master)](https://github.com/vinkla/laravel-hashids/actions) +[![Monthly Downloads](https://badgen.net/packagist/dm/vinkla/hashids)](https://packagist.org/packages/vinkla/laravel-hashids/stats) +[![Latest Version](https://badgen.net/github/release/vinkla/laravel-hashids)](https://github.com/vinkla/laravel-hashids/releases) ## Installation From dd51bdd3f633fd3d14e1cdfe63cf5b6f16eecaa4 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 25 Feb 2020 19:52:36 +0100 Subject: [PATCH 19/71] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6fff85f..e516065 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Hashids::decode('1LLb3b4ck'); $hashidsManager->encode(911); ``` -[![Build Status](https://badgen.net/github/status/vinkla/laravel-hashids/master)](https://github.com/vinkla/laravel-hashids/actions) +[![Build Status](https://badgen.net/github/checks/vinkla/alfred-hashids?label=build&icon=github)](https://github.com/vinkla/laravel-hashids/actions) [![Monthly Downloads](https://badgen.net/packagist/dm/vinkla/hashids)](https://packagist.org/packages/vinkla/laravel-hashids/stats) [![Latest Version](https://badgen.net/github/release/vinkla/laravel-hashids)](https://github.com/vinkla/laravel-hashids/releases) From 7349f1c24fe94245783f8c82452eae507b662297 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 06:02:27 +0000 Subject: [PATCH 20/71] Update graham-campbell/analyzer requirement from ^2.4 to ^3.0 Updates the requirements on [graham-campbell/analyzer](https://github.com/GrahamCampbell/Analyzer) to permit the latest version. - [Release notes](https://github.com/GrahamCampbell/Analyzer/releases) - [Changelog](https://github.com/GrahamCampbell/Analyzer/blob/master/CHANGELOG.md) - [Commits](https://github.com/GrahamCampbell/Analyzer/compare/v2.4.0...v3.0.0) Signed-off-by: dependabot-preview[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8cadf84..6479fd1 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "illuminate/support": "^7.0" }, "require-dev": { - "graham-campbell/analyzer": "^2.4", + "graham-campbell/analyzer": "^3.0", "graham-campbell/testbench": "^5.4", "mockery/mockery": "^1.3", "phpunit/phpunit": "^9.0", From cd73cc405929f9bb6d92287036fc8210ace31e26 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 3 Mar 2020 11:02:12 +0100 Subject: [PATCH 21/71] Update downloads badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e516065..8c9e1a3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ $hashidsManager->encode(911); ``` [![Build Status](https://badgen.net/github/checks/vinkla/alfred-hashids?label=build&icon=github)](https://github.com/vinkla/laravel-hashids/actions) -[![Monthly Downloads](https://badgen.net/packagist/dm/vinkla/hashids)](https://packagist.org/packages/vinkla/laravel-hashids/stats) +[![Monthly Downloads](https://badgen.net/packagist/dm/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids/stats) [![Latest Version](https://badgen.net/github/release/vinkla/laravel-hashids)](https://github.com/vinkla/laravel-hashids/releases) ## Installation From afb07de19de4b337ed21f15c4e293d74e1e73164 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 3 Mar 2020 11:03:57 +0100 Subject: [PATCH 22/71] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c9e1a3..39406de 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Hashids::decode('1LLb3b4ck'); $hashidsManager->encode(911); ``` -[![Build Status](https://badgen.net/github/checks/vinkla/alfred-hashids?label=build&icon=github)](https://github.com/vinkla/laravel-hashids/actions) +[![Build Status](https://badgen.net/github/checks/vinkla/laravel-hashids?label=build&icon=github)](https://github.com/vinkla/laravel-hashids/actions) [![Monthly Downloads](https://badgen.net/packagist/dm/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids/stats) [![Latest Version](https://badgen.net/github/release/vinkla/laravel-hashids)](https://github.com/vinkla/laravel-hashids/releases) From d1cdc289c31c930f879862abbc7abdce4ac40f75 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Tue, 10 Mar 2020 09:17:17 +0100 Subject: [PATCH 23/71] Support php 7.2 (#128) * Support php 7.2 * Enable php 7.2 and 7.3 * use phpunit 8.5 * remove fail-fast option (default to true) * Allow phpunit 9 * remove max-parallel * Update composer.json Co-authored-by: Vincent Klaiber --- .github/workflows/ci.yml | 2 +- composer.json | 4 ++-- src/HashidsManager.php | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fd10e2..3711f28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: [7.4] + php: [7.2, 7.3, 7.4] name: PHP ${{ matrix.php }} diff --git a/composer.json b/composer.json index 6479fd1..5deaa6e 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ } ], "require": { - "php": "^7.4", + "php": "^7.2.5", "graham-campbell/manager": "^4.4", "hashids/hashids": "^4.0", "illuminate/contracts": "^7.0", @@ -23,7 +23,7 @@ "graham-campbell/analyzer": "^3.0", "graham-campbell/testbench": "^5.4", "mockery/mockery": "^1.3", - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^8.5 || ^9.0", "squizlabs/php_codesniffer": "^3.5" }, "config": { diff --git a/src/HashidsManager.php b/src/HashidsManager.php index 350a685..8fd2158 100644 --- a/src/HashidsManager.php +++ b/src/HashidsManager.php @@ -25,7 +25,10 @@ */ class HashidsManager extends AbstractManager { - protected HashidsFactory $factory; + /** + * @var \Vinkla\Hashids\HashidsFactory + */ + protected $factory; public function __construct(Repository $config, HashidsFactory $factory) { From ecf5534731dbd476e52859b3a6ab265f29ebade7 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 10 Mar 2020 09:21:07 +0100 Subject: [PATCH 24/71] Release version 8.1 --- composer.json | 2 +- config/hashids.php | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5deaa6e..8f84ab5 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.0-dev" + "dev-master": "8.1-dev" }, "laravel": { "providers": [ diff --git a/config/hashids.php b/config/hashids.php index 689e06f..8e8a17e 100644 --- a/config/hashids.php +++ b/config/hashids.php @@ -9,8 +9,6 @@ * @see https://github.com/vinkla/laravel-hashids */ -declare(strict_types=1); - return [ /* From 6fec2489f6921a11e32534412f6f56890c5d7ec8 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 10 Mar 2020 09:24:36 +0100 Subject: [PATCH 25/71] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 39406de..16f9086 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ $hashidsManager->encode(911); [![Build Status](https://badgen.net/github/checks/vinkla/laravel-hashids?label=build&icon=github)](https://github.com/vinkla/laravel-hashids/actions) [![Monthly Downloads](https://badgen.net/packagist/dm/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids/stats) -[![Latest Version](https://badgen.net/github/release/vinkla/laravel-hashids)](https://github.com/vinkla/laravel-hashids/releases) +[![Latest Version](https://badgen.net/packagist/v/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids) ## Installation From e446389bdaa52062e6ce21938440fc9342dace83 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Thu, 19 Mar 2020 15:01:11 +0100 Subject: [PATCH 26/71] Added alphabet example --- config/hashids.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/hashids.php b/config/hashids.php index 8e8a17e..e4d14ef 100644 --- a/config/hashids.php +++ b/config/hashids.php @@ -40,11 +40,13 @@ 'main' => [ 'salt' => 'your-salt-string', 'length' => 'your-length-integer', + // 'alphabet' => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' ], 'alternative' => [ 'salt' => 'your-salt-string', 'length' => 'your-length-integer', + // 'alphabet' => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' ], ], From 909d2014849b544fcfc700f446c7221f8018051b Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 19 Apr 2020 20:34:53 +0200 Subject: [PATCH 27/71] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 16f9086..80ce1e8 100644 --- a/README.md +++ b/README.md @@ -108,4 +108,4 @@ For more information on how to use the `Hashids\Hashids` class, check out the do ## License -[MIT](LICENSE) © [Vincent Klaiber](https://doubledip.se) +[MIT](LICENSE) © [Vincent Klaiber](https://vinkla.dev/) From 6ccb7abea48e3df848eaf996d77c769e3a9f389d Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Thu, 23 Apr 2020 09:49:03 +0200 Subject: [PATCH 28/71] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3711f28..d9b340b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: with: php-version: ${{ matrix.php }} coverage: xdebug - - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + - run: composer install --prefer-dist --no-interaction - run: vendor/bin/phpunit --coverage-text - run: vendor/bin/phpcs --standard=PSR12 --colors -n src tests From 0c632bb4ed9b7163f7475db8dfdb0fdb02d22f40 Mon Sep 17 00:00:00 2001 From: Kendryck Date: Wed, 6 May 2020 20:18:02 +0200 Subject: [PATCH 29/71] Change phpdoc @method tags (#133) * Change phpdoc @method tags * Do not use static on manager --- src/Facades/Hashids.php | 8 ++++---- src/HashidsManager.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Facades/Hashids.php b/src/Facades/Hashids.php index 24fd10c..6720c1f 100644 --- a/src/Facades/Hashids.php +++ b/src/Facades/Hashids.php @@ -16,10 +16,10 @@ use Illuminate\Support\Facades\Facade; /** - * @method \Hashids\Hashids encode(mixed ...$numbers) - * @method \Hashids\Hashids decode(string $hash) - * @method \Hashids\Hashids encodeHex(string $str) - * @method \Hashids\Hashids decodeHex(string $hash) + * @method static string encode(mixed ...$numbers) + * @method static array decode(string $hash) + * @method static string encodeHex(string $str) + * @method static string decodeHex(string $hash) */ class Hashids extends Facade { diff --git a/src/HashidsManager.php b/src/HashidsManager.php index 8fd2158..89fff3b 100644 --- a/src/HashidsManager.php +++ b/src/HashidsManager.php @@ -18,10 +18,10 @@ use Illuminate\Contracts\Config\Repository; /** - * @method \Hashids\Hashids encode(mixed ...$numbers) - * @method \Hashids\Hashids decode(string $hash) - * @method \Hashids\Hashids encodeHex(string $str) - * @method \Hashids\Hashids decodeHex(string $hash) + * @method string encode(mixed ...$numbers) + * @method array decode(string $hash) + * @method string encodeHex(string $str) + * @method string decodeHex(string $hash) */ class HashidsManager extends AbstractManager { From ed2a1df8b94c5eea18fdf34620dff1c61b2bad09 Mon Sep 17 00:00:00 2001 From: Vincent Chi Date: Mon, 7 Sep 2020 19:40:46 +0800 Subject: [PATCH 30/71] Add laravel 8 support. (#137) Co-authored-by: Vincent Klaiber --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 8f84ab5..1084855 100644 --- a/composer.json +++ b/composer.json @@ -13,17 +13,17 @@ } ], "require": { - "php": "^7.2.5", + "php": "^7.3", "graham-campbell/manager": "^4.4", "hashids/hashids": "^4.0", - "illuminate/contracts": "^7.0", - "illuminate/support": "^7.0" + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0" }, "require-dev": { "graham-campbell/analyzer": "^3.0", "graham-campbell/testbench": "^5.4", "mockery/mockery": "^1.3", - "phpunit/phpunit": "^8.5 || ^9.0", + "phpunit/phpunit": "^9.0", "squizlabs/php_codesniffer": "^3.5" }, "config": { From 514076fa583855afc35739ad388711cec2379296 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 7 Sep 2020 13:42:50 +0200 Subject: [PATCH 31/71] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9b340b..4b4e72b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: [7.2, 7.3, 7.4] + php: [7.3, 7.4] name: PHP ${{ matrix.php }} From 6ade658e445169dc994715aab47c8676721589ac Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 7 Sep 2020 13:42:52 +0200 Subject: [PATCH 32/71] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1084855..5d32a9c 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.1-dev" + "dev-master": "9.0-dev" }, "laravel": { "providers": [ From fbb8b54c3f8bf2f6d147c108b8eb2018b4624dfe Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Sun, 11 Oct 2020 20:08:47 +0200 Subject: [PATCH 33/71] ci(php): Add support for PHP8. (#140) --- .github/workflows/ci.yml | 18 ++++++++++++++++-- composer.json | 4 ++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b4e72b..9517881 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: [7.3, 7.4] + php: [7.3, 7.4, 8.0] name: PHP ${{ matrix.php }} @@ -18,7 +18,21 @@ jobs: with: php-version: ${{ matrix.php }} coverage: xdebug - - run: composer install --prefer-dist --no-interaction + tools: composer:v2 + - name: Install PHP 8 Dependencies + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --no-interaction --no-progress --ignore-platform-req=php + if: "matrix.php >= 8" + - name: Install PHP 7 Dependencies + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --no-interaction --prefer-dist --no-progress + if: "matrix.php < 8" - run: vendor/bin/phpunit --coverage-text - run: vendor/bin/phpcs --standard=PSR12 --colors -n src tests diff --git a/composer.json b/composer.json index 5d32a9c..6fcea92 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ } ], "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "graham-campbell/manager": "^4.4", "hashids/hashids": "^4.0", "illuminate/contracts": "^8.0", @@ -23,7 +23,7 @@ "graham-campbell/analyzer": "^3.0", "graham-campbell/testbench": "^5.4", "mockery/mockery": "^1.3", - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^9.3", "squizlabs/php_codesniffer": "^3.5" }, "config": { From 92b1bc41d055619b589f43f38e2dd18eb9851bbe Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 11 Oct 2020 20:13:05 +0200 Subject: [PATCH 34/71] Remove step names --- .github/workflows/ci.yml | 43 +++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9517881..19f7c07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,26 +13,23 @@ jobs: name: PHP ${{ matrix.php }} steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: xdebug - tools: composer:v2 - - name: Install PHP 8 Dependencies - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --no-interaction --no-progress --ignore-platform-req=php - if: "matrix.php >= 8" - - name: Install PHP 7 Dependencies - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --no-interaction --prefer-dist --no-progress - if: "matrix.php < 8" - - run: vendor/bin/phpunit --coverage-text - - run: vendor/bin/phpcs --standard=PSR12 --colors -n src tests - + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + tools: composer:v2 + - uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --no-interaction --no-progress --ignore-platform-req=php + if: "matrix.php >= 8" + - uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --no-interaction --prefer-dist --no-progress + if: "matrix.php < 8" + - run: vendor/bin/phpunit --coverage-text + - run: vendor/bin/phpcs --standard=PSR12 --colors -n src tests From cb0086db96cdb49816465adc97e3a024c8ee9767 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Thu, 26 Nov 2020 20:38:22 +0100 Subject: [PATCH 35/71] Prepare 9.1.0 --- .github/workflows/ci.yml | 13 +------------ composer.json | 4 ++-- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19f7c07..562a06b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,17 +19,6 @@ jobs: php-version: ${{ matrix.php }} coverage: xdebug tools: composer:v2 - - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --no-interaction --no-progress --ignore-platform-req=php - if: "matrix.php >= 8" - - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --no-interaction --prefer-dist --no-progress - if: "matrix.php < 8" + - run: composer install --prefer-dist --no-interaction - run: vendor/bin/phpunit --coverage-text - run: vendor/bin/phpcs --standard=PSR12 --colors -n src tests diff --git a/composer.json b/composer.json index 6fcea92..78dda2d 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "require": { "php": "^7.3 || ^8.0", "graham-campbell/manager": "^4.4", - "hashids/hashids": "^4.0", + "hashids/hashids": "^4.1", "illuminate/contracts": "^8.0", "illuminate/support": "^8.0" }, @@ -31,7 +31,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.0-dev" + "dev-master": "9.1-dev" }, "laravel": { "providers": [ From 9a41311c612037a23993d37026c9652af3a23b02 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 8 Dec 2020 19:39:19 +0100 Subject: [PATCH 36/71] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 80ce1e8..9ce92d2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# Laravel Hashids - ![hashids](https://cloud.githubusercontent.com/assets/499192/11159205/faa429ae-8a5d-11e5-8c5d-c60a89290c5e.png) +# Laravel Hashids + > A [Hashids](http://hashids.org) bridge for Laravel. ```php From b36cc110bcfb55ce235afe806fbe8211be381541 Mon Sep 17 00:00:00 2001 From: Tom Witkowski Date: Wed, 13 Jan 2021 10:59:56 +0100 Subject: [PATCH 37/71] add missing connection() method to doc-block (#141) Co-authored-by: Vincent Klaiber --- src/Facades/Hashids.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Facades/Hashids.php b/src/Facades/Hashids.php index 6720c1f..f902084 100644 --- a/src/Facades/Hashids.php +++ b/src/Facades/Hashids.php @@ -20,6 +20,7 @@ * @method static array decode(string $hash) * @method static string encodeHex(string $str) * @method static string decodeHex(string $hash) + * @method static \Hashids\Hashids connection(string|null $name = null) */ class Hashids extends Facade { From 2a82dff7c5ae34cf6c97127bb41e523dcddd6442 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Wed, 20 Jan 2021 19:25:24 +0100 Subject: [PATCH 38/71] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 9ce92d2..ca4b7d3 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,3 @@ App::make('Foo')->bar(); ``` For more information on how to use the `Hashids\Hashids` class, check out the docs at [`hashids/hashids`](https://github.com/vinkla/hashids.php). - -## License - -[MIT](LICENSE) © [Vincent Klaiber](https://vinkla.dev/) From 423d028a6a34b9afb7a8665124d4cd4d913c0542 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 12 Apr 2021 20:23:14 +0200 Subject: [PATCH 39/71] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca4b7d3..fb2afef 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ $hashidsManager->encode(911); Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project. ```bash -$ composer require vinkla/hashids +composer require vinkla/hashids ``` ## Configuration From 1b247e447d1869e7d3d93b16def68a40b20c910f Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 12 Apr 2021 20:30:11 +0200 Subject: [PATCH 40/71] Remove unused variable --- tests/AbstractTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index 8c62680..38836e3 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -18,7 +18,7 @@ abstract class AbstractTestCase extends AbstractPackageTestCase { - protected function getServiceProviderClass($app) + protected function getServiceProviderClass() { return HashidsServiceProvider::class; } From 254e1894f934b117319d4ed1d187eb6d6436f207 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 30 Apr 2021 07:07:40 +0200 Subject: [PATCH 41/71] Upgrade to GitHub-native Dependabot (#148) Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a99fdc4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: composer + directory: "/" + schedule: + interval: weekly + time: "04:00" + open-pull-requests-limit: 10 From b615c6de13885fbaadaf518bb6c6619fb986339b Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 30 Nov 2021 12:54:16 +0100 Subject: [PATCH 42/71] Test on php 8.1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 562a06b..21779c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: [7.3, 7.4, 8.0] + php: [7.3, 7.4, 8.0, 8.1] name: PHP ${{ matrix.php }} From 30458de4ce54f355d05ecd740b1f64e331bc6d56 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 9 Jan 2022 17:27:23 +0100 Subject: [PATCH 43/71] Working on version 10 --- .github/workflows/ci.yml | 2 +- composer.json | 40 +++++++++++++++++----------------- phpunit.xml.dist | 22 +++++++++---------- src/HashidsManager.php | 5 +---- src/HashidsServiceProvider.php | 3 --- 5 files changed, 33 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21779c0..c704f7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: [7.3, 7.4, 8.0, 8.1] + php: [8.0, 8.1] name: PHP ${{ matrix.php }} diff --git a/composer.json b/composer.json index 78dda2d..5cca04b 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,11 @@ { "name": "vinkla/hashids", "description": "A Hashids bridge for Laravel", + "license": "MIT", "keywords": [ "hashids", "laravel" ], - "license": "MIT", "authors": [ { "name": "Vincent Klaiber", @@ -13,7 +13,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^8.0", "graham-campbell/manager": "^4.4", "hashids/hashids": "^4.1", "illuminate/contracts": "^8.0", @@ -26,22 +26,8 @@ "phpunit/phpunit": "^9.3", "squizlabs/php_codesniffer": "^3.5" }, - "config": { - "preferred-install": "dist" - }, - "extra": { - "branch-alias": { - "dev-master": "9.1-dev" - }, - "laravel": { - "providers": [ - "Vinkla\\Hashids\\HashidsServiceProvider" - ], - "aliases": { - "Hashids": "Vinkla\\Hashids\\Facades\\Hashids" - } - } - }, + "minimum-stability": "dev", + "prefer-stable": true, "autoload": { "psr-4": { "Vinkla\\Hashids\\": "src/" @@ -52,6 +38,20 @@ "Vinkla\\Tests\\Hashids\\": "tests/" } }, - "minimum-stability": "dev", - "prefer-stable": true + "config": { + "preferred-install": "dist" + }, + "extra": { + "branch-alias": { + "dev-master": "10.0-dev" + }, + "laravel": { + "aliases": { + "Hashids": "Vinkla\\Hashids\\Facades\\Hashids" + }, + "providers": [ + "Vinkla\\Hashids\\HashidsServiceProvider" + ] + } + } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0b74e99..8c764af 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,13 +1,13 @@ - - - - ./tests - - - - - ./src - - + + + + ./src + + + + + ./tests + + diff --git a/src/HashidsManager.php b/src/HashidsManager.php index 89fff3b..b23de63 100644 --- a/src/HashidsManager.php +++ b/src/HashidsManager.php @@ -25,10 +25,7 @@ */ class HashidsManager extends AbstractManager { - /** - * @var \Vinkla\Hashids\HashidsFactory - */ - protected $factory; + protected HashidsFactory $factory; public function __construct(Repository $config, HashidsFactory $factory) { diff --git a/src/HashidsServiceProvider.php b/src/HashidsServiceProvider.php index ce5e967..86bda10 100644 --- a/src/HashidsServiceProvider.php +++ b/src/HashidsServiceProvider.php @@ -78,9 +78,6 @@ protected function registerBindings(): void $this->app->alias('hashids.connection', Hashids::class); } - /** - * @return string[] - */ public function provides(): array { return [ From 29e0efdfbeede589eb2ffc381da1bf8fd77a53e2 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 24 Jan 2022 08:44:29 +0100 Subject: [PATCH 44/71] Add laravel 9 support --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 5cca04b..ecfab86 100644 --- a/composer.json +++ b/composer.json @@ -14,14 +14,14 @@ ], "require": { "php": "^8.0", - "graham-campbell/manager": "^4.4", + "graham-campbell/manager": "^4.7", "hashids/hashids": "^4.1", - "illuminate/contracts": "^8.0", - "illuminate/support": "^8.0" + "illuminate/contracts": "^9.0", + "illuminate/support": "^9.0" }, "require-dev": { "graham-campbell/analyzer": "^3.0", - "graham-campbell/testbench": "^5.4", + "graham-campbell/testbench": "^5.7", "mockery/mockery": "^1.3", "phpunit/phpunit": "^9.3", "squizlabs/php_codesniffer": "^3.5" From 9dbcfc1b20ecc25e73bba6e8c724d1648fa15fdd Mon Sep 17 00:00:00 2001 From: foremtehan <53290883+foremtehan@users.noreply.github.com> Date: Sun, 10 Apr 2022 23:08:38 +0430 Subject: [PATCH 45/71] Fixed: Unsupported operand types: int - string in PHP 8 (#163) --- config/hashids.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/hashids.php b/config/hashids.php index e4d14ef..93f3345 100644 --- a/config/hashids.php +++ b/config/hashids.php @@ -38,8 +38,8 @@ 'connections' => [ 'main' => [ - 'salt' => 'your-salt-string', - 'length' => 'your-length-integer', + 'salt' => '', + 'length' => 0, // 'alphabet' => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' ], From 25845cc75f49e71a584b3df63020ecd2b63c12d0 Mon Sep 17 00:00:00 2001 From: David Knight Date: Wed, 11 May 2022 15:36:23 +0100 Subject: [PATCH 46/71] Update README.md (#165) Add missing semicolon. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fb2afef..ad9484e 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ class Foo public function bar($id) { - $this->hashids->encode($id) + $this->hashids->encode($id); } } From 699ea23c0f4d92330bcd06ca18392367145867be Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sat, 18 Jun 2022 11:13:59 +0200 Subject: [PATCH 47/71] Update workflow file --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c704f7f..57ed8bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,12 +13,11 @@ jobs: name: PHP ${{ matrix.php }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} coverage: xdebug - tools: composer:v2 - run: composer install --prefer-dist --no-interaction - run: vendor/bin/phpunit --coverage-text - run: vendor/bin/phpcs --standard=PSR12 --colors -n src tests From d30ad9fb270bc80243bc2278dcfde66120187183 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Fri, 5 Aug 2022 22:08:28 +0200 Subject: [PATCH 48/71] Update github workflows --- .github/workflows/php-cs-fixer.yml | 18 ++++++++++++++++++ .github/workflows/{ci.yml => phpunit.yml} | 3 +-- composer.json | 3 +-- 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/php-cs-fixer.yml rename .github/workflows/{ci.yml => phpunit.yml} (84%) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml new file mode 100644 index 0000000..6e6070e --- /dev/null +++ b/.github/workflows/php-cs-fixer.yml @@ -0,0 +1,18 @@ +name: PHP CS Fixer + +on: [push, pull_request] + +jobs: + run: + runs-on: ubuntu-latest + + name: PSR-12 + + steps: + - uses: actions/checkout@v3 + - uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + coverage: xdebug + tools: php-cs-fixer, cs2pr + - run: php-cs-fixer fix . --dry-run --rules=@PSR12 --format=checkstyle | cs2pr diff --git a/.github/workflows/ci.yml b/.github/workflows/phpunit.yml similarity index 84% rename from .github/workflows/ci.yml rename to .github/workflows/phpunit.yml index 57ed8bb..490c077 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/phpunit.yml @@ -1,4 +1,4 @@ -name: CI +name: PHPUnit on: [push, pull_request] @@ -20,4 +20,3 @@ jobs: coverage: xdebug - run: composer install --prefer-dist --no-interaction - run: vendor/bin/phpunit --coverage-text - - run: vendor/bin/phpcs --standard=PSR12 --colors -n src tests diff --git a/composer.json b/composer.json index ecfab86..b59cf27 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,7 @@ "graham-campbell/analyzer": "^3.0", "graham-campbell/testbench": "^5.7", "mockery/mockery": "^1.3", - "phpunit/phpunit": "^9.3", - "squizlabs/php_codesniffer": "^3.5" + "phpunit/phpunit": "^9.3" }, "minimum-stability": "dev", "prefer-stable": true, From 9fda80d8af380d62c00348dc3f86110c398fd8c8 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Fri, 5 Aug 2022 22:11:12 +0200 Subject: [PATCH 49/71] Rename github workflow --- .github/workflows/php-cs-fixer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 6e6070e..53961e0 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -1,4 +1,4 @@ -name: PHP CS Fixer +name: PHP-CS-Fixer on: [push, pull_request] From 87cc713f0608e20d9474a5407a2564a5c8b134e8 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 18 Oct 2022 14:33:19 +0200 Subject: [PATCH 50/71] Replace PSR-12 with PER --- .github/workflows/php-cs-fixer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 53961e0..dc5f271 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -6,7 +6,7 @@ jobs: run: runs-on: ubuntu-latest - name: PSR-12 + name: PER steps: - uses: actions/checkout@v3 @@ -15,4 +15,4 @@ jobs: php-version: 8.1 coverage: xdebug tools: php-cs-fixer, cs2pr - - run: php-cs-fixer fix . --dry-run --rules=@PSR12 --format=checkstyle | cs2pr + - run: php-cs-fixer fix . --dry-run --rules=@PER --format=checkstyle | cs2pr From 240f4625994894f69357bea11647db4f78b01a92 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Thu, 24 Nov 2022 14:28:36 +0100 Subject: [PATCH 51/71] Remove license from config --- config/hashids.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/config/hashids.php b/config/hashids.php index 93f3345..1c271a5 100644 --- a/config/hashids.php +++ b/config/hashids.php @@ -1,14 +1,5 @@ Date: Tue, 13 Dec 2022 09:25:40 +0100 Subject: [PATCH 52/71] Update php requirement --- .github/workflows/php-cs-fixer.yml | 2 +- .github/workflows/phpunit.yml | 2 +- composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index dc5f271..4df9745 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 coverage: xdebug tools: php-cs-fixer, cs2pr - run: php-cs-fixer fix . --dry-run --rules=@PER --format=checkstyle | cs2pr diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 490c077..03055af 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: [8.0, 8.1] + php: [8.1, 8.2] name: PHP ${{ matrix.php }} diff --git a/composer.json b/composer.json index b59cf27..2b8610c 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "graham-campbell/manager": "^4.7", "hashids/hashids": "^4.1", "illuminate/contracts": "^9.0", From b33b11eba29a6966f04347b3f44e3a88835fc783 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 13 Dec 2022 09:31:36 +0100 Subject: [PATCH 53/71] Revert php-cs-fixer php version --- .github/workflows/php-cs-fixer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 4df9745..dc5f271 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.1 coverage: xdebug tools: php-cs-fixer, cs2pr - run: php-cs-fixer fix . --dry-run --rules=@PER --format=checkstyle | cs2pr From 5fbdbf21c432a877c281f396dc65da39a910aed2 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 26 Feb 2023 19:30:57 +0100 Subject: [PATCH 54/71] Laravel 10 support (#175) Co-authored-by: Rohan Sakhale --- composer.json | 18 +++++++++--------- phpunit.xml.dist | 2 +- tests/AbstractTestCase.php | 2 +- tests/AnalysisTest.php | 4 ++-- tests/Facades/HashidsTest.php | 6 +++--- tests/HashidsFactoryTest.php | 6 +++--- tests/HashidsManagerTest.php | 4 ++-- tests/ServiceProviderTest.php | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/composer.json b/composer.json index 2b8610c..9a31629 100644 --- a/composer.json +++ b/composer.json @@ -14,16 +14,16 @@ ], "require": { "php": "^8.1", - "graham-campbell/manager": "^4.7", - "hashids/hashids": "^4.1", - "illuminate/contracts": "^9.0", - "illuminate/support": "^9.0" + "graham-campbell/manager": "^5.0", + "hashids/hashids": "^5.0", + "illuminate/contracts": "^10.0", + "illuminate/support": "^10.0" }, "require-dev": { - "graham-campbell/analyzer": "^3.0", - "graham-campbell/testbench": "^5.7", - "mockery/mockery": "^1.3", - "phpunit/phpunit": "^9.3" + "graham-campbell/analyzer": "^4.0", + "graham-campbell/testbench": "^6.0", + "mockery/mockery": "^1.5", + "phpunit/phpunit": "^10.0" }, "minimum-stability": "dev", "prefer-stable": true, @@ -42,7 +42,7 @@ }, "extra": { "branch-alias": { - "dev-master": "10.0-dev" + "dev-master": "11.0-dev" }, "laravel": { "aliases": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8c764af..d2915c1 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ - + ./src diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index 38836e3..d5e4625 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -18,7 +18,7 @@ abstract class AbstractTestCase extends AbstractPackageTestCase { - protected function getServiceProviderClass() + protected static function getServiceProviderClass(): string { return HashidsServiceProvider::class; } diff --git a/tests/AnalysisTest.php b/tests/AnalysisTest.php index 99eef97..68fc231 100644 --- a/tests/AnalysisTest.php +++ b/tests/AnalysisTest.php @@ -21,7 +21,7 @@ class AnalysisTest extends TestCase { use AnalysisTrait; - protected function getPaths() + protected static function getPaths(): array { return [ realpath(__DIR__ . '/../config'), @@ -30,7 +30,7 @@ protected function getPaths() ]; } - protected function getIgnored() + protected function getIgnored(): array { return [Application::class]; } diff --git a/tests/Facades/HashidsTest.php b/tests/Facades/HashidsTest.php index 463360c..a1b77e2 100644 --- a/tests/Facades/HashidsTest.php +++ b/tests/Facades/HashidsTest.php @@ -22,17 +22,17 @@ class HashidsTest extends AbstractTestCase { use FacadeTrait; - protected function getFacadeAccessor() + protected static function getFacadeAccessor(): string { return 'hashids'; } - protected function getFacadeClass() + protected static function getFacadeClass(): string { return Hashids::class; } - protected function getFacadeRoot() + protected static function getFacadeRoot(): string { return HashidsManager::class; } diff --git a/tests/HashidsFactoryTest.php b/tests/HashidsFactoryTest.php index 91b2cb9..43efcfb 100644 --- a/tests/HashidsFactoryTest.php +++ b/tests/HashidsFactoryTest.php @@ -18,20 +18,20 @@ class HashidsFactoryTest extends AbstractTestCase { - public function testMakeStandard() + public function testMakeStandard(): void { $factory = $this->getHashidsFactory(); $return = $factory->make([ 'salt' => 'your-salt-string', - 'length' => 'your-length-integer', + 'length' => 0, 'alphabet' => 'your-alphabet-string', ]); $this->assertInstanceOf(Hashids::class, $return); } - protected function getHashidsFactory() + protected function getHashidsFactory(): HashidsFactory { return new HashidsFactory(); } diff --git a/tests/HashidsManagerTest.php b/tests/HashidsManagerTest.php index ec55c59..1f91c5f 100644 --- a/tests/HashidsManagerTest.php +++ b/tests/HashidsManagerTest.php @@ -22,7 +22,7 @@ class HashidsManagerTest extends AbstractTestBenchTestCase { - public function testCreateConnection() + public function testCreateConnection(): void { $config = ['path' => __DIR__]; @@ -40,7 +40,7 @@ public function testCreateConnection() $this->assertArrayHasKey('hashids', $manager->getConnections()); } - protected function getManager(array $config) + protected function getManager(array $config): HashidsManager { $repository = Mockery::mock(Repository::class); $factory = Mockery::mock(HashidsFactory::class); diff --git a/tests/ServiceProviderTest.php b/tests/ServiceProviderTest.php index 76860cd..3550cf4 100644 --- a/tests/ServiceProviderTest.php +++ b/tests/ServiceProviderTest.php @@ -22,17 +22,17 @@ class ServiceProviderTest extends AbstractTestCase { use ServiceProviderTrait; - public function testHashidsFactoryIsInjectable() + public function testHashidsFactoryIsInjectable(): void { $this->assertIsInjectable(HashidsFactory::class); } - public function testHashidsManagerIsInjectable() + public function testHashidsManagerIsInjectable(): void { $this->assertIsInjectable(HashidsManager::class); } - public function testBindings() + public function testBindings(): void { $this->assertIsInjectable(Hashids::class); From 11cfd3aa069f213789d21c0383859358b0d448c2 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 13 Mar 2023 07:52:44 +0100 Subject: [PATCH 55/71] Update php-cs-fixer workflow --- .github/workflows/php-cs-fixer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index dc5f271..4df9745 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 coverage: xdebug tools: php-cs-fixer, cs2pr - run: php-cs-fixer fix . --dry-run --rules=@PER --format=checkstyle | cs2pr From 40398bad73f4fe58f51a482d830ee4446a98dc71 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 25 Apr 2023 08:34:45 +0200 Subject: [PATCH 56/71] Replace 503 broken image --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad9484e..fe6cae2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![hashids](https://cloud.githubusercontent.com/assets/499192/11159205/faa429ae-8a5d-11e5-8c5d-c60a89290c5e.png) +![Hashids](https://hashids.org/public/img/hashids.gif) # Laravel Hashids From 15b2a0658a8c69e7aa01c674d140ed24a07a5b16 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Fri, 28 Apr 2023 09:35:48 +0200 Subject: [PATCH 57/71] Revert "Replace 503 broken image" This reverts commit 40398bad73f4fe58f51a482d830ee4446a98dc71. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fe6cae2..ad9484e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Hashids](https://hashids.org/public/img/hashids.gif) +![hashids](https://cloud.githubusercontent.com/assets/499192/11159205/faa429ae-8a5d-11e5-8c5d-c60a89290c5e.png) # Laravel Hashids From 07602c9a414dfdda3cb2a85ce68a38ed1ab7750c Mon Sep 17 00:00:00 2001 From: Teodor <4704339+PixellUp@users.noreply.github.com> Date: Mon, 22 May 2023 09:38:22 +0300 Subject: [PATCH 58/71] remove dollar sign from copy command example (#183) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad9484e..751b6f1 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ composer require vinkla/hashids Laravel Hashids requires connection configuration. To get started, you'll need to publish all vendor assets: ```bash -$ php artisan vendor:publish +php artisan vendor:publish ``` This will create a `config/hashids.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases. From 6a8ab362e524113ce36e323f5992014798e4e21f Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 1 Oct 2023 10:09:05 +0200 Subject: [PATCH 59/71] Remove lumen support (#185) --- src/HashidsServiceProvider.php | 8 +------- tests/AnalysisTest.php | 6 ------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/HashidsServiceProvider.php b/src/HashidsServiceProvider.php index 86bda10..d81d79a 100644 --- a/src/HashidsServiceProvider.php +++ b/src/HashidsServiceProvider.php @@ -15,9 +15,7 @@ use Hashids\Hashids; use Illuminate\Contracts\Container\Container; -use Illuminate\Foundation\Application as LaravelApplication; use Illuminate\Support\ServiceProvider; -use Laravel\Lumen\Application as LumenApplication; class HashidsServiceProvider extends ServiceProvider { @@ -30,11 +28,7 @@ protected function setupConfig(): void { $source = realpath($raw = __DIR__ . '/../config/hashids.php') ?: $raw; - if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { - $this->publishes([$source => config_path('hashids.php')]); - } elseif ($this->app instanceof LumenApplication) { - $this->app->configure('hashids'); - } + $this->publishes([$source => config_path('hashids.php')]); $this->mergeConfigFrom($source, 'hashids'); } diff --git a/tests/AnalysisTest.php b/tests/AnalysisTest.php index 68fc231..39a985d 100644 --- a/tests/AnalysisTest.php +++ b/tests/AnalysisTest.php @@ -14,7 +14,6 @@ namespace Vinkla\Tests\Hashids; use GrahamCampbell\Analyzer\AnalysisTrait; -use Laravel\Lumen\Application; use PHPUnit\Framework\TestCase; class AnalysisTest extends TestCase @@ -29,9 +28,4 @@ protected static function getPaths(): array realpath(__DIR__), ]; } - - protected function getIgnored(): array - { - return [Application::class]; - } } From d2d8b32c4d56ae5e2820b729a8baf1dfaa2fe293 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 23 Oct 2023 09:11:19 +0200 Subject: [PATCH 60/71] Update GitHub workflows --- .github/workflows/php-cs-fixer.yml | 10 +++++++--- .github/workflows/phpunit.yml | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 4df9745..3d3f4ba 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -1,6 +1,10 @@ name: PHP-CS-Fixer -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: jobs: run: @@ -9,10 +13,10 @@ jobs: name: PER steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: 8.2 coverage: xdebug tools: php-cs-fixer, cs2pr - - run: php-cs-fixer fix . --dry-run --rules=@PER --format=checkstyle | cs2pr + - run: php-cs-fixer fix . --dry-run --rules=@PER-CS --format=checkstyle | cs2pr diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 03055af..fea7f5d 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -1,6 +1,10 @@ name: PHPUnit -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: jobs: run: @@ -13,7 +17,7 @@ jobs: name: PHP ${{ matrix.php }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} From 46f6b22ef9e9f0cbfdd98093e7f9ae7f3e7a5633 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Tue, 7 Nov 2023 08:38:21 +0100 Subject: [PATCH 61/71] Update PER workflow name --- .github/workflows/php-cs-fixer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 3d3f4ba..0d2dd7d 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -10,7 +10,7 @@ jobs: run: runs-on: ubuntu-latest - name: PER + name: PER-CS steps: - uses: actions/checkout@v4 From fc28cd509b792f7bf3e6cde6bb69468d26740ed7 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Wed, 8 Nov 2023 19:38:13 +0100 Subject: [PATCH 62/71] Update license --- LICENSE | 2 +- composer.json | 2 +- src/Facades/Hashids.php | 2 +- src/HashidsFactory.php | 2 +- src/HashidsManager.php | 2 +- src/HashidsServiceProvider.php | 2 +- tests/AbstractTestCase.php | 2 +- tests/AnalysisTest.php | 2 +- tests/Facades/HashidsTest.php | 2 +- tests/HashidsFactoryTest.php | 2 +- tests/HashidsManagerTest.php | 2 +- tests/ServiceProviderTest.php | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/LICENSE b/LICENSE index c1434b7..ce9d60f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) Vincent Klaiber +Copyright (c) Vincent Klaiber Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/composer.json b/composer.json index 9a31629..da7cbbe 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "authors": [ { "name": "Vincent Klaiber", - "email": "hello@doubledip.se" + "homepage": "https://github.com/vinkla" } ], "require": { diff --git a/src/Facades/Hashids.php b/src/Facades/Hashids.php index f902084..2db07ac 100644 --- a/src/Facades/Hashids.php +++ b/src/Facades/Hashids.php @@ -1,7 +1,7 @@ Date: Mon, 27 Nov 2023 08:37:01 +0100 Subject: [PATCH 63/71] Test with php 8.3 --- .github/workflows/php-cs-fixer.yml | 2 +- .github/workflows/phpunit.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 0d2dd7d..80273d1 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.3 coverage: xdebug tools: php-cs-fixer, cs2pr - run: php-cs-fixer fix . --dry-run --rules=@PER-CS --format=checkstyle | cs2pr diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index fea7f5d..5851ca6 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - php: [8.1, 8.2] + php: [8.1, 8.2, 8.3] name: PHP ${{ matrix.php }} From 71e4be8347d8c77dd728b61c1ff3b53cb4941ef1 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Mon, 5 Feb 2024 09:07:21 +0100 Subject: [PATCH 64/71] Added laravel 11 support --- .github/workflows/phpunit.yml | 2 +- composer.json | 14 +++++++------- phpunit.xml.dist | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 5851ca6..9e17d20 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - php: [8.1, 8.2, 8.3] + php: [8.2, 8.3] name: PHP ${{ matrix.php }} diff --git a/composer.json b/composer.json index da7cbbe..fa2e0b2 100644 --- a/composer.json +++ b/composer.json @@ -13,16 +13,16 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "graham-campbell/manager": "^5.0", "hashids/hashids": "^5.0", - "illuminate/contracts": "^10.0", - "illuminate/support": "^10.0" + "illuminate/contracts": "^11.0", + "illuminate/support": "^11.0" }, "require-dev": { - "graham-campbell/analyzer": "^4.0", - "graham-campbell/testbench": "^6.0", - "mockery/mockery": "^1.5", + "graham-campbell/analyzer": "^4.1", + "graham-campbell/testbench": "^6.1", + "mockery/mockery": "^1.6.6", "phpunit/phpunit": "^10.0" }, "minimum-stability": "dev", @@ -42,7 +42,7 @@ }, "extra": { "branch-alias": { - "dev-master": "11.0-dev" + "dev-master": "12.0-dev" }, "laravel": { "aliases": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d2915c1..c13aa67 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,13 +1,13 @@ - - - - ./src - - + ./tests + + + ./src + + From fde532096eccbff2ee6a9db26d335edc83090d9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 07:02:29 +0100 Subject: [PATCH 65/71] Update phpunit/phpunit requirement from ^10.0 to ^11.5 (#193) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fa2e0b2..d8498b2 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "graham-campbell/analyzer": "^4.1", "graham-campbell/testbench": "^6.1", "mockery/mockery": "^1.6.6", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.5" }, "minimum-stability": "dev", "prefer-stable": true, From 3ff5a7a94650814bd142a29c685182e2933fc17f Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 26 Jan 2025 16:45:51 +0100 Subject: [PATCH 66/71] Add PHP 8.4 to the testing matrix in PHPUnit workflow --- .github/workflows/phpunit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 9e17d20..27c66cb 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - php: [8.2, 8.3] + php: [8.2, 8.3, 8.4] name: PHP ${{ matrix.php }} From 2baaad4f09ae41c3a9abb97670e015629437739e Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 2 Feb 2025 12:05:19 +0100 Subject: [PATCH 67/71] Added note about Sqids (#194) --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 751b6f1..b1160a3 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,13 @@ $hashidsManager->encode(911); [![Monthly Downloads](https://badgen.net/packagist/dm/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids/stats) [![Latest Version](https://badgen.net/packagist/v/vinkla/hashids)](https://packagist.org/packages/vinkla/hashids) + + Sqids + + +> [!NOTE] +> The creator of Hashids has released a new, upgraded version rebranded as **Sqids**. However, Hashids will continue to be maintained and available for future use. For more information, please visit the [Sqids repository](https://github.com/sqids/sqids-php) and learn how it compares to Hashids on the [Sqids website](https://sqids.org/faq#hashids). **The API is so simple that you don't need a Laravel package at all.** + ## Installation Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project. From c5df29868395dc4532c7800f76a21f38b51da0cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:17:36 +0100 Subject: [PATCH 68/71] Update graham-campbell/analyzer requirement from ^4.1 to ^5.0 (#195) Updates the requirements on [graham-campbell/analyzer](https://github.com/GrahamCampbell/Analyzer) to permit the latest version. - [Release notes](https://github.com/GrahamCampbell/Analyzer/releases) - [Changelog](https://github.com/GrahamCampbell/Analyzer/blob/5.0/CHANGELOG.md) - [Commits](https://github.com/GrahamCampbell/Analyzer/compare/v4.1.0...v5.0.0) --- updated-dependencies: - dependency-name: graham-campbell/analyzer dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d8498b2..7499382 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "illuminate/support": "^11.0" }, "require-dev": { - "graham-campbell/analyzer": "^4.1", + "graham-campbell/analyzer": "^5.0", "graham-campbell/testbench": "^6.1", "mockery/mockery": "^1.6.6", "phpunit/phpunit": "^11.5" From f59ebf0d223b4986c4bdc76e6e694bf6056f8a0a Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 2 Mar 2025 22:39:35 +0100 Subject: [PATCH 69/71] Added Laravel 12 support (#196) * Added laravel 12 support * Bump graham-campbell/manager --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 7499382..6878e7b 100644 --- a/composer.json +++ b/composer.json @@ -14,10 +14,10 @@ ], "require": { "php": "^8.2", - "graham-campbell/manager": "^5.0", + "graham-campbell/manager": "^5.2", "hashids/hashids": "^5.0", - "illuminate/contracts": "^11.0", - "illuminate/support": "^11.0" + "illuminate/contracts": "^12.0", + "illuminate/support": "^12.0" }, "require-dev": { "graham-campbell/analyzer": "^5.0", From ac11e415f2cfbe093169986638e41d960ef8b7fa Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 2 Mar 2025 22:41:31 +0100 Subject: [PATCH 70/71] Remove branch alias --- composer.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/composer.json b/composer.json index 6878e7b..b6b8248 100644 --- a/composer.json +++ b/composer.json @@ -41,9 +41,6 @@ "preferred-install": "dist" }, "extra": { - "branch-alias": { - "dev-master": "12.0-dev" - }, "laravel": { "aliases": { "Hashids": "Vinkla\\Hashids\\Facades\\Hashids" From 2fdb0fbcf4a09c5057a2c542b8350453694569e0 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Sun, 6 Apr 2025 16:09:20 +0200 Subject: [PATCH 71/71] Support phpunit 12 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b6b8248..7aaa987 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "graham-campbell/analyzer": "^5.0", "graham-campbell/testbench": "^6.1", "mockery/mockery": "^1.6.6", - "phpunit/phpunit": "^11.5" + "phpunit/phpunit": "^11.5 || ^12.1" }, "minimum-stability": "dev", "prefer-stable": true,