Code Duplication    Length = 12-13 lines in 2 locations

src/CalendarAPI.php 1 location

@@ 31-42 (lines=12) @@
28
     * @param string|null $displayName
29
     * @return $this
30
     */
31
    public function pickCalendar($displayName = null)
32
    {
33
        if ($displayName == 'default.calendar' || $displayName == null) {
34
            $folder = $this->getFolderByDistinguishedId('calendar');
35
        } else {
36
            $folder = $this->getFolderByDisplayName($displayName, 'calendar');
37
        }
38
39
        $this->folderId = $folder->getFolderId();
40
41
        return $this;
42
    }
43
44
    /**
45
     * @return Type\FolderIdType

src/ContactsAPI.php 1 location

@@ 20-32 (lines=13) @@
17
     * @param string|null $displayName
18
     * @return $this
19
     */
20
    public function pickContact($displayName = null)
21
    {
22
        if ($displayName == 'default.contacts' || $displayName == null) {
23
            $folder = $this->getFolderByDistinguishedId('contacts');
24
        } else {
25
            $folder = $this->getFolderByDisplayName($displayName, 'contacts');
26
        }
27
        if (!$folder) {
28
            return false;   
29
        }
30
        $this->folderId = $folder->getFolderId();
31
        return $this;
32
    }
33
    
34
    /**
35
     * @return Type\FolderIdType