. // }}} /** * ActivityPub implementation for GNU social * * @package GNUsocial * @category ActivityPub * * @author Diogo Peralta Cordeiro <@diogo.site> * @copyright 2021 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ namespace Plugin\ActivityPub\Util\Validator; use ActivityPhp\Type; use ActivityPhp\Type\Util; use Exception; use Plugin\ActivityPub\Util\ModelValidator; /** * manuallyApprovesFollowersModelValidator is a dedicated * validator for manuallyApprovesFollowers attribute. * * @copyright 2021 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ class manuallyApprovesFollowersModelValidator extends ModelValidator { /** * Validate manuallyApprovesFollowers value * * @param string $value * @param mixed $container A Person * * @throws Exception */ public function validate($value, $container): bool { // Validate that container is a Person Util::subclassOf($container, Type\Extended\Actor\Person::class, true); return true; //return $this->validateString($value) && in_array($value, ['as:manuallyApprovesFollowers', true, false]); } }