Failed Conditions
Push — master ( 349866...67c1d1 )
by Florent
10:56 queued 06:08
created

OAuth2::getResourceOwnerId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2018 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace OAuth2Framework\SecurityBundle\Annotation;
15
16
/**
17
 * Annotation class for @OAuth2().
18
 *
19
 * @Annotation
20
 * @Target({"CLASS", "METHOD"})
21
 */
22
class OAuth2
23
{
24
    /**
25
     * @var null|string
26
     */
27
    private $scope = null;
28
29
    /**
30
     * @var null|string
31
     */
32
    private $token_type = null;
33
34
    /**
35
     * @var null|string
36
     */
37
    private $client_id = null;
38
39
    /**
40
     * @var null|string
41
     */
42
    private $resource_owner_id = null;
43
44
    /**
45
     * @param array $data an array of key/value parameters
46
     *
47
     * @throws \BadMethodCallException
48
     */
49
    public function __construct(array $data)
50
    {
51
        foreach ($data as $key => $value) {
52
            if (!property_exists($this, $key)) {
53
                throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, get_class($this)));
54
            }
55
            $this->$key = $value;
56
        }
57
    }
58
59
    /**
60
     * @return null|string
61
     */
62
    public function getClientId(): ?string
63
    {
64
        return $this->client_id;
65
    }
66
67
    /**
68
     * @return null|string
69
     */
70
    public function getResourceOwnerId(): ?string
71
    {
72
        return $this->resource_owner_id;
73
    }
74
75
    /**
76
     * @return null|string
77
     */
78
    public function getScope(): ?string
79
    {
80
        return $this->scope;
81
    }
82
83
    /**
84
     * @return null|string
85
     */
86
    public function getTokenType(): ?string
87
    {
88
        return $this->token_type;
89
    }
90
}
91