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:----lUAomMOyLmTqx2z2pNFhPWuU7FEmttry9f7VZzRsioRMnB8/WyWT56NucC0z/bN7b+dxWg+11BCSWmh8m0fBMsIHcr48MiDM/ZuTj89hzpr+GIIii5u9HbXRvhLXkrRf0K9Iccj/nzs+xBJL6oG4pRcNuUH2chKLEAUSXNZqzH6VtcsYjFnFyXdf2XtlNdhNqIglZIV9uImYeKwZVVUGt57W4WD+xZebdS83DndOWVkP3KvN9w93ZZ25Zqrwn0PQZa0DLD5TkYu1sghSB0MTMINjEOjkdON7xPaB50PF5SfSWdc+wkbNpwuZWxU20VXPCoArrHDPtS74G0hYaqpG9dJH3hXqC7EAT7YS9VgKGdmAP3Kc26QR7wFq1fACahdIXVFuy06AXYexqrQEuJGhoUcvhPbm4EsV/aApd0V80iQWftKb7DGVwKNuSCUNjDwVLIDWVcaaO5rl6qN6ILOxIul5axXRMiumvqPA7CCldyNk9fsqh75BjWFqjS0kffEDfHEH7te8NXNelyVjVaMD4UMxr8QVAeaxijsgfDYorXKqmd4xW9BQAnzXOzMTWzGU0KIZTbH3CVhg9cUz+/SfuAsjmtUtplMJ79q+kC73trP6gE6WqjHAQ9A0Gy3fKFH8npy7cqAguTrHujx8ZGoUQr8UWMYp4f+tLQigkTCc7G0=----ATTACHMENT:----ODk3Nzg0NTU5NDEzMTI4NCA5MTQ1OTI4NTQ3MTMxNTk0IDg5NTE1MDY1NTQ0NjczMjc=