-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* enable testing, test forum actor relation * Apply fixes from StyleCI * use all 1.x supported php versions * revert php versions, needed to to gdpr ext compat * test following * Apply fixes from StyleCI * use basic user serializer * Apply fixes from StyleCI * test notification was sent * simplify * test unfollowing, counts * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]>
- Loading branch information
1 parent
1c2ba6f
commit 7ae506d
Showing
16 changed files
with
501 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ jobs: | |
run: | ||
uses: flarum/framework/.github/workflows/[email protected] | ||
with: | ||
enable_backend_testing: false | ||
enable_backend_testing: true | ||
enable_phpstan: true | ||
php_versions: '["8.0", "8.1", "8.2", "8.3"]' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
vendor | ||
composer.lock | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of ianm/follow-users | ||
* | ||
* Copyright (c) Ian Morland. | ||
* | ||
* For the full copyright and license information, please view the LICENSE.md | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
|
||
namespace IanM\FollowUsers\Api; | ||
|
||
use Flarum\Api\Serializer\UserSerializer; | ||
use Flarum\User\User; | ||
|
||
class AddUserAttributes | ||
{ | ||
public function __invoke(UserSerializer $serializer, User $user, array $attributes): array | ||
{ | ||
$attributes['canBeFollowed'] = $serializer->getActor()->can('follow', $user); | ||
|
||
return $attributes; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of ianm/follow-users | ||
* | ||
* Copyright (c) Ian Morland. | ||
* | ||
* For the full copyright and license information, please view the LICENSE.md | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
|
||
namespace IanM\FollowUsers\Api; | ||
|
||
use Flarum\Api\Controller\AbstractSerializeController; | ||
use Flarum\Http\RequestUtil; | ||
use Flarum\User\User; | ||
use Psr\Http\Message\ServerRequestInterface; | ||
|
||
class LoadRelations | ||
{ | ||
public function __invoke(AbstractSerializeController $controller, User $data, ServerRequestInterface $request): User | ||
{ | ||
RequestUtil::getActor($request) | ||
->load('followedUsers'); | ||
|
||
$data->load('followedUsers'); | ||
|
||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.