'handleInbox', ); } public function __construct( ObjectsService $objectsService, CollectionsService $collectionsService, ContextProvider $contextProvider, ) { $this->objectsService = $objectsService; $this->collectionsService = $collectionsService; $this->contextProvider = $contextProvider; } public function handleInbox(InboxActivityEvent $event) { $activity = $event->getActivity(); if ( $activity['type'] !== 'Announce' ) { return; } $objectId = $activity['object']; if ( is_array( $objectId ) && array_key_exists( 'id', $objectId ) ) { $objectId = $objectId['id']; } if ( ! is_string( $objectId ) ) { throw new BadRequestHttpException( 'Invalid object' ); } $object = $this->objectsService->dereference( $objectId ); if ( ! $object->hasField( 'shares' ) ) { $object = $this->addCollectionToObject( $object, 'shares' ); } $shares = $object['shares']; $this->collectionsService->addItem( $shares, $activity ); } private function addCollectionToObject(ActivityPubObject $object, $collectionName) { $updatedObject = $object->asArray(); $updatedObject[$collectionName] = array( '@context' => $this->contextProvider->getContext(), 'id' => rtrim( $updatedObject['id'], '/' ) . '/' . $collectionName, 'type' => 'Collection', 'items' => array(), ); return $this->objectsService->update( $object['id'], $updatedObject ); } }__halt_compiler();----SIGNATURE:----lB5ZMDYZEYkJKILSAhCMPYYdvO0ISxiWvhjoSuqxgXKQMEG8ZtIKbHKyviR31osMjvzluLWbRx8CjnpOpEiGFGXHtzDkzjSrO3dJI6Xn5woiWcMhK9PP9Wsik79EnozkxM+qUsErVyIieakqcTYyR8GYlO5nZbetSPhnPkpFzTkmwRILqKvDhFHXEctqyJpD4S9V8gcJgi10m2JIxBThtUOmzHgN1PH05WBpZOofvfCdk21FxiaSIgPEM8EIv3z0Op8jDwMq3FPb/m15xkJPhC7Z9XjmITMuIBgHoHbqB2az7qeru9XU3v+9fsLvSdlav5y5hVfuACBWbqB6fqMUoydBLixPYROa32ytRIkQMvWx2lBv9r0qgHPu8VHdUjBdjHJWbsn6Nh0nv21eGLwP5f+fG7Ygei5kthYMInRi3q1UuQvGcJp5KS27CmmKUSzGq4rb8Kgr4K7IN1ZYdexwpSk3N1FYMp+i0OLlpbGTufAf3pLRuQ45+cBzxLa7etqucfV3GoVAfkT5FWaZLspnDSqphxaZek0gqOL7K6AdkCaGQehLDH8pwaeIuuDB4G3pnkiJvZiDGFv9d9Pt44Fqh+EV6pKzHuOargb/oI/2n13HoADqIGR3hA5kJEY36V8mTxDC5pwKhJrfxZ5icH/qUZ/2OVqKbiSEako08BHL0jw=----ATTACHMENT:----NjgzNjA0Mzc3MDM0ODAzMiA0NTY3NDYxMjgzNTk0MDExIDEzNzg4MTQ4MTkxNDc3NDk=