Completed
Push — develop ( 870d86...2ad559 )
by Adrien
42:24 queued 15:50
created

Properties::getSubject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheet\Document;
4
5
/**
6
 * Copyright (c) 2006 - 2016 PhpSpreadsheet.
7
 *
8
 * This library is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Lesser General Public
10
 * License as published by the Free Software Foundation; either
11
 * version 2.1 of the License, or (at your option) any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
 * Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public
19
 * License along with this library; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
 *
22
 * @category    PhpSpreadsheet
23
 *
24
 * @copyright    Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
25
 * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
26
 */
27
class Properties
28
{
29
    /** constants */
30
    const PROPERTY_TYPE_BOOLEAN = 'b';
31
    const PROPERTY_TYPE_INTEGER = 'i';
32
    const PROPERTY_TYPE_FLOAT = 'f';
33
    const PROPERTY_TYPE_DATE = 'd';
34
    const PROPERTY_TYPE_STRING = 's';
35
    const PROPERTY_TYPE_UNKNOWN = 'u';
36
37
    /**
38
     * Creator.
39
     *
40
     * @var string
41
     */
42
    private $creator = 'Unknown Creator';
43
44
    /**
45
     * LastModifiedBy.
46
     *
47
     * @var string
48
     */
49
    private $lastModifiedBy;
50
51
    /**
52
     * Created.
53
     *
54
     * @var int
55
     */
56
    private $created;
57
58
    /**
59
     * Modified.
60
     *
61
     * @var int
62
     */
63
    private $modified;
64
65
    /**
66
     * Title.
67
     *
68
     * @var string
69
     */
70
    private $title = 'Untitled Spreadsheet';
71
72
    /**
73
     * Description.
74
     *
75
     * @var string
76
     */
77
    private $description = '';
78
79
    /**
80
     * Subject.
81
     *
82
     * @var string
83
     */
84
    private $subject = '';
85
86
    /**
87
     * Keywords.
88
     *
89
     * @var string
90
     */
91
    private $keywords = '';
92
93
    /**
94
     * Category.
95
     *
96
     * @var string
97
     */
98
    private $category = '';
99
100
    /**
101
     * Manager.
102
     *
103
     * @var string
104
     */
105
    private $manager = '';
106
107
    /**
108
     * Company.
109
     *
110
     * @var string
111
     */
112
    private $company = 'Microsoft Corporation';
113
114
    /**
115
     * Custom Properties.
116
     *
117
     * @var string
118
     */
119
    private $customProperties = [];
120
121
    /**
122
     * Create a new Document Properties instance.
123
     */
124 76
    public function __construct()
125
    {
126
        // Initialise values
127 76
        $this->lastModifiedBy = $this->creator;
128 76
        $this->created = time();
129 76
        $this->modified = time();
130 76
    }
131
132
    /**
133
     * Get Creator.
134
     *
135
     * @return string
136
     */
137 61
    public function getCreator()
138
    {
139 61
        return $this->creator;
140
    }
141
142
    /**
143
     * Set Creator.
144
     *
145
     * @param string $creator
146
     *
147
     * @return Properties
148
     */
149 50
    public function setCreator($creator)
150
    {
151 50
        $this->creator = $creator;
152
153 50
        return $this;
154
    }
155
156
    /**
157
     * Get Last Modified By.
158
     *
159
     * @return string
160
     */
161 57
    public function getLastModifiedBy()
162
    {
163 57
        return $this->lastModifiedBy;
164
    }
165
166
    /**
167
     * Set Last Modified By.
168
     *
169
     * @param string $pValue
170
     *
171
     * @return Properties
172
     */
173 45
    public function setLastModifiedBy($pValue)
174
    {
175 45
        $this->lastModifiedBy = $pValue;
176
177 45
        return $this;
178
    }
179
180
    /**
181
     * Get Created.
182
     *
183
     * @return int
184
     */
185 57
    public function getCreated()
186
    {
187 57
        return $this->created;
188
    }
189
190
    /**
191
     * Set Created.
192
     *
193
     * @param datetime $pValue
194
     *
195
     * @return Properties
196
     */
197 20 View Code Duplication
    public function setCreated($pValue)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
198
    {
199 20
        if ($pValue === null) {
200
            $pValue = time();
201 20
        } elseif (is_string($pValue)) {
202
            if (is_numeric($pValue)) {
203
                $pValue = (int) $pValue;
204
            } else {
205
                $pValue = strtotime($pValue);
206
            }
207
        }
208
209 20
        $this->created = $pValue;
0 ignored issues
show
Documentation Bug introduced by
It seems like $pValue can also be of type object<PhpOffice\PhpSpre...heet\Document\datetime>. However, the property $created is declared as type integer. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
210
211 20
        return $this;
212
    }
213
214
    /**
215
     * Get Modified.
216
     *
217
     * @return int
218
     */
219 57
    public function getModified()
220
    {
221 57
        return $this->modified;
222
    }
223
224
    /**
225
     * Set Modified.
226
     *
227
     * @param datetime $pValue
228
     *
229
     * @return Properties
230
     */
231 20 View Code Duplication
    public function setModified($pValue)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
232
    {
233 20
        if ($pValue === null) {
234
            $pValue = time();
235 20
        } elseif (is_string($pValue)) {
236
            if (is_numeric($pValue)) {
237
                $pValue = (int) $pValue;
238
            } else {
239
                $pValue = strtotime($pValue);
240
            }
241
        }
242
243 20
        $this->modified = $pValue;
0 ignored issues
show
Documentation Bug introduced by
It seems like $pValue can also be of type object<PhpOffice\PhpSpre...heet\Document\datetime>. However, the property $modified is declared as type integer. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
244
245 20
        return $this;
246
    }
247
248
    /**
249
     * Get Title.
250
     *
251
     * @return string
252
     */
253 61
    public function getTitle()
254
    {
255 61
        return $this->title;
256
    }
257
258
    /**
259
     * Set Title.
260
     *
261
     * @param string $title
262
     *
263
     * @return Properties
264
     */
265 49
    public function setTitle($title)
266
    {
267 49
        $this->title = $title;
268
269 49
        return $this;
270
    }
271
272
    /**
273
     * Get Description.
274
     *
275
     * @return string
276
     */
277 61
    public function getDescription()
278
    {
279 61
        return $this->description;
280
    }
281
282
    /**
283
     * Set Description.
284
     *
285
     * @param string $description
286
     *
287
     * @return Properties
288
     */
289 49
    public function setDescription($description)
290
    {
291 49
        $this->description = $description;
292
293 49
        return $this;
294
    }
295
296
    /**
297
     * Get Subject.
298
     *
299
     * @return string
300
     */
301 61
    public function getSubject()
302
    {
303 61
        return $this->subject;
304
    }
305
306
    /**
307
     * Set Subject.
308
     *
309
     * @param string $subject
310
     *
311
     * @return Properties
312
     */
313 49
    public function setSubject($subject)
314
    {
315 49
        $this->subject = $subject;
316
317 49
        return $this;
318
    }
319
320
    /**
321
     * Get Keywords.
322
     *
323
     * @return string
324
     */
325 61
    public function getKeywords()
326
    {
327 61
        return $this->keywords;
328
    }
329
330
    /**
331
     * Set Keywords.
332
     *
333
     * @param string $keywords
334
     *
335
     * @return Properties
336
     */
337 49
    public function setKeywords($keywords)
338
    {
339 49
        $this->keywords = $keywords;
340
341 49
        return $this;
342
    }
343
344
    /**
345
     * Get Category.
346
     *
347
     * @return string
348
     */
349 61
    public function getCategory()
350
    {
351 61
        return $this->category;
352
    }
353
354
    /**
355
     * Set Category.
356
     *
357
     * @param string $category
358
     *
359
     * @return Properties
360
     */
361 44
    public function setCategory($category)
362
    {
363 44
        $this->category = $category;
364
365 44
        return $this;
366
    }
367
368
    /**
369
     * Get Company.
370
     *
371
     * @return string
372
     */
373 60
    public function getCompany()
374
    {
375 60
        return $this->company;
376
    }
377
378
    /**
379
     * Set Company.
380
     *
381
     * @param string $company
382
     *
383
     * @return Properties
384
     */
385 11
    public function setCompany($company)
386
    {
387 11
        $this->company = $company;
388
389 11
        return $this;
390
    }
391
392
    /**
393
     * Get Manager.
394
     *
395
     * @return string
396
     */
397 60
    public function getManager()
398
    {
399 60
        return $this->manager;
400
    }
401
402
    /**
403
     * Set Manager.
404
     *
405
     * @param string $manager
406
     *
407
     * @return Properties
408
     */
409 7
    public function setManager($manager)
410
    {
411 7
        $this->manager = $manager;
412
413 7
        return $this;
414
    }
415
416
    /**
417
     * Get a List of Custom Property Names.
418
     *
419
     * @return array of string
420
     */
421 56
    public function getCustomProperties()
422
    {
423 56
        return array_keys($this->customProperties);
424
    }
425
426
    /**
427
     * Check if a Custom Property is defined.
428
     *
429
     * @param string $propertyName
430
     *
431
     * @return bool
432
     */
433
    public function isCustomPropertySet($propertyName)
434
    {
435
        return isset($this->customProperties[$propertyName]);
436
    }
437
438
    /**
439
     * Get a Custom Property Value.
440
     *
441
     * @param string $propertyName
442
     *
443
     * @return string
444
     */
445 2
    public function getCustomPropertyValue($propertyName)
446
    {
447 2
        if (isset($this->customProperties[$propertyName])) {
448 2
            return $this->customProperties[$propertyName]['value'];
449
        }
450
    }
451
452
    /**
453
     * Get a Custom Property Type.
454
     *
455
     * @param string $propertyName
456
     *
457
     * @return string
458
     */
459 2
    public function getCustomPropertyType($propertyName)
460
    {
461 2
        if (isset($this->customProperties[$propertyName])) {
462 2
            return $this->customProperties[$propertyName]['type'];
463
        }
464
    }
465
466
    /**
467
     * Set a Custom Property.
468
     *
469
     * @param string $propertyName
470
     * @param mixed $propertyValue
471
     * @param string $propertyType
472
     *      'i'    : Integer
473
     *   'f' : Floating Point
474
     *   's' : String
475
     *   'd' : Date/Time
476
     *   'b' : Boolean
477
     *
478
     * @return Properties
479
     */
480 6
    public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null)
