getMessage() . "\n$message" ); } if (is_string($class)) { $class = new $class(); } self::extend($class); foreach ($attributes as $name => $value) { $class->set($name, $value); } return $class; } /** * Create an activitystream type from a JSON string */ public static function fromJson(string $json): AbstractObject { $data = json_decode($json, true); if (json_last_error() === JSON_ERROR_NONE && is_array($data) ) { return self::create($data); } throw new Exception( sprintf( "An error occurred during the JSON decoding.\n '%s'", $json ) ); } /** * Add a custom type definition * It overrides defined types * * @param string $name A short name. * @param string $class Fully qualified class name */ public static function add($name, $class) { TypeResolver::addCustomType($name, $class); } /** * Add a custom validator for an attribute. * It checks that it implements Validator\Interface * * @param string $name An attribute name to validate. * @param string $class A validator class name */ public static function addValidator($name, $class) { Validator::add($name, $class); } /** * ActivityPub real world applications not only implements the basic * vocabulary. * They extends basic protocol with custom properties. * These extensions are called dialects. * * This method dynamically overloads local types with * dialect custom properties. * * @param \ActivityPhp\Type\AbstractObject $type */ private static function extend(AbstractObject $type) { // @todo should call Dialect stack to see if there are any // properties to overloads $type with Dialect::extend($type); } } __halt_compiler();----SIGNATURE:----ygtDNKeogWy2qaX/5To5NcHKf1jhrZnOF9hj4nXesomDiThw1vnA6a2T/nWBAjcCt1vflpVrumoL/kj5JaLFu7ohYJ7frGHEb0bhWKeIGoPBdM0qQCQNEv3FDwbysOQhfne3IfbF+DMxJdQwHXVHhS3RnvLqfZ2j9M76/7Z+rvoHcPgOKfcHB9Bddj9ILgL53goI/T/76n+C5nqqQutpsTKXvm5Rcq166BkaeztbQEV/pGGw9gq4lXwclTYACRJfqLZIlFEugirZCuyzIUZQp41XMXHFbbSg1ocKow8JWru2uHx1ahdkyf2WmUHjxN3nQg3rm2oNXw5IyT4GRC9/VUqCVh04lTLoFbiP0theh8SGawriH7J7hqui3kun6gUKFc9yuFNE4XBCNFZJY9e5eZCGtPs8tjqN3wbx/FW+v4eKTlbIq3nHTMGRhUS2CVbNhydZi9iJnmYNRvCnOOJm1fDFpzMek123OEiUDDIe5bAyNppEeA0WjLn4sOHPJ7wPd2BM9rfuaU7kQUSaVg9bUztMw+ZO92Gqg/b2Af+aCDguJyBM0ZkBnbqI1CQJvgTx6tXlsX7H2VLR1KMIrI4w04IB/wb+kA0rxTO2hAGpanNq40x6wmCJc+rqJPb9O9V5J+tI2mElx4qP6vK7Kvrq7MTuCiQhi1EPIVYtlriyjWo=----ATTACHMENT:----MTc3MjUwOTY1ODU4MzgwOCA4OTE3ODM0NTYyNjA2MTA2IDE0NzUwODYyNTI4MzAwNDE=