Completed
Push — master ( a18349...985bb6 )
by Gareth
04:15
created

API::moveItem()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 11
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 11
loc 11
ccs 0
cts 6
cp 0
rs 9.4285
cc 1
eloc 6
nc 1
nop 3
crap 2
1
<?php
2
3
namespace garethp\ews;
4
5
use garethp\ews\API\Enumeration\DisposalType;
6
use garethp\ews\API\ExchangeWebServices;
7
use garethp\ews\API\ItemUpdateBuilder;
8
use garethp\ews\API\Message\GetServerTimeZonesType;
9
use garethp\ews\API\Message\SyncFolderItemsResponseMessageType;
10
use garethp\ews\API\Message\UpdateItemResponseMessageType;
11
use garethp\ews\API\Type;
12
use garethp\ews\CalendarAPI;
13
use garethp\ews\MailAPI;
14
15
/**
16
 * A base class for APIs
17
 *
18
 * Class BaseAPI
19
 * @package garethp\ews
20
 */
21
class API
22
{
23
    protected static $defaultClientOptions = array(
24
        'version' => ExchangeWebServices::VERSION_2010
25
    );
26
27 32
    public function __construct(ExchangeWebServices $client = null)
28
    {
29 32
        if ($client) {
30 32
            $this->setClient($client);
31 32
        }
32 32
    }
33
34
    /**
35
     * @return Type\EmailAddressType
36
     */
37 24
    public function getPrimarySmtpMailbox()
38
    {
39 24
        return $this->getClient()->getPrimarySmtpMailbox();
40
    }
41
42
    /**
43
     * Storing the API client
44
     * @var ExchangeWebServices
45
     */
46
    private $client;
47
48
    /**
49
     * Get a calendar item
50
     *
51
     * @param string $name
52
     * @return CalendarAPI
53
     */
54 6
    public function getCalendar($name = null)
55
    {
56 6
        $calendar = new CalendarAPI();
57 6
        $calendar->setClient($this->getClient());
58 6
        $calendar->pickCalendar($name);
59
60 6
        return $calendar;
61
    }
62
63
    /**
64
     * @param string $folderName
65
     * @return MailAPI
66
     */
67 6
    public function getMailbox($folderName = null)
68
    {
69 6
        $mailApi = new MailAPI();
70 6
        $mailApi->setClient($this->getClient());
71 6
        $mailApi->pickMailFolder($folderName);
72
73 6
        return $mailApi;
74
    }
75
76
    /**
77
     * Set the API client
78
     *
79
     * @param ExchangeWebServices $client
80
     * @return $this
81
     */
82 32
    public function setClient($client)
83
    {
84 32
        $this->client = $client;
85
86 32
        return $this;
87
    }
88
89
    /**
90
     * Get the API client
91
     *
92
     * @return ExchangeWebServices
93
     */
94 31
    public function getClient()
95
    {
96 31
        return $this->client;
97
    }
98
99 31
    public static function withUsernameAndPassword($server, $username, $password, $options = [])
100
    {
101 31
        return new static(ExchangeWebServices::fromUsernameAndPassword(
102 31
            $server,
103 31
            $username,
104 31
            $password,
105 31
            array_replace_recursive(self::$defaultClientOptions, $options)
106 31
        ));
107
    }
108
109 1
    public static function withCallbackToken($server, $token, $options = [])
110
    {
111 1
        return new static(ExchangeWebServices::fromCallbackToken(
112 1
            $server,
113 1
            $token,
114 1
            array_replace_recursive(self::$defaultClientOptions, $options)
115 1
        ));
116
    }
117
118 1
    public function getPrimarySmptEmailAddress()
119
    {
120 1
        if ($this->getPrimarySmtpMailbox() == null) {
121 1
            return null;
122
        }
123
124 1
        return $this->getPrimarySmtpMailbox()->getEmailAddress();
125
    }
126
127 1
    public function setPrimarySmtpEmailAddress($emailAddress)
128
    {
129 1
        $this->getClient()->setPrimarySmtpEmailAddress($emailAddress);
130
131 1
        return $this;
132
    }
133
134
    /**
135
     * Create items through the API client
136
     *
137
     * @param $items
138
     * @param array $options
139
     * @return Type
140
     */
141 15
    public function createItems($items, $options = array())
142
    {
143 15
        if (!is_array($items)) {
144
            $items = array($items);
145
        }
146
147
        $request = array(
148
            'Items' => $items
149 15
        );
150
151 15
        $request = array_replace_recursive($request, $options);
152 15
        $request = Type::buildFromArray($request);
153
154 15
        $response = $this->getClient()->CreateItem($request);
155
156 15
        return $response;
157
    }
158
159 4
    public function updateItems($items, $options = array())
160
    {
161
        $request = array(
162 4
            'ItemChanges' => $items,
163 4
            'MessageDisposition' => 'SaveOnly',
164
            'ConflictResolution' => 'AlwaysOverwrite'
165 4
        );
166
167 4
        $request = array_replace_recursive($request, $options);
168
169 4
        $request = Type::buildFromArray($request);
170
171 4
        $response = $this->getClient()->UpdateItem($request);
172 4
        if ($response instanceof UpdateItemResponseMessageType) {
0 ignored issues
show
Bug introduced by
The class garethp\ews\API\Message\...ItemResponseMessageType does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
173 4
            return $response->getItems();
174
        }
175
176
        if (!is_array($response)) {
177
            $response = array($response);
178
        }
179
180
        return $response;
181
    }
182
183
    /**
184
     * @param string $itemType
185
     * @param string $uriType
186
     * @param array $changes
187
     * @return array
188
     */
189 4
    protected function buildUpdateItemChanges($itemType, $uriType, $changes)
190
    {
191 4
        return ItemUpdateBuilder::buildUpdateItemChanges($itemType, $uriType, $changes);
192
    }
193
194 1
    public function createCalendars($names, Type\FolderIdType $parentFolder = null, $options = array())
195
    {
196 1
        if ($parentFolder == null) {
197 1
            $parentFolder = $this->getFolderByDistinguishedId('calendar')->getFolderId();
0 ignored issues
show
Documentation Bug introduced by
The method getFolderId does not exist on object<garethp\ews\API\Type>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
198 1
        }
199
200 1
        $request = array('Folders' => array('Folder' => array()));
201 1
        if (!empty($parentFolder)) {
202 1
            $request['ParentFolderId'] = array('FolderId' => $parentFolder->toArray());
203 1
        }
204
205 1
        if (!is_array($names)) {
206 1
            $names = array($names);
207 1
        }
208
209 1
        foreach ($names as $name) {
210 1
            $request['Folders']['Folder'][] = array(
211 1
                'DisplayName' => $name,
212
                'FolderClass' => 'IPF.Appointment'
213 1
            );
214 1
        }
215
216 1
        $request = array_merge_recursive($request, $options);
217
218 1
        $this->client->CreateFolder($request);
219
220 1
        return true;
221
    }
222
    
223 2
    public function createFolders($names, Type\FolderIdType $parentFolder, $options = array())
224
    {
225 2
        $request = array('Folders' => array('Folder' => array()));
226 2
        if (!empty($parentFolder)) {
227 2
            $request['ParentFolderId'] = array('FolderId' => $parentFolder->toArray());
228 2
        }
229
230 2
        if (!is_array($names)) {
231 2
            $names = array($names);
232 2
        }
233
234 2
        foreach ($names as $name) {
235 2
            $request['Folders']['Folder'][] = array(
236
                'DisplayName' => $name
237 2
            );
238 2
        }
239
240 2
        $request = array_merge_recursive($request, $options);
241
242 2
        $this->client->CreateFolder($request);
243
244 2
        return true;
245
    }
246
247 3 View Code Duplication
    public function deleteFolder(Type\FolderIdType $folderId, $options = array())
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...
248
    {
249
        $request = array(
250 3
            'DeleteType' => 'HardDelete',
251
            'FolderIds' => array(
252 3
                'FolderId' => $folderId->toArray()
253 3
            )
254 3
        );
255
256 3
        $request = array_merge_recursive($request, $options);
257
258 3
        return $this->client->DeleteFolder($request);
259
    }
260
261 View Code Duplication
    public function moveItem(Type\ItemIdType $itemId, Type\FolderIdType $folderId, $options = array())
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...
262
    {
263
        $request = array(
264
            'ToFolderId' => array('FolderId' => $folderId->toArray()),
265
            'ItemIds' => array('ItemId' => $itemId->toArray())
266
        );
267
268
        $request = array_merge_recursive($request, $options);
269
270
        return $this->client->MoveItem($request);
271
    }
272
273
    /**
274
     * @param        $items Type\ItemIdType|Type\ItemIdType[]
275
     * @param array  $options
276
     * @return bool
277
     */
278 15
    public function deleteItems($items, $options = array())
279
    {
280 15
        if (!is_array($items) || Type::arrayIsAssoc($items)) {
281 15
            $items = array($items);
282 15
        }
283
284 15
        $itemIds = array();
285 15
        foreach ($items as $item) {
286 15
            if ($item instanceof Type\ItemIdType) {
0 ignored issues
show
Bug introduced by
The class garethp\ews\API\Type\ItemIdType does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
287 14
                $item = $item->toArray();
288 14
            }
289 15
            $item = (array)$item;
290 15
            $itemIds[] = array(
291 15
                'Id' => $item['Id'],
292 15
                'ChangeKey' => $item['ChangeKey']
293 15
            );
294 15
        }
295
296
        $request = array(
297 15
            'ItemIds' => array('ItemId' => $itemIds),
298
            'DeleteType' => 'MoveToDeletedItems'
299 15
        );
300
301 15
        $request = array_replace_recursive($request, $options);
302 15
        $request = Type::buildFromArray($request);
303 15
        $this->getClient()->DeleteItem($request);
304
305
        //If the delete fails, an Exception will be thrown in processResponse before it gets here
306 15
        return true;
307
    }
308
309
    /**
310
     * @param $identifier
311
     * @return Type\BaseFolderType
312
     */
313 23
    public function getFolder($identifier)
314
    {
315
        $request = array(
316
            'FolderShape' => array(
317 23
                'BaseShape' => array('_' => 'Default')
318 23
            ),
319
            'FolderIds' => $identifier
320 23
        );
321 23
        $request = Type::buildFromArray($request);
322
323 23
        $response = $this->getClient()->GetFolder($request);
324
325 23
        return $response;
326
    }
327
328
    /**
329
     * Get a folder by it's distinguishedId
330
     *
331
     * @param string $distinguishedId
332
     * @return Type\BaseFolderType
333
     */
334 23
    public function getFolderByDistinguishedId($distinguishedId)
335
    {
336 23
        return $this->getFolder(array(
337
            'DistinguishedFolderId' => array(
338 23
                'Id' => $distinguishedId,
339 23
                'Mailbox' => $this->getPrimarySmtpMailbox()
340 23
            )
341 23
        ));
342
    }
343
344
    /**
345
     * @param $folderId
346
     * @return Type\BaseFolderType
347
     */
348 4
    public function getFolderByFolderId($folderId)
349
    {
350 4
        return $this->getFolder(array(
351 4
            'FolderId' => array('Id' => $folderId, 'Mailbox' => $this->getPrimarySmtpMailbox())
352 4
        ));
353
    }
354
355
    /**
356
     * @param string|Type\FolderIdType $parentFolderId
357
     * @param array $options
358
     * @return bool|Type\BaseFolderType
359
     */
360 22
    public function getChildrenFolders($parentFolderId = 'root', $options = array())
361
    {
362 22
        if (is_string($parentFolderId)) {
363 15
            $parentFolderId = $this->getFolderByDistinguishedId($parentFolderId)->getFolderId();
0 ignored issues
show
Documentation Bug introduced by
The method getFolderId does not exist on object<garethp\ews\API\Type>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
364 15
        }
365
366
        $request = array(
367 22
            'Traversal' => 'Shallow',
368
            'FolderShape' => array(
369
                'BaseShape' => 'AllProperties'
370 22
            ),
371
            'ParentFolderIds' => array(
372 22
                'FolderId' => $parentFolderId->toArray()
373 22
            )
374 22
        );
375
376 22
        $request = array_replace_recursive($request, $options);
377
378 22
        $request = Type::buildFromArray($request);
379
380
        /** @var \garethp\ews\API\Message\FindFolderResponseMessageType $folders */
381 22
        return $this->getClient()->FindFolder($request);
0 ignored issues
show
Bug Best Practice introduced by
The return type of return $this->getClient()->FindFolder($request); (garethp\ews\API\Type) is incompatible with the return type documented by garethp\ews\API::getChildrenFolders of type boolean|garethp\ews\API\Type\BaseFolderType.

If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design.

Let’s take a look at an example:

class Author {
    private $name;

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

    public function getName() {
        return $this->name;
    }
}

abstract class Post {
    public function getAuthor() {
        return 'Johannes';
    }
}

class BlogPost extends Post {
    public function getAuthor() {
        return new Author('Johannes');
    }
}

class ForumPost extends Post { /* ... */ }

function my_function(Post $post) {
    echo strtoupper($post->getAuthor());
}

Our function my_function expects a Post object, and outputs the author of the post. The base class Post returns a simple string and outputting a simple string will work just fine. However, the child class BlogPost which is a sub-type of Post instead decided to return an object, and is therefore violating the SOLID principles. If a BlogPost were passed to my_function, PHP would not complain, but ultimately fail when executing the strtoupper call in its body.

Loading history...
382
383
        return $folders->getFolders();
0 ignored issues
show
Unused Code introduced by
return $folders->getFolders(); does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
384
    }
385
386
    /**
387
     * @param string $folderName
388
     * @param string|Type\FolderIdType $parentFolderId
389
     * @param array $options
390
     * @return bool|Type\BaseFolderType
391
     */
392 22
    public function getFolderByDisplayName($folderName, $parentFolderId = 'root', $options = array())
393
    {
394 22
        $folders = $this->getChildrenFolders($parentFolderId, $options);
395
396 22
        foreach ($folders as $folder) {
0 ignored issues
show
Bug introduced by
The expression $folders of type boolean|object<garethp\e...PI\Type\BaseFolderType> is not guaranteed to be traversable. How about adding an additional type check?

There are different options of fixing this problem.

  1. If you want to be on the safe side, you can add an additional type-check:

    $collection = json_decode($data, true);
    if ( ! is_array($collection)) {
        throw new \RuntimeException('$collection must be an array.');
    }
    
    foreach ($collection as $item) { /** ... */ }
    
  2. If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:

    /** @var array $collection */
    $collection = json_decode($data, true);
    
    foreach ($collection as $item) { /** .. */ }
    
  3. Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.

Loading history...
397 22
            if ($folder->getDisplayName() == $folderName) {
398 21
                return $folder;
399
            }
400 16
        }
401
402 4
        return false;
403
    }
404
405
    /**
406
     * @param $itemId array|Type\ItemIdType
407
     * @param array $options
408
     * @return Type
409
     */
410 5 View Code Duplication
    public function getItem($itemId, $options = array())
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...
411
    {
412 5
        if ($itemId instanceof Type\ItemIdType) {
0 ignored issues
show
Bug introduced by
The class garethp\ews\API\Type\ItemIdType does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
413 4
            $itemId = $itemId->toArray();
414 4
        }
415
416
        $request = array(
417 5
            'ItemShape' => array('BaseShape' => 'AllProperties'),
418 5
            'ItemIds' => array('ItemId' => $itemId)
419 5
        );
420
421 5
        $request = array_replace_recursive($request, $options);
422
423 5
        return $this->getClient()->GetItem($request);
424
    }
425
426
    /**
427
     * Get a list of sync changes on a folder
428
     *
429
     * @param Type\FolderIdType $folderId
430
     * @param null $syncState
431
     * @param array $options
432
     * @return SyncFolderItemsResponseMessageType
433
     */
434 2
    public function listItemChanges($folderId, $syncState = null, $options = array())
435
    {
436
        $request = array(
437 2
            'ItemShape' => array('BaseShape' => 'IdOnly'),
438 2
            'SyncFolderId' => array('FolderId' => $folderId->toXmlObject()),
439 2
            'SyncScope' => 'NormalItems',
440
            'MaxChangesReturned' => '10'
441 2
        );
442
443 2
        if ($syncState != null) {
444 1
            $request['SyncState'] = $syncState;
445 1
            $request['ItemShape']['BaseShape'] = 'AllProperties';
446 1
        }
447
448 2
        $request = array_replace_recursive($request, $options);
449
450 2
        $request = Type::buildFromArray($request);
451 2
        $response = $this->getClient()->SyncFolderItems($request);
452
453 2
        return $response;
454
    }
455
456
    public function getServerTimezones($timezoneIDs = array(), $fullTimezoneData = false)
457
    {
458
        $request = GetServerTimeZonesType::buildFromArray(array(
459
            'returnFullTimeZoneData' => $fullTimezoneData
460
        ));
461
462
        if (!empty($timezoneIDs)) {
463
            $request->setIds($timezoneIDs);
464
        }
465
466
        $timezones = $this->getClient()->GetServerTimeZones($request);
467
        $timezones = $timezones->TimeZoneDefinition;
0 ignored issues
show
Documentation introduced by
The property TimeZoneDefinition does not exist on object<garethp\ews\API\Type>. Since you implemented __set, maybe consider adding a @property annotation.

Since your code implements the magic setter _set, this function will be called for any write access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

Since the property has write access only, you can use the @property-write annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
468
469
        if (!is_array($timezones)) {
470
            $timezones = array($timezones);
471
        }
472
473
        return $timezones;
474
    }
475
476
    /**
477
     * @param Type\ItemIdType $itemId
478
     * @param $fromType
479
     * @param $destinationType
480
     * @param $mailbox
481
     *
482
     * @return Type\ItemIdType
483
     */
484
    public function convertIdFormat(Type\ItemIdType $itemId, $fromType, $destinationType, $mailbox)
485
    {
486
        $result = $this->getClient()->ConvertId(array(
487
            'DestinationFormat' => $destinationType,
488
            'SourceIds' => array(
489
                'AlternateId' => array(
490
                    'Format' => $fromType,
491
                    'Id' => $itemId->getId(),
492
                    'Mailbox' => $mailbox
493
                )
494
            )
495
        ));
496
497
        $itemId->setId($result->getId());
0 ignored issues
show
Documentation Bug introduced by
The method getId does not exist on object<garethp\ews\API\Type>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
498
499
        return $itemId;
500
    }
501
}
502