@@ -41,7 +41,7 @@ class SQLPermanentStorage
4141 * @param \SimpleSAML\Configuration|null $config
4242 * @throws \Exception
4343 */
44- public function __construct (string $ name , Configuration $ config = null )
44+ public function __construct (string $ name , ? Configuration $ config = null )
4545 {
4646 if (is_null ($ config )) {
4747 $ config = Configuration::getInstance ();
@@ -93,7 +93,7 @@ public function __construct(string $name, Configuration $config = null)
9393 * @param string $value
9494 * @param int|null $duration
9595 */
96- public function set (string $ type , string $ key1 , string $ key2 , string $ value , int $ duration = null ): void
96+ public function set (string $ type , string $ key1 , string $ key2 , string $ value , ? int $ duration = null ): void
9797 {
9898 if ($ this ->exists ($ type , $ key1 , $ key2 )) {
9999 $ this ->update ($ type , $ key1 , $ key2 , $ value , $ duration );
@@ -111,7 +111,7 @@ public function set(string $type, string $key1, string $key2, string $value, int
111111 * @param int|null $duration
112112 * @return array
113113 */
114- private function insert (string $ type , string $ key1 , string $ key2 , string $ value , int $ duration = null ): array
114+ private function insert (string $ type , string $ key1 , string $ key2 , string $ value , ? int $ duration = null ): array
115115 {
116116 $ expire = is_null ($ duration ) ? null : (time () + $ duration );
117117
@@ -137,7 +137,7 @@ private function insert(string $type, string $key1, string $key2, string $value,
137137 * @param int|null $duration
138138 * @return array
139139 */
140- private function update (string $ type , string $ key1 , string $ key2 , string $ value , int $ duration = null ): array
140+ private function update (string $ type , string $ key1 , string $ key2 , string $ value , ? int $ duration = null ): array
141141 {
142142 $ expire = is_null ($ duration ) ? null : (time () + $ duration );
143143
@@ -160,7 +160,7 @@ private function update(string $type, string $key1, string $key2, string $value,
160160 * @param string|null $key2
161161 * @return array|null
162162 */
163- public function get (string $ type = null , string $ key1 = null , string $ key2 = null ): ?array
163+ public function get (? string $ type = null , ? string $ key1 = null , ? string $ key2 = null ): ?array
164164 {
165165 $ conditions = $ this ->getCondition ($ type , $ key1 , $ key2 );
166166 $ query = 'SELECT * FROM data WHERE ' . $ conditions ;
@@ -185,7 +185,7 @@ public function get(string $type = null, string $key1 = null, string $key2 = nul
185185 * @param string|null $key2
186186 * @return string|null
187187 */
188- public function getValue (string $ type = null , string $ key1 = null , string $ key2 = null ): ?string
188+ public function getValue (? string $ type = null , ? string $ key1 = null , ? string $ key2 = null ): ?string
189189 {
190190 $ res = $ this ->get ($ type , $ key1 , $ key2 );
191191 if ($ res === null ) {
@@ -218,7 +218,7 @@ public function exists(string $type, string $key1, string $key2): bool
218218 * @param string|null $key2
219219 * @return array|false
220220 */
221- public function getList (string $ type = null , string $ key1 = null , string $ key2 = null )
221+ public function getList (? string $ type = null , ? string $ key1 = null , ? string $ key2 = null )
222222 {
223223 $ conditions = $ this ->getCondition ($ type , $ key1 , $ key2 );
224224 $ query = 'SELECT * FROM data WHERE ' . $ conditions ;
@@ -246,9 +246,9 @@ public function getList(string $type = null, string $key1 = null, string $key2 =
246246 * @return array|null
247247 */
248248 public function getKeys (
249- string $ type = null ,
250- string $ key1 = null ,
251- string $ key2 = null ,
249+ ? string $ type = null ,
250+ ? string $ key1 = null ,
251+ ? string $ key2 = null ,
252252 string $ whichKey = 'type ' ,
253253 ): ?array {
254254 if (!in_array ($ whichKey , ['key1 ' , 'key2 ' , 'type ' ], true )) {
@@ -311,7 +311,7 @@ public function removeExpired(): int
311311 * @param string|null $key2
312312 * @return string
313313 */
314- private function getCondition (string $ type = null , string $ key1 = null , string $ key2 = null ): string
314+ private function getCondition (? string $ type = null , ? string $ key1 = null , ? string $ key2 = null ): string
315315 {
316316 $ conditions = [];
317317 if (!is_null ($ type )) {
0 commit comments