@@ -29,7 +29,7 @@ class SQLPermanentStorage
2929 * @param \SimpleSAML\Configuration|null $config
3030 * @throws \Exception
3131 */
32- public function __construct (string $ name , Configuration $ config = null )
32+ public function __construct (string $ name , ? Configuration $ config = null )
3333 {
3434 if (is_null ($ config )) {
3535 $ config = Configuration::getInstance ();
@@ -81,7 +81,7 @@ public function __construct(string $name, Configuration $config = null)
8181 * @param string $value
8282 * @param int|null $duration
8383 */
84- public function set (string $ type , string $ key1 , string $ key2 , string $ value , int $ duration = null ): void
84+ public function set (string $ type , string $ key1 , string $ key2 , string $ value , ? int $ duration = null ): void
8585 {
8686 if ($ this ->exists ($ type , $ key1 , $ key2 )) {
8787 $ this ->update ($ type , $ key1 , $ key2 , $ value , $ duration );
@@ -99,7 +99,7 @@ public function set(string $type, string $key1, string $key2, string $value, int
9999 * @param int|null $duration
100100 * @return array
101101 */
102- private function insert (string $ type , string $ key1 , string $ key2 , string $ value , int $ duration = null ): array
102+ private function insert (string $ type , string $ key1 , string $ key2 , string $ value , ? int $ duration = null ): array
103103 {
104104 $ expire = is_null ($ duration ) ? null : (time () + $ duration );
105105
@@ -125,7 +125,7 @@ private function insert(string $type, string $key1, string $key2, string $value,
125125 * @param int|null $duration
126126 * @return array
127127 */
128- private function update (string $ type , string $ key1 , string $ key2 , string $ value , int $ duration = null ): array
128+ private function update (string $ type , string $ key1 , string $ key2 , string $ value , ? int $ duration = null ): array
129129 {
130130 $ expire = is_null ($ duration ) ? null : (time () + $ duration );
131131
@@ -148,7 +148,7 @@ private function update(string $type, string $key1, string $key2, string $value,
148148 * @param string|null $key2
149149 * @return array|null
150150 */
151- public function get (string $ type = null , string $ key1 = null , string $ key2 = null ): ?array
151+ public function get (? string $ type = null , ? string $ key1 = null , ? string $ key2 = null ): ?array
152152 {
153153 $ conditions = $ this ->getCondition ($ type , $ key1 , $ key2 );
154154 $ query = 'SELECT * FROM data WHERE ' . $ conditions ;
@@ -173,7 +173,7 @@ public function get(string $type = null, string $key1 = null, string $key2 = nul
173173 * @param string|null $key2
174174 * @return string|null
175175 */
176- public function getValue (string $ type = null , string $ key1 = null , string $ key2 = null ): ?string
176+ public function getValue (? string $ type = null , ? string $ key1 = null , ? string $ key2 = null ): ?string
177177 {
178178 $ res = $ this ->get ($ type , $ key1 , $ key2 );
179179 if ($ res === null ) {
@@ -206,7 +206,7 @@ public function exists(string $type, string $key1, string $key2): bool
206206 * @param string|null $key2
207207 * @return array|false
208208 */
209- public function getList (string $ type = null , string $ key1 = null , string $ key2 = null )
209+ public function getList (? string $ type = null , ? string $ key1 = null , ? string $ key2 = null )
210210 {
211211 $ conditions = $ this ->getCondition ($ type , $ key1 , $ key2 );
212212 $ query = 'SELECT * FROM data WHERE ' . $ conditions ;
@@ -234,9 +234,9 @@ public function getList(string $type = null, string $key1 = null, string $key2 =
234234 * @return array|null
235235 */
236236 public function getKeys (
237- string $ type = null ,
238- string $ key1 = null ,
239- string $ key2 = null ,
237+ ? string $ type = null ,
238+ ? string $ key1 = null ,
239+ ? string $ key2 = null ,
240240 string $ whichKey = 'type ' ,
241241 ): ?array {
242242 if (!in_array ($ whichKey , ['key1 ' , 'key2 ' , 'type ' ], true )) {
@@ -299,7 +299,7 @@ public function removeExpired(): int
299299 * @param string|null $key2
300300 * @return string
301301 */
302- private function getCondition (string $ type = null , string $ key1 = null , string $ key2 = null ): string
302+ private function getCondition (? string $ type = null , ? string $ key1 = null , ? string $ key2 = null ): string
303303 {
304304 $ conditions = [];
305305 if (!is_null ($ type )) {
0 commit comments