481
    {
482 6
        if (($propertyType === null) || (!in_array($propertyType, [self::PROPERTY_TYPE_INTEGER,
483 6
                                                                        self::PROPERTY_TYPE_FLOAT,
484 6
                                                                        self::PROPERTY_TYPE_STRING,
485 6
                                                                        self::PROPERTY_TYPE_DATE,
486 6
                                                                        self::PROPERTY_TYPE_BOOLEAN, ]))) {
487
            if ($propertyValue === null) {
488
                $propertyType = self::PROPERTY_TYPE_STRING;
489
            } elseif (is_float($propertyValue)) {
490
                $propertyType = self::PROPERTY_TYPE_FLOAT;
491
            } elseif (is_int($propertyValue)) {
492
                $propertyType = self::PROPERTY_TYPE_INTEGER;
493
            } elseif (is_bool($propertyValue)) {
494
                $propertyType = self::PROPERTY_TYPE_BOOLEAN;
495
            } else {
496
                $propertyType = self::PROPERTY_TYPE_STRING;
497
            }
498
        }
499
500 6
        $this->customProperties[$propertyName] = [
501 6
            'value' => $propertyValue,
502 6
            'type' => $propertyType,
503
        ];
504
505 6
        return $this;
506
    }
507
508
    /**
509
     * Implement PHP __clone to create a deep clone, not just a shallow copy.
510
     */
