Code Duplication    Length = 10-10 lines in 3 locations

src/Providers/DoubanProvider.php 1 location

@@ 58-67 (lines=10) @@
55
    /**
56
     * {@inheritdoc}.
57
     */
58
    protected function mapUserToObject(array $user)
59
    {
60
        return new User([
61
            'id' => $this->arrayItem($user, 'id'),
62
            'nickname' => $this->arrayItem($user, 'name'),
63
            'name' => $this->arrayItem($user, 'name'),
64
            'avatar' => $this->arrayItem($user, 'large_avatar'),
65
            'email' => null,
66
        ]);
67
    }
68
69
    /**
70
     * {@inheritdoc}.

src/Providers/OutlookProvider.php 1 location

@@ 68-77 (lines=10) @@
65
    /**
66
     * {@inheritdoc}
67
     */
68
    protected function mapUserToObject(array $user)
69
    {
70
        return new User([
71
            'id'       => $this->arrayItem($user, 'id'),
72
            'nickname' => null,
73
            'name'     => $this->arrayItem($user, 'displayName'),
74
            'email'    => $this->arrayItem($user, 'userPrincipalName'),
75
            'avatar'   => null,
76
        ]);
77
    }
78
79
    /**
80
     * {@inheritdoc}

src/Providers/WeChatProvider.php 1 location

@@ 191-200 (lines=10) @@
188
    /**
189
     * {@inheritdoc}.
190
     */
191
    protected function mapUserToObject(array $user)
192
    {
193
        return new User([
194
            'id' => $this->arrayItem($user, 'openid'),
195
            'name' => $this->arrayItem($user, 'nickname'),
196
            'nickname' => $this->arrayItem($user, 'nickname'),
197
            'avatar' => $this->arrayItem($user, 'headimgurl'),
198
            'email' => null,
199
        ]);
200
    }
201
202
    /**
203
     * {@inheritdoc}.