|
29 | 29 |
|
30 | 30 | $class = new GenericClass(
|
31 | 31 | id: '1234567890123456789.generic-object',
|
32 |
| - multipleDevicesAndHoldersAllowedStatus: MultipleDevicesAndHoldersAllowedStatus::MULTIPLE_HOLDERS, |
33 |
| - linksModuleData: new LinksModuleData( |
34 |
| - uris: [ |
35 |
| - new Uri(uri: 'https://example.org/app', description: 'App'), |
36 |
| - new Uri(uri: 'https://example.org', description: 'Homepage'), |
37 |
| - ] |
38 |
| - ), |
39 | 32 | imageModulesData: [
|
40 | 33 | new ImageModuleData(
|
41 | 34 | mainImage: Image::make('https://example.org/image.png')
|
|
46 | 39 | header: 'Lorem ipsum',
|
47 | 40 | body: 'Dolor sit amet'
|
48 | 41 | )
|
49 |
| - ] |
| 42 | + ], |
| 43 | + linksModuleData: new LinksModuleData( |
| 44 | + uris: [ |
| 45 | + new Uri(uri: 'https://example.org/app', description: 'App'), |
| 46 | + new Uri(uri: 'https://example.org', description: 'Homepage'), |
| 47 | + ] |
| 48 | + ), |
| 49 | + multipleDevicesAndHoldersAllowedStatus: MultipleDevicesAndHoldersAllowedStatus::MULTIPLE_HOLDERS |
50 | 50 | );
|
51 | 51 | $repository->create($class);
|
52 | 52 |
|
53 | 53 | $object = new GenericObject(
|
54 |
| - classId: '1234567890123456789.generic-object', |
55 |
| - id: '1234567890123456789.'.Str::uuid()->toString(), |
56 | 54 | cardTitle: LocalizedString::make('en', '::cardTitle::'),
|
57 |
| - subheader: LocalizedString::make('en', '::subheader::'), |
58 | 55 | header: LocalizedString::make('en', '::header::'),
|
| 56 | + subheader: LocalizedString::make('en', '::subheader::'), |
59 | 57 | logo: Image::make('https://example.org/logo.png'),
|
60 |
| - heroImage: Image::make('https://example.org/hero-image.png'), |
61 | 58 | hexBackgroundColor: '#333',
|
| 59 | + notifications: new Notifications( |
| 60 | + upcomingNotification: new UpcomingNotification( |
| 61 | + enableNotification: true |
| 62 | + ), |
| 63 | + ), |
| 64 | + classId: '1234567890123456789.generic-object', |
| 65 | + id: '1234567890123456789.'.Str::uuid()->toString(), |
| 66 | + heroImage: Image::make('https://example.org/hero-image.png'), |
62 | 67 | state: State::ACTIVE,
|
63 | 68 | barcode: new Barcode(
|
64 | 69 | type: BarcodeType::QR_CODE,
|
65 |
| - renderEncoding: BarcodeRenderEncoding::UTF_8, |
66 | 70 | value: '1464194291627',
|
| 71 | + renderEncoding: BarcodeRenderEncoding::UTF_8, |
67 | 72 | ),
|
68 | 73 | validTimeInterval: new TimeInterval(
|
69 | 74 | start: new DateTime(date: now()),
|
70 | 75 | end: new DateTime(now()->addMonth())
|
71 | 76 | ),
|
72 |
| - notifications: new Notifications( |
73 |
| - upcomingNotification: new UpcomingNotification( |
74 |
| - enableNotification: true |
75 |
| - ), |
76 |
| - ), |
77 | 77 | textModulesData: [
|
78 | 78 | new TextModuleData(
|
79 |
| - id: 'key-1', |
80 | 79 | header: 'label-1',
|
81 | 80 | body: 'value-1',
|
| 81 | + id: 'key-1', |
82 | 82 | ),
|
83 | 83 | new TextModuleData(
|
84 |
| - id: 'key-2', |
85 | 84 | header: 'label-2',
|
86 | 85 | body: 'value-2',
|
| 86 | + id: 'key-2', |
87 | 87 | )
|
88 | 88 | ],
|
89 | 89 | groupingInfo: new GroupingInfo(
|
90 | 90 | groupingId: 'group1'
|
91 | 91 | )
|
92 | 92 | );
|
93 | 93 |
|
94 |
| -$jwt = (new JWT([ |
95 |
| - 'iss' => $credentials->client_email, |
96 |
| - 'key' => $credentials->private_key, |
97 |
| - 'origins' => ['https://example.org'], |
98 |
| -]))->addOfferObject($object)->sign(); |
| 94 | +$jwt = (new JWT( |
| 95 | + iss: $credentials->client_email, |
| 96 | + key: $credentials->private_key, |
| 97 | + origins: ['https://example.org'], |
| 98 | +))->addGenericObject($object)->sign(); |
0 commit comments