511 View Code Duplication
    public function __clone()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
512
    {
513
        $vars = get_object_vars($this);
514
        foreach ($vars as $key => $value) {
515
            if (is_object($value)) {
516
                $this->$key = clone $value;
517
            } else {
518
                $this->$key = $value;
519
            }
520
        }
521
    }
522
523 1
    public static function convertProperty($propertyValue, $propertyType)
524
    {
525
        switch ($propertyType) {
526 1
            case 'empty':     //    Empty
527
                return '';
528
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
529 1
            case 'null':      //    Null
530
                return null;
531
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
532 1
            case 'i1':        //    1-Byte Signed Integer
533 1
            case 'i2':        //    2-Byte Signed Integer
534 1
            case 'i4':        //    4-Byte Signed Integer
535 1
            case 'i8':        //    8-Byte Signed Integer
536 1
            case 'int':       //    Integer
537
                return (int) $propertyValue;
538
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
539 1
            case 'ui1':       //    1-Byte Unsigned Integer
540 1
            case 'ui2':       //    2-Byte Unsigned Integer
541 1
            case 'ui4':       //    4-Byte Unsigned Integer
542 1
            case 'ui8':       //    8-Byte Unsigned Integer
543 1
            case 'uint':      //    Unsigned Integer
544
                return abs((int) $propertyValue);
545
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
546 1
            case 'r4':        //    4-Byte Real Number
547 1
            case 'r8':        //    8-Byte Real Number
548 1
            case 'decimal':   //    Decimal
549 1
                return (float) $propertyValue;
550
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
551 1
            case 'lpstr':     //    LPSTR
552 1
            case 'lpwstr':    //    LPWSTR
553 1
            case 'bstr':      //    Basic String
554 1
                return $propertyValue;
555
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
556 1
            case 'date':      //    Date and Time
557 1
            case 'filetime':  //    File Time
558 1
                return strtotime($propertyValue);
559
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
560 1
            case 'bool':     //    Boolean
561 1
                return ($propertyValue == 'true') ? true : false;
562
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
563
            case 'cy':       //    Currency
564
            case 'error':    //    Error Status Code
565
            case 'vector':   //    Vector
566
            case 'array':    //    Array
567
            case 'blob':     //    Binary Blob
568
            case 'oblob':    //    Binary Blob Object
569
            case 'stream':   //    Binary Stream
570
            case 'ostream':  //    Binary Stream Object
571
            case 'storage':  //    Binary Storage
572
            case 'ostorage': //    Binary Storage Object
573
            case 'vstream':  //    Binary Versioned Stream
574
            case 'clsid':    //    Class ID
575
            case 'cf':       //    Clipboard Data
576
                return $propertyValue;
577
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
578
        }
579
580
        return $propertyValue;
581
    }
