From 1df65724771f8b19ddbce4ffa695639923475105 Mon Sep 17 00:00:00 2001 From: zingimmick Date: Tue, 9 Feb 2021 17:43:33 +0800 Subject: [PATCH] Rename namespace --- README.md | 22 +++++++++++----------- composer.json | 6 +++--- config/bookmark.php | 2 +- src/Bookmark.php | 10 +++++----- src/BookmarkServiceProvider.php | 2 +- src/Concerns/Bookmarkable.php | 6 +++--- src/Concerns/Bookmarker.php | 4 ++-- src/Events/Bookmarked.php | 2 +- src/Events/Unbookmarked.php | 2 +- tests/BookmarkTest.php | 14 +++++++------- tests/Concerns/BookmarkableTest.php | 22 +++++++++++----------- tests/Concerns/BookmarkerTest.php | 10 +++++----- tests/Events/BookmarkedTest.php | 10 +++++----- tests/Events/UnbookmarkedTest.php | 10 +++++----- tests/Models/Channel.php | 6 +++--- tests/Models/User.php | 8 ++++---- tests/TestCase.php | 6 +++--- 17 files changed, 71 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index 91b8186..6f89387 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ composer require laravel-interaction/bookmark ```php use Illuminate\Database\Eloquent\Model; -use Zing\LaravelBookmark\Concerns\Bookmarker; +use LaravelInteraction\Bookmark\Concerns\Bookmarker; class User extends Model { @@ -38,7 +38,7 @@ class User extends Model ```php use Illuminate\Database\Eloquent\Model; -use Zing\LaravelBookmark\Concerns\Bookmarkable; +use LaravelInteraction\Bookmark\Concerns\Bookmarkable; class Channel extends Model { @@ -49,9 +49,9 @@ class Channel extends Model ### Bookmarker ```php -use Zing\LaravelBookmark\Tests\Models\Channel; -/** @var \Zing\LaravelBookmark\Tests\Models\User $user */ -/** @var \Zing\LaravelBookmark\Tests\Models\Channel $channel */ +use LaravelInteraction\Bookmark\Tests\Models\Channel; +/** @var \LaravelInteraction\Bookmark\Tests\Models\User $user */ +/** @var \LaravelInteraction\Bookmark\Tests\Models\Channel $channel */ // Bookmark to Bookmarkable $user->bookmark($channel); $user->unbookmark($channel); @@ -77,10 +77,10 @@ Channel::query()->whereNotBookmarkedBy($user)->get(); ### Bookmarkable ```php -use Zing\LaravelBookmark\Tests\Models\User; -use Zing\LaravelBookmark\Tests\Models\Channel; -/** @var \Zing\LaravelBookmark\Tests\Models\User $user */ -/** @var \Zing\LaravelBookmark\Tests\Models\Channel $channel */ +use LaravelInteraction\Bookmark\Tests\Models\User; +use LaravelInteraction\Bookmark\Tests\Models\Channel; +/** @var \LaravelInteraction\Bookmark\Tests\Models\User $user */ +/** @var \LaravelInteraction\Bookmark\Tests\Models\Channel $channel */ // Compare Bookmarker $channel->isBookmarkedBy($user); $channel->isNotBookmarkedBy($user); @@ -102,8 +102,8 @@ $channels->each(function (Channel $channel){ | Event | Fired | | --- | --- | -| `Zing\LaravelBookmark\Events\Bookmarked` | When an object get bookmarked. | -| `Zing\LaravelBookmark\Events\Unbookmarked` | When an object get unbookmarked. | +| `LaravelInteraction\Bookmark\Events\Bookmarked` | When an object get bookmarked. | +| `LaravelInteraction\Bookmark\Events\Unbookmarked` | When an object get unbookmarked. | ## License diff --git a/composer.json b/composer.json index 88c016b..083fccd 100644 --- a/composer.json +++ b/composer.json @@ -27,18 +27,18 @@ }, "autoload": { "psr-4": { - "Zing\\LaravelBookmark\\": "src" + "LaravelInteraction\\Bookmark\\": "src" } }, "autoload-dev": { "psr-4": { - "Zing\\LaravelBookmark\\Tests\\": "tests" + "LaravelInteraction\\Bookmark\\Tests\\": "tests" } }, "extra": { "laravel": { "providers": [ - "Zing\\LaravelBookmark\\BookmarkServiceProvider" + "LaravelInteraction\\Bookmark\\BookmarkServiceProvider" ] } }, diff --git a/config/bookmark.php b/config/bookmark.php index f1c0d67..7cef1d4 100644 --- a/config/bookmark.php +++ b/config/bookmark.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Zing\LaravelBookmark\Bookmark; +use LaravelInteraction\Bookmark\Bookmark; return [ 'load_migrations' => true, diff --git a/src/Bookmark.php b/src/Bookmark.php index c78f889..217359f 100644 --- a/src/Bookmark.php +++ b/src/Bookmark.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark; +namespace LaravelInteraction\Bookmark; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; @@ -10,16 +10,16 @@ use Illuminate\Database\Eloquent\Relations\MorphPivot; use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Support\Str; -use Zing\LaravelBookmark\Events\Bookmarked; -use Zing\LaravelBookmark\Events\Unbookmarked; +use LaravelInteraction\Bookmark\Events\Bookmarked; +use LaravelInteraction\Bookmark\Events\Unbookmarked; /** * @property \Illuminate\Database\Eloquent\Model $user * @property \Illuminate\Database\Eloquent\Model $bookmarker * @property \Illuminate\Database\Eloquent\Model $bookmarkable * - * @method static \Zing\LaravelBookmark\Bookmark|\Illuminate\Database\Eloquent\Builder withType(string $type) - * @method static \Zing\LaravelBookmark\Bookmark|\Illuminate\Database\Eloquent\Builder query() + * @method static \LaravelInteraction\Bookmark\Bookmark|\Illuminate\Database\Eloquent\Builder withType(string $type) + * @method static \LaravelInteraction\Bookmark\Bookmark|\Illuminate\Database\Eloquent\Builder query() */ class Bookmark extends MorphPivot { diff --git a/src/BookmarkServiceProvider.php b/src/BookmarkServiceProvider.php index e3cf545..81bea2b 100644 --- a/src/BookmarkServiceProvider.php +++ b/src/BookmarkServiceProvider.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark; +namespace LaravelInteraction\Bookmark; use Illuminate\Support\ServiceProvider; diff --git a/src/Concerns/Bookmarkable.php b/src/Concerns/Bookmarkable.php index d0ab8b9..e3a5ded 100644 --- a/src/Concerns/Bookmarkable.php +++ b/src/Concerns/Bookmarkable.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Concerns; +namespace LaravelInteraction\Bookmark\Concerns; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; @@ -11,8 +11,8 @@ use function is_a; /** - * @property-read \Illuminate\Database\Eloquent\Collection|\Zing\LaravelBookmark\Bookmark[] $bookmarkableBookmarks - * @property-read \Illuminate\Database\Eloquent\Collection|\Zing\LaravelBookmark\Concerns\Bookmarker[] $bookmarkers + * @property-read \Illuminate\Database\Eloquent\Collection|\LaravelInteraction\Bookmark\Bookmark[] $bookmarkableBookmarks + * @property-read \Illuminate\Database\Eloquent\Collection|\LaravelInteraction\Bookmark\Concerns\Bookmarker[] $bookmarkers * @property-read int|null $bookmarkers_count * * @method static static|\Illuminate\Database\Eloquent\Builder whereBookmarkedBy(\Illuminate\Database\Eloquent\Model $user) diff --git a/src/Concerns/Bookmarker.php b/src/Concerns/Bookmarker.php index 9b32671..ba6ffed 100644 --- a/src/Concerns/Bookmarker.php +++ b/src/Concerns/Bookmarker.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Concerns; +namespace LaravelInteraction\Bookmark\Concerns; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\MorphToMany; /** - * @property-read \Illuminate\Database\Eloquent\Collection|\Zing\LaravelBookmark\Bookmark[] $bookmarkerBookmarks + * @property-read \Illuminate\Database\Eloquent\Collection|\LaravelInteraction\Bookmark\Bookmark[] $bookmarkerBookmarks * @property-read int|null $bookmarkerBookmarks_count */ trait Bookmarker diff --git a/src/Events/Bookmarked.php b/src/Events/Bookmarked.php index 17a05f3..e2ed6d3 100644 --- a/src/Events/Bookmarked.php +++ b/src/Events/Bookmarked.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Events; +namespace LaravelInteraction\Bookmark\Events; use Illuminate\Database\Eloquent\Model; diff --git a/src/Events/Unbookmarked.php b/src/Events/Unbookmarked.php index 0d96e4b..445b341 100644 --- a/src/Events/Unbookmarked.php +++ b/src/Events/Unbookmarked.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Events; +namespace LaravelInteraction\Bookmark\Events; use Illuminate\Database\Eloquent\Model; diff --git a/tests/BookmarkTest.php b/tests/BookmarkTest.php index b4a82dd..b685e01 100644 --- a/tests/BookmarkTest.php +++ b/tests/BookmarkTest.php @@ -2,27 +2,27 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Tests; +namespace LaravelInteraction\Bookmark\Tests; use Illuminate\Support\Carbon; -use Zing\LaravelBookmark\Bookmark; -use Zing\LaravelBookmark\Tests\Models\Channel; -use Zing\LaravelBookmark\Tests\Models\User; +use LaravelInteraction\Bookmark\Bookmark; +use LaravelInteraction\Bookmark\Tests\Models\Channel; +use LaravelInteraction\Bookmark\Tests\Models\User; class BookmarkTest extends TestCase { /** - * @var \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|\Zing\LaravelBookmark\Tests\Models\User + * @var \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|\LaravelInteraction\Bookmark\Tests\Models\User */ protected $user; /** - * @var \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|\Zing\LaravelBookmark\Tests\Models\Channel + * @var \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|\LaravelInteraction\Bookmark\Tests\Models\Channel */ protected $channel; /** - * @var \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|\Zing\LaravelBookmark\Bookmark|null + * @var \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|\LaravelInteraction\Bookmark\Bookmark|null */ protected $bookmark; diff --git a/tests/Concerns/BookmarkableTest.php b/tests/Concerns/BookmarkableTest.php index 14a80d8..bb8a949 100644 --- a/tests/Concerns/BookmarkableTest.php +++ b/tests/Concerns/BookmarkableTest.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Tests\Concerns; +namespace LaravelInteraction\Bookmark\Tests\Concerns; +use LaravelInteraction\Bookmark\Tests\Models\Channel; +use LaravelInteraction\Bookmark\Tests\Models\User; +use LaravelInteraction\Bookmark\Tests\TestCase; use Mockery; -use Zing\LaravelBookmark\Tests\Models\Channel; -use Zing\LaravelBookmark\Tests\Models\User; -use Zing\LaravelBookmark\Tests\TestCase; class BookmarkableTest extends TestCase { @@ -22,7 +22,7 @@ public function modelClasses(): array /** * @dataProvider modelClasses * - * @param \Zing\LaravelBookmark\Tests\Models\User|\Zing\LaravelBookmark\Tests\Models\Channel|string $modelClass + * @param \LaravelInteraction\Bookmark\Tests\Models\User|\LaravelInteraction\Bookmark\Tests\Models\Channel|string $modelClass */ public function testBookmarkableBookmarks(string $modelClass): void { @@ -36,7 +36,7 @@ public function testBookmarkableBookmarks(string $modelClass): void /** * @dataProvider modelClasses * - * @param \Zing\LaravelBookmark\Tests\Models\User|\Zing\LaravelBookmark\Tests\Models\Channel|string $modelClass + * @param \LaravelInteraction\Bookmark\Tests\Models\User|\LaravelInteraction\Bookmark\Tests\Models\Channel|string $modelClass */ public function testBookmarkersCount(string $modelClass): void { @@ -88,7 +88,7 @@ public function testBookmarkersCountForHumans($actual, $onePrecision, $twoPrecis /** * @dataProvider modelClasses * - * @param \Zing\LaravelBookmark\Tests\Models\User|\Zing\LaravelBookmark\Tests\Models\Channel|string $modelClass + * @param \LaravelInteraction\Bookmark\Tests\Models\User|\LaravelInteraction\Bookmark\Tests\Models\Channel|string $modelClass */ public function testIsBookmarkedBy(string $modelClass): void { @@ -107,7 +107,7 @@ public function testIsBookmarkedBy(string $modelClass): void /** * @dataProvider modelClasses * - * @param \Zing\LaravelBookmark\Tests\Models\User|\Zing\LaravelBookmark\Tests\Models\Channel|string $modelClass + * @param \LaravelInteraction\Bookmark\Tests\Models\User|\LaravelInteraction\Bookmark\Tests\Models\Channel|string $modelClass */ public function testIsNotBookmarkedBy(string $modelClass): void { @@ -126,7 +126,7 @@ public function testIsNotBookmarkedBy(string $modelClass): void /** * @dataProvider modelClasses * - * @param \Zing\LaravelBookmark\Tests\Models\User|\Zing\LaravelBookmark\Tests\Models\Channel|string $modelClass + * @param \LaravelInteraction\Bookmark\Tests\Models\User|\LaravelInteraction\Bookmark\Tests\Models\Channel|string $modelClass */ public function testBookmarkers(string $modelClass): void { @@ -141,7 +141,7 @@ public function testBookmarkers(string $modelClass): void /** * @dataProvider modelClasses * - * @param \Zing\LaravelBookmark\Tests\Models\User|\Zing\LaravelBookmark\Tests\Models\Channel|string $modelClass + * @param \LaravelInteraction\Bookmark\Tests\Models\User|\LaravelInteraction\Bookmark\Tests\Models\Channel|string $modelClass */ public function testScopeWhereBookmarkedBy(string $modelClass): void { @@ -156,7 +156,7 @@ public function testScopeWhereBookmarkedBy(string $modelClass): void /** * @dataProvider modelClasses * - * @param \Zing\LaravelBookmark\Tests\Models\User|\Zing\LaravelBookmark\Tests\Models\Channel|string $modelClass + * @param \LaravelInteraction\Bookmark\Tests\Models\User|\LaravelInteraction\Bookmark\Tests\Models\Channel|string $modelClass */ public function testScopeWhereNotBookmarkedBy(string $modelClass): void { diff --git a/tests/Concerns/BookmarkerTest.php b/tests/Concerns/BookmarkerTest.php index 7c98270..1c3ddb5 100644 --- a/tests/Concerns/BookmarkerTest.php +++ b/tests/Concerns/BookmarkerTest.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Tests\Concerns; +namespace LaravelInteraction\Bookmark\Tests\Concerns; -use Zing\LaravelBookmark\Bookmark; -use Zing\LaravelBookmark\Tests\Models\Channel; -use Zing\LaravelBookmark\Tests\Models\User; -use Zing\LaravelBookmark\Tests\TestCase; +use LaravelInteraction\Bookmark\Bookmark; +use LaravelInteraction\Bookmark\Tests\Models\Channel; +use LaravelInteraction\Bookmark\Tests\Models\User; +use LaravelInteraction\Bookmark\Tests\TestCase; class BookmarkerTest extends TestCase { diff --git a/tests/Events/BookmarkedTest.php b/tests/Events/BookmarkedTest.php index 72102e1..ee54ee6 100644 --- a/tests/Events/BookmarkedTest.php +++ b/tests/Events/BookmarkedTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Tests\Events; +namespace LaravelInteraction\Bookmark\Tests\Events; use Illuminate\Support\Facades\Event; -use Zing\LaravelBookmark\Events\Bookmarked; -use Zing\LaravelBookmark\Tests\Models\Channel; -use Zing\LaravelBookmark\Tests\Models\User; -use Zing\LaravelBookmark\Tests\TestCase; +use LaravelInteraction\Bookmark\Events\Bookmarked; +use LaravelInteraction\Bookmark\Tests\Models\Channel; +use LaravelInteraction\Bookmark\Tests\Models\User; +use LaravelInteraction\Bookmark\Tests\TestCase; class BookmarkedTest extends TestCase { diff --git a/tests/Events/UnbookmarkedTest.php b/tests/Events/UnbookmarkedTest.php index 7b75025..9938167 100644 --- a/tests/Events/UnbookmarkedTest.php +++ b/tests/Events/UnbookmarkedTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Tests\Events; +namespace LaravelInteraction\Bookmark\Tests\Events; use Illuminate\Support\Facades\Event; -use Zing\LaravelBookmark\Events\Unbookmarked; -use Zing\LaravelBookmark\Tests\Models\Channel; -use Zing\LaravelBookmark\Tests\Models\User; -use Zing\LaravelBookmark\Tests\TestCase; +use LaravelInteraction\Bookmark\Events\Unbookmarked; +use LaravelInteraction\Bookmark\Tests\Models\Channel; +use LaravelInteraction\Bookmark\Tests\Models\User; +use LaravelInteraction\Bookmark\Tests\TestCase; class UnbookmarkedTest extends TestCase { diff --git a/tests/Models/Channel.php b/tests/Models/Channel.php index 598f510..0685b41 100644 --- a/tests/Models/Channel.php +++ b/tests/Models/Channel.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Tests\Models; +namespace LaravelInteraction\Bookmark\Tests\Models; use Illuminate\Database\Eloquent\Model; -use Zing\LaravelBookmark\Concerns\Bookmarkable; +use LaravelInteraction\Bookmark\Concerns\Bookmarkable; /** - * @method static \Zing\LaravelBookmark\Tests\Models\Channel|\Illuminate\Database\Eloquent\Builder query() + * @method static \LaravelInteraction\Bookmark\Tests\Models\Channel|\Illuminate\Database\Eloquent\Builder query() */ class Channel extends Model { diff --git a/tests/Models/User.php b/tests/Models/User.php index 77e7e05..49109cc 100644 --- a/tests/Models/User.php +++ b/tests/Models/User.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Tests\Models; +namespace LaravelInteraction\Bookmark\Tests\Models; use Illuminate\Database\Eloquent\Model; -use Zing\LaravelBookmark\Concerns\Bookmarkable; -use Zing\LaravelBookmark\Concerns\Bookmarker; +use LaravelInteraction\Bookmark\Concerns\Bookmarkable; +use LaravelInteraction\Bookmark\Concerns\Bookmarker; /** - * @method static \Zing\LaravelBookmark\Tests\Models\User|\Illuminate\Database\Eloquent\Builder query() + * @method static \LaravelInteraction\Bookmark\Tests\Models\User|\Illuminate\Database\Eloquent\Builder query() */ class User extends Model { diff --git a/tests/TestCase.php b/tests/TestCase.php index e585af7..fa218d1 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Zing\LaravelBookmark\Tests; +namespace LaravelInteraction\Bookmark\Tests; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use LaravelInteraction\Bookmark\BookmarkServiceProvider; +use LaravelInteraction\Bookmark\Tests\Models\User; use Orchestra\Testbench\TestCase as BaseTestCase; -use Zing\LaravelBookmark\BookmarkServiceProvider; -use Zing\LaravelBookmark\Tests\Models\User; class TestCase extends BaseTestCase {