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

AppSecretProof   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
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