582
583 1
    public static function convertPropertyType($propertyType)
584
    {
585
        switch ($propertyType) {
586 1
            case 'i1':       //    1-Byte Signed Integer
587 1
            case 'i2':       //    2-Byte Signed Integer
588 1
            case 'i4':       //    4-Byte Signed Integer
589 1
            case 'i8':       //    8-Byte Signed Integer
590 1
            case 'int':      //    Integer
591 1
            case 'ui1':      //    1-Byte Unsigned Integer
592 1
            case 'ui2':      //    2-Byte Unsigned Integer
593 1
            case 'ui4':      //    4-Byte Unsigned Integer
594 1
            case 'ui8':      //    8-Byte Unsigned Integer
595 1
            case 'uint':     //    Unsigned Integer
596
                return self::PROPERTY_TYPE_INTEGER;
597
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
598 1
            case 'r4':       //    4-Byte Real Number
599 1
            case 'r8':       //    8-Byte Real Number
600 1
            case 'decimal':  //    Decimal
601 1
                return self::PROPERTY_TYPE_FLOAT;
602
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
603 1
            case 'empty':    //    Empty
604 1
            case 'null':     //    Null
605 1
            case 'lpstr':    //    LPSTR
606 1
            case 'lpwstr':   //    LPWSTR
607 1
            case 'bstr':     //    Basic String
608 1
                return self::PROPERTY_TYPE_STRING;
609
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
610 1
            case 'date':     //    Date and Time
611 1
            case 'filetime': //    File Time
612 1
                return self::PROPERTY_TYPE_DATE;
613
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
614 1
            case 'bool':     //    Boolean
615 1
                return self::PROPERTY_TYPE_BOOLEAN;
616
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
617
            case 'cy':       //    Currency
618
            case 'error':    //    Error Status Code
619
            case 'vector':   //    Vector
620
            case 'array':    //    Array
621
            case 'blob':     //    Binary Blob
622
            case 'oblob':    //    Binary Blob Object
623
            case 'stream':   //    Binary Stream
624
            case 'ostream':  //    Binary Stream Object
625
            case 'storage':  //    Binary Storage
626
            case 'ostorage': //    Binary Storage Object
627
            case 'vstream':  //    Binary Versioned Stream
628
            case 'clsid':    //    Class ID
629
            case 'cf':       //    Clipboard Data
630
                return self::PROPERTY_TYPE_UNKNOWN;
631
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
632
        }
633
634
        return self::PROPERTY_TYPE_UNKNOWN;
635
    }
636
}
637