Passed
Pull Request — master (#103)
by Razvan
05:12 queued 02:43
created

Pass   F

Complexity

Total Complexity 76

Size/Duplication

Total Lines 887
Duplicated Lines 0 %

Test Coverage

Coverage 91.67%

Importance

Changes 6
Bugs 1 Features 1
Metric Value
wmc 76
eloc 183
c 6
b 1
f 1
dl 0
loc 887
ccs 198
cts 216
cp 0.9167
rs 2.32

65 Methods

Rating   Name   Duplication   Size   Complexity  
A getAppLaunchURL() 0 3 1
A setBackgroundColor() 0 5 1
A setExpirationDate() 0 5 1
A setSerialNumber() 0 5 1
A setMaxDistance() 0 5 1
A setSuppressStripShine() 0 5 1
A setDescription() 0 5 1
A getAuthenticationToken() 0 3 1
A addImage() 0 5 1
A getSuppressStripShine() 0 3 1
A getPassTypeIdentifier() 0 3 1
A getImages() 0 3 1
A getDescription() 0 3 1
A setType() 0 5 1
A addBeacon() 0 5 1
A getSerialNumber() 0 3 1
A getFormatVersion() 0 3 1
C toArray() 0 71 11
A getLabelColor() 0 3 1
A setStructure() 0 5 1
A setTeamIdentifier() 0 5 1
A getAssociatedStoreIdentifiers() 0 3 1
A setFormatVersion() 0 5 1
A __construct() 0 5 1
A getTeamIdentifier() 0 3 1
A setForegroundColor() 0 5 1
A setAppLaunchURL() 0 5 1
A getUserInfo() 0 3 1
A setOrganizationName() 0 5 1
A getLogoText() 0 3 1
A addAssociatedStoreIdentifier() 0 5 1
A addBarcode() 0 9 2
A getExpirationDate() 0 3 1
A getOrganizationName() 0 3 1
A getWebServiceURL() 0 3 1
A setNfc() 0 5 1
A getBeacons() 0 3 1
A getStructure() 0 3 1
A getMaxDistance() 0 3 1
A getNfc() 0 3 1
A addLocation() 0 5 1
A getSharingProhibited() 0 3 1
A getGroupingIdentifier() 0 3 1
A setVoided() 0 5 1
A getLocations() 0 3 1
A setPassTypeIdentifier() 0 5 1
A setLogoText() 0 5 1
A setLabelColor() 0 5 1
A setUserInfo() 0 5 1
A setAuthenticationToken() 0 5 1
A setWebServiceURL() 0 5 1
A getForegroundColor() 0 3 1
A addNfc() 0 5 1
A getBarcode() 0 3 1
A setSharingProhibited() 0 5 1
A setBarcode() 0 6 1
A setRelevantDate() 0 5 1
A getVoided() 0 3 1
A addLocalization() 0 5 1
A getRelevantDate() 0 3 1
A getLocalizations() 0 3 1
A getBackgroundColor() 0 3 1
A setGroupingIdentifier() 0 5 1
A getType() 0 3 1
A getBarcodes() 0 3 1

How to fix   Complexity   

Complex Class

Complex classes like Pass often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use Pass, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
/*
4
 * This file is part of the Passbook package.
5
 *
6
 * (c) Eymen Gunay <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Passbook;
13
14
use DateTime;
15
use Passbook\Pass\BarcodeInterface;
16
use Passbook\Pass\BeaconInterface;
17
use Passbook\Pass\NfcInterface;
18
use Passbook\Pass\ImageInterface;
19
use Passbook\Pass\LocalizationInterface;
20
use Passbook\Pass\LocationInterface;
21
use Passbook\Pass\Structure;
22
use Passbook\Pass\StructureInterface;
23
24
/**
25
 * Pass
26
 *
27
 * @author Eymen Gunay <[email protected]>
28
 * @author Sotaro Omura <http://omoon.org>
29
 * @author Dzamir <https://github.com/Dzamir>
30
 */
31
class Pass implements PassInterface
32
{
33
    /**
34
     * Serial number that uniquely identifies the pass.
35
     * No two passes with the same pass type identifier
36
     * may have the same serial number.
37
     *
38
     * @var string
39
     */
40
    protected $serialNumber;
41
42
    /**
43
     * Brief description of the pass,
44
     * used by the iOS accessibility technologies.
45
     *
46
     * @var string
47
     */
48
    protected $description;
49
50
    /**
51
     * Version of the file format.
52
     * The value must be 1.
53
     *
54
     * @var int
55
     */
56
    protected $formatVersion = 1;
57
58
    /**
59
     * Pass type
60
     *
61
     * @var string
62
     */
63
    protected $type;
64
65
    /**
66
     * Pass structure
67
     *
68
     * @var StructureInterface
69
     */
70
    protected $structure;
71
72
    /**
73
     * Pass images
74
     *
75
     * @var ImageInterface[]
76
     */
77
    protected $images = [];
78
79
    /**
80
     * Beacons where the pass is relevant.
81
     *
82
     * @var array
83
     */
84
    protected $beacons = [];
85
86
    /**
87
     * NFC where the pass is relevant.
88
     *
89
     * @var NfcInterface[]
90
     */
91
    protected $nfc = [];
92
93
    /**
94
     * A list of iTunes Store item identifiers (also known as Adam IDs) for the
95
     * associated apps.
96
     *
97
     * Only one item in the list is used—the first item identifier for an app
98
     * compatible with the current device. If the app is not installed, the
99
     * link opens the App Store and shows the app. If the app is already
100
     * installed, the link launches the app.
101
     *
102
     * @var int[]
103
     */
104
    protected $associatedStoreIdentifiers = [];
105
106
    /**
107
     * Locations where the pass is relevant.
108
     * For example, the location of your store.
109
     *
110
     * @var array
111
     */
112
    protected $locations = [];
113
114
    /**
115
     * List of localizations
116
     *
117
     * @var LocalizationInterface[]
118
     */
119
    protected $localizations = [];
120
121
    /**
122
     * Date and time when the pass becomes relevant.
123
     * For example, the start time of a movie.
124
     *
125
     * @var DateTime
126
     */
127
    protected $relevantDate;
128
129
    /**
130
     * Maximum distance in meters from a relevant latitude and longitude that
131
     * the pass is relevant. This number is compared to the pass’s default
132
     * distance and the smaller value is used.
133
     * Available in iOS 7.0.
134
     * @var int
135
     */
136
    protected $maxDistance;
137
138
    /**
139
     * Barcodes available to be displayed of iOS 9 and later. The system uses
140
     * the first valid barcode in the array.
141
     * @var BarcodeInterface[]
142
     */
143
    protected $barcodes = [];
144
145
    /**
146
     * Barcode to be displayed for iOS 8 and earlier.
147
     * @var BarcodeInterface
148
     */
149
    protected $barcode;
150
151
    /**
152
     * Background color of the pass, specified as an CSS-style RGB triple.
153
     *
154
     * @var string rgb(23, 187, 82)
155
     */
156
    protected $backgroundColor;
157
158
    /**
159
     * Foreground color of the pass, specified as a CSS-style RGB triple.
160
     *
161
     * @var string rgb(100, 10, 110)
162
     */
163
    protected $foregroundColor;
164
165
    /**
166
     * Identifier used to group related passes.
167
     * If a grouping identifier is specified, passes with the same style, pass type identifier,
168
     * and grouping identifier are displayed as a group. Otherwise, passes are grouped automatically.
169
     *
170
     * @var string
171
     */
172
    protected $groupingIdentifier;
173
174
    /**
175
     * Color of the label text, specified as a CSS-style RGB triple.
176
     *
177
     * @var string rgb(255, 255, 255)
178
     */
179
    protected $labelColor;
180
181
    /**
182
     * Text displayed next to the logo on the pass.
183
     *
184
     * @var string
185
     */
186
    protected $logoText;
187
188
    /**
189
     * If true, the strip image is displayed without a shine effect.
190
     *
191
     * @var string The default value is false
192
     */
193
    protected $suppressStripShine;
194
195
    /**
196
     * The authentication token to use with the web service.
197
     * The token must be 16 characters or longer.
198
     *
199
     * @var string
200
     */
201
    protected $authenticationToken;
202
203
    /**
204
     * The URL of a web service that conforms to the API described in Passbook Web Service Reference.
205
     * http://developer.apple.com/library/ios/documentation/PassKit/Reference/PassKit_WebService/WebService.html#//apple_ref/doc/uid/TP40011988
206
     *
207
     * @var string
208
     */
209
    protected $webServiceURL;
210
211
    /**
212
     * Pass type identifier
213
     *
214
     * @var string
215
     */
216
    protected $passTypeIdentifier;
217
218
    /**
219
     * Team identifier
220
     *
221
     * @var string
222
     */
223
    protected $teamIdentifier;
224
225
    /**
226
     * Organization name
227
     *
228
     * @var string
229
     */
230
    protected $organizationName;
231
232
    /**
233
     * Date and time when the pass expires.
234
     *
235
     * @var DateTime
236
     */
237
    protected $expirationDate;
238
239
    /**
240
     * Indicates that the pass is void—for example, a one time use coupon that has been redeemed. The default value is
241
     * false.
242
     *
243
     * @var boolean
244
     */
245
    protected $voided;
246
247
    /**
248
     *
249
     * A URL to be passed to the associated app when launching it.
250
     * The app receives this URL in the application:didFinishLaunchingWithOptions: and application:handleOpenURL:
251
     * methods of its app delegate. If this key is present, the associatedStoreIdentifiers key must also be present.
252
     *
253
     * @var string
254
     */
255
    protected $appLaunchURL;
256
257
    /**
258
     * Pass userInfo
259
     *
260
     * @var mixed
261
     */
262
    protected $userInfo;
263
264
    /**
265
     *
266
     * Flag to decide if the pass can be shared or not.
267
     *
268
     * @var bool
269
     *
270
     */
271
    protected bool $sharingProhibited = false;
272
273 29
    public function __construct($serialNumber, $description)
274
    {
275
        // Required
276 29
        $this->setSerialNumber($serialNumber);
277 29
        $this->setDescription($description);
278
    }
279
280 10
    public function toArray()
281
    {
282 10
        $array = [];
283
284
        // Structure
285 10
        if ($this->getStructure()) {
286 5
            $array[$this->getType()] = $this->getStructure()->toArray();
287
        }
288
289 10
        $properties = [
290 10
            'serialNumber',
291 10
            'description',
292 10
            'formatVersion',
293 10
            'beacons',
294 10
            'nfc',
295 10
            'locations',
296 10
            'maxDistance',
297 10
            'relevantDate',
298 10
            'barcode',
299 10
            'barcodes',
300 10
            'backgroundColor',
301 10
            'foregroundColor',
302 10
            'groupingIdentifier',
303 10
            'labelColor',
304 10
            'logoText',
305 10
            'suppressStripShine',
306 10
            'authenticationToken',
307 10
            'webServiceURL',
308 10
            'passTypeIdentifier',
309 10
            'teamIdentifier',
310 10
            'organizationName',
311 10
            'expirationDate',
312 10
            'voided',
313 10
            'appLaunchURL',
314 10
            'associatedStoreIdentifiers',
315 10
            'userInfo',
316 10
            'sharingProhibited'
317 10
        ];
318 10
        foreach ($properties as $property) {
319 10
            $method = 'is' . ucfirst($property);
320 10
            if (!method_exists($this, $method)) {
321 10
                $method = 'get' . ucfirst($property);
322
            }
323 10
            $val = $this->$method();
324 10
            if ($val instanceof DateTime) {
325
                // Date
326 2
                $array[$property] = $val->format('c');
327 10
            } elseif (is_object($val)) {
328
                // Object
329
                /* @var ArrayableInterface $val */
330 3
                $array[$property] = $val->toArray();
331 10
            } elseif (is_scalar($val)) {
332
                // Scalar
333 10
                $array[$property] = $val;
334 10
            } elseif (is_array($val)) {
335
                // Array
336 10
                foreach ($val as $k => $v) {
337 5
                    if (is_object($v)) {
338
                        /* @var ArrayableInterface $v */
339 4
                        $array[$property][$k] = $v->toArray();
340
                    } else {
341 1
                        $array[$property][$k] = $v;
342
                    }
343
                }
344
            }
345
        }
346 10
        if ($this->getAssociatedStoreIdentifiers()) {
347 1
            $array['associatedStoreIdentifiers'] = $this->getAssociatedStoreIdentifiers();
348
        }
349
350 10
        return $array;
351
    }
352
353
    /**
354
     * {@inheritdoc}
355
     */
356 29
    public function setSerialNumber($serialNumber)
357
    {
358 29
        $this->serialNumber = strval($serialNumber);
359
360 29
        return $this;
361
    }
362
363
    /**
364
     * {@inheritdoc}
365
     */
366 27
    public function getSerialNumber()
367
    {
368 27
        return $this->serialNumber;
369
    }
370
371
    /**
372
     * {@inheritdoc}
373
     */
374 29
    public function setDescription($description)
375
    {
376 29
        $this->description = $description;
377
378 29
        return $this;
379
    }
380
381
    /**
382
     * {@inheritdoc}
383
     */
384 26
    public function getDescription()
385
    {
386 26
        return $this->description;
387
    }
388
389
    /**
390
     * {@inheritdoc}
391
     */
392 26
    public function getFormatVersion()
393
    {
394 26
        return $this->formatVersion;
395
    }
396
397
    /**
398
     * {@inheritdoc}
399
     */
400 2
    public function setFormatVersion($formatVersion)
401
    {
402 2
        $this->formatVersion = $formatVersion;
403
404 2
        return $this;
405
    }
406
407
    /**
408
     * {@inheritdoc}
409
     */
410 6
    public function getType()
411
    {
412 6
        return $this->type;
413
    }
414
415
    /**
416
     * {@inheritdoc}
417
     */
418 2
    public function setType($type)
419
    {
420 2
        $this->type = $type;
421
422 2
        return $this;
423
    }
424
425
    /**
426
     * {@inheritdoc}
427
     */
428 5
    public function setStructure(StructureInterface $structure)
429
    {
430 5
        $this->structure = $structure;
431
432 5
        return $this;
433
    }
434
435
    /**
436
     * {@inheritdoc}
437
     */
438 10
    public function getStructure()
439
    {
440 10
        return $this->structure;
441
    }
442
443
    /**
444
     * {@inheritdoc}
445
     */
446 5
    public function addImage(ImageInterface $image)
447
    {
448 5
        $this->images[] = $image;
449
450 5
        return $this;
451
    }
452
453
    /**
454
     * {@inheritdoc}
455
     */
456 19
    public function getImages()
457
    {
458 19
        return $this->images;
459
    }
460
461
    /**
462
     * {@inheritdoc}
463
     */
464 1
    public function addLocalization(LocalizationInterface $localization)
465
    {
466 1
        $this->localizations[] = $localization;
467
468 1
        return $this;
469
    }
470
471
    /**
472
     * {@inheritdoc}
473
     */
474 3
    public function getLocalizations()
475
    {
476 3
        return $this->localizations;
477
    }
478
479
    /**
480
     * {@inheritdoc}
481
     */
482 2
    public function addAssociatedStoreIdentifier($associatedStoreIdentifier)
483
    {
484 2
        $this->associatedStoreIdentifiers[] = $associatedStoreIdentifier;
485
486 2
        return $this;
487
    }
488
489
    /**
490
     * {@inheritdoc}
491
     */
492 26
    public function getAssociatedStoreIdentifiers()
493
    {
494 26
        return $this->associatedStoreIdentifiers;
495
    }
496
497
    /**
498
     * {@inheritdoc}
499
     */
500 3
    public function addLocation(LocationInterface $location)
501
    {
502 3
        $this->locations[] = $location;
503
504 3
        return $this;
505
    }
506
507
    /**
508
     * {@inheritdoc}
509
     */
510 26
    public function getLocations()
511
    {
512 26
        return $this->locations;
513
    }
514
515
    /**
516
     * {@inheritdoc}
517
     */
518 2
    public function addBeacon(BeaconInterface $beacon)
519
    {
520 2
        $this->beacons[] = $beacon;
521
522 2
        return $this;
523
    }
524
525
    /**
526
     * {@inheritdoc}
527
     */
528 26
    public function getBeacons()
529
    {
530 26
        return $this->beacons;
531
    }
532
533
    /**
534
     * {@inheritdoc}
535
     */
536
    public function addNfc(NfcInterface $nfc)
537
    {
538
        $this->nfc[] = $nfc;
539
540
        return $this;
541
    }
542
543
    /**
544
     * {@inheritdoc}
545
     */
546 26
    public function getNfc()
547
    {
548 26
        return $this->nfc;
549
    }
550
551
    /**
552
     * {@inheritdoc}
553
     */
554 2
    public function setRelevantDate(DateTime $relevantDate)
555
    {
556 2
        $this->relevantDate = $relevantDate;
557
558 2
        return $this;
559
    }
560
561
    /**
562
     * {@inheritdoc}
563
     */
564 10
    public function getRelevantDate()
565
    {
566 10
        return $this->relevantDate;
567
    }
568
569
    /**
570
     * {@inheritdoc}
571
     */
572 1
    public function setMaxDistance($maxDistance)
573
    {
574 1
        $this->maxDistance = $maxDistance;
575
576 1
        return $this;
577
    }
578
579
    /**
580
     * {@inheritdoc}
581
     */
582 11
    public function getMaxDistance()
583
    {
584 11
        return $this->maxDistance;
585
    }
586
587
    /**
588
     * {@inheritdoc}
589
     */
590 6
    public function setBarcode(BarcodeInterface $barcode)
591
    {
592 6
        $this->barcode = $barcode;
593 6
        array_unshift($this->barcodes, $barcode);
594
595 6
        return $this;
596
    }
597
598
    /**
599
     * @deprecated please use addNfc() instead.
600
     */
601
    public function setNfc(array $nfc)
602
    {
603
        $this->nfc = $nfc;
604
605
        return $this;
606
    }
607
608
    /**
609
     * {@inheritdoc}
610
     */
611 27
    public function getBarcode()
612
    {
613 27
        return $this->barcode;
614
    }
615
616
    /**
617
     * {@inheritdoc}
618
     */
619 1
    public function addBarcode(BarcodeInterface $barcode)
620
    {
621 1
        $this->barcodes[] = $barcode;
622
623 1
        if (empty($this->barcode)) {
624 1
            $this->barcode = $barcode;
625
        }
626
627 1
        return $this;
628
    }
629
630
    /**
631
     * {@inheritdoc}
632
     */
633 11
    public function getBarcodes()
634
    {
635 11
        return $this->barcodes;
636
    }
637
638
    /**
639
     * {@inheritdoc}
640
     */
641 5
    public function setBackgroundColor($backgroundColor)
642
    {
643 5
        $this->backgroundColor = $backgroundColor;
644
645 5
        return $this;
646
    }
647
648
    /**
649
     * {@inheritdoc}
650
     */
651 10
    public function getBackgroundColor()
652
    {
653 10
        return $this->backgroundColor;
654
    }
655
656
    /**
657
     * {@inheritdoc}
658
     */
659 2
    public function setForegroundColor($foregroundColor)
660
    {
661 2
        $this->foregroundColor = $foregroundColor;
662
663 2
        return $this;
664
    }
665
666
    /**
667
     * {@inheritdoc}
668
     */
669 10
    public function getForegroundColor()
670
    {
671 10
        return $this->foregroundColor;
672
    }
673
674
    /**
675
     * {@inheritdoc}
676
     */
677 3
    public function setGroupingIdentifier($groupingIdentifier)
678
    {
679 3
        $this->groupingIdentifier = $groupingIdentifier;
680
681 3
        return $this;
682
    }
683
684
    /**
685
     * {@inheritdoc}
686
     */
687 26
    public function getGroupingIdentifier()
688
    {
689 26
        return $this->groupingIdentifier;
690
    }
691
692
    /**
693
     * {@inheritdoc}
694
     */
695 1
    public function setLabelColor($labelColor)
696
    {
697 1
        $this->labelColor = $labelColor;
698
699 1
        return $this;
700
    }
701
702
    /**
703
     * {@inheritdoc}
704
     */
705 10
    public function getLabelColor()
706
    {
707 10
        return $this->labelColor;
708
    }
709
710
    /**
711
     * {@inheritdoc}
712
     */
713 4
    public function setLogoText($logoText)
714
    {
715 4
        $this->logoText = $logoText;
716
717 4
        return $this;
718
    }
719
720
    /**
721
     * {@inheritdoc}
722
     */
723 10
    public function getLogoText()
724
    {
725 10
        return $this->logoText;
726
    }
727
728
    /**
729
     * {@inheritdoc}
730
     */
731 1
    public function setSuppressStripShine($suppressStripShine)
732
    {
733 1
        $this->suppressStripShine = $suppressStripShine;
734
735 1
        return $this;
736
    }
737
738
    /**
739
     * {@inheritdoc}
740
     */
741 10
    public function getSuppressStripShine()
742
    {
743 10
        return $this->suppressStripShine;
744
    }
745
746
    /**
747
     * {@inheritdoc}
748
     */
749 2
    public function setAuthenticationToken($authenticationToken)
750
    {
751 2
        $this->authenticationToken = $authenticationToken;
752
753 2
        return $this;
754
    }
755
756
    /**
757
     * {@inheritdoc}
758
     */
759 11
    public function getAuthenticationToken()
760
    {
761 11
        return (string) $this->authenticationToken;
762
    }
763
764
    /**
765
     * {@inheritdoc}
766
     */
767 2
    public function setWebServiceURL($webServiceURL)
768
    {
769 2
        $this->webServiceURL = $webServiceURL;
770
771 2
        return $this;
772
    }
773
774
    /**
775
     * {@inheritdoc}
776
     */
777 26
    public function getWebServiceURL()
778
    {
779 26
        return $this->webServiceURL;
780
    }
781
782
    /**
783
     * {@inheritdoc}
784
     */
785 5
    public function setPassTypeIdentifier($passTypeIdentifier)
786
    {
787 5
        $this->passTypeIdentifier = $passTypeIdentifier;
788
789 5
        return $this;
790
    }
791
792
    /**
793
     * {@inheritdoc}
794
     */
795 26
    public function getPassTypeIdentifier()
796
    {
797 26
        return $this->passTypeIdentifier;
798
    }
799
800
    /**
801
     * {@inheritdoc}
802
     */
803 5
    public function setTeamIdentifier($teamIdentifier)
804
    {
805 5
        $this->teamIdentifier = $teamIdentifier;
806
807 5
        return $this;
808
    }
809
810
    /**
811
     * {@inheritdoc}
812
     */
813 26
    public function getTeamIdentifier()
814
    {
815 26
        return $this->teamIdentifier;
816
    }
817
818
    /**
819
     * {@inheritdoc}
820
     */
821 5
    public function setOrganizationName($organizationName)
822
    {
823 5
        $this->organizationName = $organizationName;
824
825 5
        return $this;
826
    }
827
828
    /**
829
     * {@inheritdoc}
830
     */
831 26
    public function getOrganizationName()
832
    {
833 26
        return $this->organizationName;
834
    }
835
836
    /**
837
     * {@inheritdoc}
838
     */
839
    public function setExpirationDate(DateTime $expirationDate)
840
    {
841
        $this->expirationDate = $expirationDate;
842
843
        return $this;
844
    }
845
846
    /**
847
     * {@inheritdoc}
848
     */
849 10
    public function getExpirationDate()
850
    {
851 10
        return $this->expirationDate;
852
    }
853
854
    /**
855
     * {@inheritdoc}
856
     */
857
    public function setVoided($voided)
858
    {
859
        $this->voided = $voided;
860
861
        return $this;
862
    }
863
864
    /**
865
     * {@inheritdoc}
866
     */
867 10
    public function getVoided()
868
    {
869 10
        return $this->voided;
870
    }
871
872
    /**
873
     * {@inheritdoc}
874
     */
875 2
    public function setAppLaunchURL($appLaunchURL)
876
    {
877 2
        $this->appLaunchURL = $appLaunchURL;
878
879 2
        return $this;
880
    }
881
882
    /**
883
     * {@inheritdoc}
884
     */
885 26
    public function getAppLaunchURL()
886
    {
887 26
        return $this->appLaunchURL;
888
    }
889
890
    /**
891
     * {@inheritdoc}
892
     */
893
    public function setUserInfo($userInfo)
894
    {
895
        $this->userInfo = $userInfo;
896
897
        return $this;
898
    }
899
900
    /**
901
     * {@inheritdoc}
902
     */
903 10
    public function getUserInfo()
904
    {
905 10
        return $this->userInfo;
906
    }
907
908
    public function setSharingProhibited(bool $value): self
909
    {
910
        $this->sharingProhibited = $value;
911
912
        return $this;
913
    }
914
915 10
    public function getSharingProhibited(): bool
916
    {
917 10
        return $this->sharingProhibited;
918
    }
919
}
920