From 587a773827e374cde8f25262c3747a90d172c18e Mon Sep 17 00:00:00 2001 From: Mike Francis Date: Sun, 20 Feb 2022 11:00:06 +0000 Subject: [PATCH 1/2] Remove first part of namespace --- README.md | 18 +++++++++--------- composer.json | 10 +++++----- config/unleash.php | 12 ++++++------ src/Client.php | 2 +- src/Facades/Feature.php | 2 +- src/Facades/Unleash.php | 2 +- src/Middleware/FeatureDisabled.php | 4 ++-- src/Middleware/FeatureEnabled.php | 4 ++-- src/ServiceProvider.php | 6 +++--- src/Strategies/ApplicationHostnameStrategy.php | 4 ++-- src/Strategies/Contracts/DynamicStrategy.php | 2 +- src/Strategies/Contracts/Strategy.php | 2 +- src/Strategies/DefaultStrategy.php | 4 ++-- src/Strategies/RemoteAddressStrategy.php | 4 ++-- src/Strategies/UserWithIdStrategy.php | 4 ++-- src/Unleash.php | 6 +++--- .../ApplicationHostnameStrategyTest.php | 4 ++-- tests/Strategies/DefaultStrategyTest.php | 4 ++-- tests/Strategies/DynamicStrategyTest.php | 6 +++--- tests/Strategies/RemoteAddressStrategyTest.php | 4 ++-- tests/Strategies/UserWithIdStrategyTest.php | 4 ++-- tests/Stubs/ImplementedStrategy.php | 4 ++-- .../ImplementedStrategyThatIsDisabled.php | 4 ++-- tests/Stubs/NonImplementedStrategy.php | 2 +- tests/UnleashTest.php | 10 +++++----- 25 files changed, 64 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 2ecb479..8937d0c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Laravel Unleash -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/56b0c6402eca49169cbeb3f404c2bff9)](https://app.codacy.com/manual/mikefrancis/laravel-unleash?utm_source=github.com&utm_medium=referral&utm_content=mikefrancis/laravel-unleash&utm_campaign=Badge_Grade_Dashboard) -[![Packagist](https://img.shields.io/packagist/v/mikefrancis/laravel-unleash)](https://packagist.org/packages/mikefrancis/laravel-unleash) [![Build Status](https://github.com/mikefrancis/laravel-unleash/workflows/CI/badge.svg)](https://github.com/mikefrancis/laravel-unleash/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/mikefrancis/laravel-unleash/branch/master/graph/badge.svg)](https://codecov.io/gh/mikefrancis/laravel-unleash) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/56b0c6402eca49169cbeb3f404c2bff9)](https://app.codacy.com/manual/laravel-unleash/laravel-unleash?utm_source=github.com&utm_medium=referral&utm_content=laravel-unleash/laravel-unleash&utm_campaign=Badge_Grade_Dashboard) +[![Packagist](https://img.shields.io/packagist/v/laravel-unleash/laravel-unleash)](https://packagist.org/packages/laravel-unleash/laravel-unleash) [![Build Status](https://github.com/laravel-unleash/laravel-unleash/workflows/CI/badge.svg)](https://github.com/laravel-unleash/laravel-unleash/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/laravel-unleash/laravel-unleash/branch/master/graph/badge.svg)](https://codecov.io/gh/laravel-unleash/laravel-unleash) An [Unleash](https://unleash.github.io) client for Laravel. @@ -14,17 +14,17 @@ composer require mikefrancis/laravel-unleash Export package config: ```bash -php artisan vendor:publish --provider="MikeFrancis\LaravelUnleash\ServiceProvider" +php artisan vendor:publish --provider="LaravelUnleash\ServiceProvider" ``` ## Configuration -Documentation for configuration can be found in [config/unleash.php](https://github.com/mikefrancis/laravel-unleash/blob/master/config/unleash.php). +Documentation for configuration can be found in [config/unleash.php](https://github.com/laravel-unleash/laravel-unleash/blob/master/config/unleash.php). ## Usage ```php -use \MikeFrancis\LaravelUnleash\Unleash; +use LaravelUnleash\Unleash; $unleash = app(Unleash::class); @@ -84,7 +84,7 @@ $allFeatures = Feature::all(); If your strategy relies on dynamic data at runtime, you can pass additional arguments to the feature check functions: ```php -use \MikeFrancis\LaravelUnleash\Unleash; +use LaravelUnleash\Unleash; use Config; $unleash = app(Unleash::class); @@ -129,8 +129,8 @@ To use the middle, add the following to your `app/Http/Kernel.php`: ```php protected $routeMiddleware = [ // other middleware - 'feature.enabled' => \MikeFrancis\LaravelUnleash\Middleware\FeatureEnabled::class, - 'feature.disabled' => \MikeFrancis\LaravelUnleash\Middleware\FeatureDisabled::class, + 'feature.enabled' => \LaravelUnleash\Middleware\FeatureEnabled::class, + 'feature.disabled' => \LaravelUnleash\Middleware\FeatureDisabled::class, ]; ``` @@ -160,4 +160,4 @@ class ExampleController extends Controller } ``` -You cannot currently use dynamic strategy arguments with Middleware. \ No newline at end of file +You cannot currently use dynamic strategy arguments with Middleware. diff --git a/composer.json b/composer.json index 44d9628..14b43a4 100644 --- a/composer.json +++ b/composer.json @@ -14,12 +14,12 @@ }, "autoload": { "psr-4": { - "MikeFrancis\\LaravelUnleash\\": "src/" + "LaravelUnleash\\": "src/" } }, "autoload-dev": { "psr-4": { - "MikeFrancis\\LaravelUnleash\\Tests\\": "tests/" + "LaravelUnleash\\Tests\\": "tests/" } }, "license": "MIT", @@ -32,11 +32,11 @@ "extra": { "laravel": { "providers": [ - "MikeFrancis\\LaravelUnleash\\ServiceProvider" + "LaravelUnleash\\ServiceProvider" ], "aliases": { - "Unleash": "MikeFrancis\\LaravelUnleash\\Facades\\Unleash", - "Feature": "MikeFrancis\\LaravelUnleash\\Facades\\Feature" + "Unleash": "LaravelUnleash\\Facades\\Unleash", + "Feature": "LaravelUnleash\\Facades\\Feature" } } } diff --git a/config/unleash.php b/config/unleash.php index 8607868..8a33474 100644 --- a/config/unleash.php +++ b/config/unleash.php @@ -38,13 +38,13 @@ // Mapping of strategies used to guard features on Unleash. The default strategies are already // mapped below, and more strategies can be added - they just need to implement the - // `\MikeFrancis\LaravelUnleash\Strategies\Strategy` or - // `\MikeFrancis\LaravelUnleash\Strategies\DynamicStrategy` interface. If you would like to disable + // `\LaravelUnleash\Strategies\Strategy` or + // `\LaravelUnleash\Strategies\DynamicStrategy` interface. If you would like to disable // a built-in strategy, please comment it out or remove it below. 'strategies' => [ - 'applicationHostname' => \MikeFrancis\LaravelUnleash\Strategies\ApplicationHostnameStrategy::class, - 'default' => \MikeFrancis\LaravelUnleash\Strategies\DefaultStrategy::class, - 'remoteAddress' => \MikeFrancis\LaravelUnleash\Strategies\RemoteAddressStrategy::class, - 'userWithId' => \MikeFrancis\LaravelUnleash\Strategies\UserWithIdStrategy::class, + 'applicationHostname' => \LaravelUnleash\Strategies\ApplicationHostnameStrategy::class, + 'default' => \LaravelUnleash\Strategies\DefaultStrategy::class, + 'remoteAddress' => \LaravelUnleash\Strategies\RemoteAddressStrategy::class, + 'userWithId' => \LaravelUnleash\Strategies\UserWithIdStrategy::class, ], ]; diff --git a/src/Client.php b/src/Client.php index 1f5cbfd..6725fce 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,6 +1,6 @@ Date: Sun, 20 Feb 2022 11:04:29 +0000 Subject: [PATCH 2/2] Update references to master --- .github/workflows/main.yml | 8 ++++---- README.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00f31c5..9c40e48 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,13 +2,13 @@ name: CI -# Controls when the action will run. +# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch + # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ master ] + branches: [main] pull_request: - branches: [ master ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/README.md b/README.md index 8937d0c..3028c2b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Laravel Unleash [![Codacy Badge](https://api.codacy.com/project/badge/Grade/56b0c6402eca49169cbeb3f404c2bff9)](https://app.codacy.com/manual/laravel-unleash/laravel-unleash?utm_source=github.com&utm_medium=referral&utm_content=laravel-unleash/laravel-unleash&utm_campaign=Badge_Grade_Dashboard) -[![Packagist](https://img.shields.io/packagist/v/laravel-unleash/laravel-unleash)](https://packagist.org/packages/laravel-unleash/laravel-unleash) [![Build Status](https://github.com/laravel-unleash/laravel-unleash/workflows/CI/badge.svg)](https://github.com/laravel-unleash/laravel-unleash/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/laravel-unleash/laravel-unleash/branch/master/graph/badge.svg)](https://codecov.io/gh/laravel-unleash/laravel-unleash) +[![Packagist](https://img.shields.io/packagist/v/laravel-unleash/laravel-unleash)](https://packagist.org/packages/laravel-unleash/laravel-unleash) [![Build Status](https://github.com/laravel-unleash/laravel-unleash/workflows/CI/badge.svg)](https://github.com/laravel-unleash/laravel-unleash/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/laravel-unleash/laravel-unleash/branch/main/graph/badge.svg)](https://codecov.io/gh/laravel-unleash/laravel-unleash) An [Unleash](https://unleash.github.io) client for Laravel. @@ -19,7 +19,7 @@ php artisan vendor:publish --provider="LaravelUnleash\ServiceProvider" ## Configuration -Documentation for configuration can be found in [config/unleash.php](https://github.com/laravel-unleash/laravel-unleash/blob/master/config/unleash.php). +Documentation for configuration can be found in [config/unleash.php](https://github.com/laravel-unleash/laravel-unleash/blob/main/config/unleash.php). ## Usage