Passed
Branch master (c65ffc)
by Dāvis
03:08
created

AppSecretProof::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Sludio\HelperBundle\Oauth\Client\Provider\Facebook;
4
5
class AppSecretProof
6
{
7
    /**
8
     * The app secret proof to sign requests made to the Graph API
9
     * @see https://developers.facebook.com/docs/graph-api/securing-requests#appsecret_proof
10
     *
11
     * @param string $appSecret
12
     * @param string $accessToken
13
     *
14
     * @return string
15
     */
16
    public static function create($appSecret, $accessToken)
17
    {
18
        return hash_hmac('sha256', $accessToken, $appSecret);
19
    }
20
}
21