Code Duplication    Length = 20-21 lines in 2 locations

src/ContactsAPI.php 1 location

@@ 62-81 (lines=20) @@
59
     * @param array $options
60
     * @return Type\ContactItemType[]
61
     */
62
    public function getContacts($folderId = null, $options = array())
63
    {
64
        if (!$folderId) {
65
            $folderId = $this->getFolderId();
66
        }
67
68
        $request = array(
69
            'Traversal' => 'Shallow',
70
            'ItemShape' => array(
71
                'BaseShape' => 'AllProperties'
72
            ),
73
            'ParentFolderIds' => $folderId->toArray(true)
74
        );
75
76
        $request = array_replace_recursive($request, $options);
77
78
        $request = Type::buildFromArray($request);
79
80
        return $this->getClient()->FindItem($request);
81
    }
82
83
    /**
84
     * @param Type\ItemIdType $itemId

src/API.php 1 location

@@ 349-369 (lines=21) @@
346
     * @param array $options
347
     * @return Type\BaseFolderType[]
348
     */
349
    public function getChildrenFolders($parentFolderId = 'root', array $options = array())
350
    {
351
        if (is_string($parentFolderId)) {
352
            $parentFolderId = $this->getDistinguishedFolderId($parentFolderId);
353
        }
354
355
        $request = array(
356
            'Traversal' => 'Shallow',
357
            'FolderShape' => array(
358
                'BaseShape' => 'AllProperties'
359
            ),
360
            'ParentFolderIds' => $parentFolderId->toArray(true)
361
        );
362
363
        $request = array_replace_recursive($request, $options);
364
365
        $request = Type::buildFromArray($request);
366
367
        /** @var \garethp\ews\API\Message\FindFolderResponseMessageType $folders */
368
        return $this->getClient()->FindFolder($request);
369
    }
370
371
    /**
372
     * @param string $folderName