This repository was archived by the owner on Nov 2, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-25
lines changed Expand file tree Collapse file tree 2 files changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ public function setClient(\OAuth2\ServerBundle\Entity\Client $client = null)
32
32
{
33
33
$ this ->client = $ client ;
34
34
35
+ // this is necessary as the client_id is the primary key
36
+ $ this ->client_id = $ client ->getClientId ();
37
+
35
38
return $ this ;
36
39
}
37
40
@@ -45,29 +48,6 @@ public function getClient()
45
48
return $ this ->client ;
46
49
}
47
50
48
- /**
49
- * Set client
50
- *
51
- * @param $client_id
52
- * @return ClientPublicKey
53
- */
54
- public function setClientId ($ client_id )
55
- {
56
- $ this ->client_id = $ client_id ;
57
-
58
- return $ this ;
59
- }
60
-
61
- /**
62
- * Get client_id
63
- *
64
- * @return integer $client_id
65
- */
66
- public function getClientId ()
67
- {
68
- return $ this ->client_id ;
69
- }
70
-
71
51
/**
72
52
* Set public key
73
53
*
Original file line number Diff line number Diff line change @@ -22,13 +22,14 @@ public function testCreate()
22
22
$ em ->flush ();
23
23
24
24
$ public_key = new ClientPublicKey ();
25
- $ public_key ->setClientId ($ client-> getClientId () );
25
+ $ public_key ->setClient ($ client );
26
26
27
27
// create and set the public key
28
28
$ res = openssl_pkey_new ();
29
29
30
30
// Extract the public key from $res to $pubKey
31
- $ pubKey = openssl_pkey_get_details ($ res )['key ' ];
31
+ $ pubKeyDetails = openssl_pkey_get_details ($ res );
32
+ $ pubKey = $ pubKeyDetails ['key ' ];
32
33
$ public_key ->setPublicKey ($ pubKey );
33
34
34
35
$ em ->persist ($ public_key );
You can’t perform that action at this time.
0 commit comments