From 5e21a277f62e3fe044feaa540ff6f206157348e7 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Thu, 20 Sep 2018 12:52:01 +0200 Subject: [PATCH 1/3] PHP 7.2 deprecation fixes --- docs/tutorial/tutorial_authentication.php | 2 +- docs/tutorial/tutorial_group.php | 2 +- docs/tutorial/tutorial_htpasswd.php | 2 +- docs/tutorial/tutorial_ldap.php | 2 +- docs/tutorial/tutorial_multiple_credentials.php | 2 +- docs/tutorial/tutorial_openid_dumb.php | 2 +- docs/tutorial/tutorial_openid_smart.php | 4 +++- docs/tutorial/tutorial_session.php | 2 +- docs/tutorial/tutorial_typekey.php | 2 +- src/authentication.php | 5 +++-- src/filters/group/group_filter.php | 4 ++-- src/filters/htpasswd/htpasswd_filter.php | 2 +- src/filters/ldap/ldap_filter.php | 2 +- src/filters/openid/openid_filter.php | 2 +- src/filters/typekey/typekey_filter.php | 2 +- src/session/authentication_session.php | 2 +- 16 files changed, 21 insertions(+), 18 deletions(-) diff --git a/docs/tutorial/tutorial_authentication.php b/docs/tutorial/tutorial_authentication.php index 944b0af..b003d48 100644 --- a/docs/tutorial/tutorial_authentication.php +++ b/docs/tutorial/tutorial_authentication.php @@ -17,7 +17,7 @@ ); foreach ( $status as $line ) { - list( $key, $value ) = each( $line ); + $value = current( $line ); $key = key( $line ); echo $err[$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_group.php b/docs/tutorial/tutorial_group.php index a6afa94..9140ba4 100644 --- a/docs/tutorial/tutorial_group.php +++ b/docs/tutorial/tutorial_group.php @@ -32,7 +32,7 @@ ); foreach ( $status as $line ) { - list( $key, $value ) = each( $line ); + $value = current( $line ); $key = key( $line ); echo $err[$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_htpasswd.php b/docs/tutorial/tutorial_htpasswd.php index 6e70504..21a6bf1 100644 --- a/docs/tutorial/tutorial_htpasswd.php +++ b/docs/tutorial/tutorial_htpasswd.php @@ -18,7 +18,7 @@ ); foreach ( $status as $line ) { - list( $key, $value ) = each( $line ); + $value = current( $line ); $key = key( $line ); echo $err[$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_ldap.php b/docs/tutorial/tutorial_ldap.php index cd72ec5..ae7cb2d 100644 --- a/docs/tutorial/tutorial_ldap.php +++ b/docs/tutorial/tutorial_ldap.php @@ -18,7 +18,7 @@ ); foreach ( $status as $line ) { - list( $key, $value ) = each( $line ); + $value = current( $line ); $key = key( $line ); echo $err[$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_multiple_credentials.php b/docs/tutorial/tutorial_multiple_credentials.php index 5b1f61c..5d8916f 100644 --- a/docs/tutorial/tutorial_multiple_credentials.php +++ b/docs/tutorial/tutorial_multiple_credentials.php @@ -37,7 +37,7 @@ foreach ( $status as $line => $error ) { - list( $key, $value ) = each( $error ); + $value = current( $error ); $key = key( $error ); echo $err[$line][$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_openid_dumb.php b/docs/tutorial/tutorial_openid_dumb.php index 9441afe..316e302 100644 --- a/docs/tutorial/tutorial_openid_dumb.php +++ b/docs/tutorial/tutorial_openid_dumb.php @@ -39,7 +39,7 @@ ); foreach ( $status as $line ) { - list( $key, $value ) = each( $line ); + $value = current( $line ); $key = key( $line ); echo $err[$key][$value] . "\n"; } ?> diff --git a/docs/tutorial/tutorial_openid_smart.php b/docs/tutorial/tutorial_openid_smart.php index 071d919..4af0f36 100644 --- a/docs/tutorial/tutorial_openid_smart.php +++ b/docs/tutorial/tutorial_openid_smart.php @@ -46,7 +46,9 @@ $err["session"] = ""; for ( $i = 0; $i < count( $status ); $i++ ) { - list( $key, $value ) = each( $status[$i] ); + $value = current( $status[$i] ); + $key = key( $status[$i] ); + switch ( $key ) { case 'ezcAuthenticationOpenidFilter': diff --git a/docs/tutorial/tutorial_session.php b/docs/tutorial/tutorial_session.php index 26e3b67..cc98165 100644 --- a/docs/tutorial/tutorial_session.php +++ b/docs/tutorial/tutorial_session.php @@ -27,7 +27,7 @@ ); foreach ( $status as $line ) { - list( $key, $value ) = each( $line ); + $value = current( $line ); $key = key( $line ); echo $err[$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_typekey.php b/docs/tutorial/tutorial_typekey.php index 2147ad4..a9d048a 100644 --- a/docs/tutorial/tutorial_typekey.php +++ b/docs/tutorial/tutorial_typekey.php @@ -32,7 +32,7 @@ ); foreach ( $status as $line ) { - list( $key, $value ) = each( $line ); + $value = current( $line ); $key = key( $line ); echo $err[$key][$value] . "\n"; } ?> diff --git a/src/authentication.php b/src/authentication.php index 869f788..971a1cb 100644 --- a/src/authentication.php +++ b/src/authentication.php @@ -58,7 +58,7 @@ * ); * foreach ( $status as $line ) * { - * list( $key, $value ) = each( $line ); + * $value = current( $line ); $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * } @@ -263,7 +263,8 @@ public function run() // status of the Authentication object foreach ( $statuses as $status ) { - list( $key, $value ) = each( $status ); + $value = current( $status ); + $key = key( $status ); $this->status->append( $key, $value ); } } diff --git a/src/filters/group/group_filter.php b/src/filters/group/group_filter.php index 7091266..31bca2f 100644 --- a/src/filters/group/group_filter.php +++ b/src/filters/group/group_filter.php @@ -80,7 +80,7 @@ * ); * foreach ( $status as $line => $error ) * { - * list( $key, $value ) = each( $error ); + * $value = current( $error ); $key = key( $error ); * echo $err[$line][$key][$value] . "\n"; * } * } @@ -133,7 +133,7 @@ * * foreach ( $status as $line => $error ) * { - * list( $key, $value ) = each( $error ); + * $value = current( $error ); $key = key( $error ); * echo $err[$line][$key][$value] . "\n"; * } * } diff --git a/src/filters/htpasswd/htpasswd_filter.php b/src/filters/htpasswd/htpasswd_filter.php index a97a7ef..fbbf4c0 100644 --- a/src/filters/htpasswd/htpasswd_filter.php +++ b/src/filters/htpasswd/htpasswd_filter.php @@ -60,7 +60,7 @@ * ); * foreach ( $status as $line ) * { - * list( $key, $value ) = each( $line ); + * $value = current( $line ); $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * } diff --git a/src/filters/ldap/ldap_filter.php b/src/filters/ldap/ldap_filter.php index 79cf6fd..ff6b766 100644 --- a/src/filters/ldap/ldap_filter.php +++ b/src/filters/ldap/ldap_filter.php @@ -52,7 +52,7 @@ * ); * foreach ( $status as $line ) * { - * list( $key, $value ) = each( $line ); + * $value = current( $line ); $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * } diff --git a/src/filters/openid/openid_filter.php b/src/filters/openid/openid_filter.php index aa6ffa1..bdf64c0 100644 --- a/src/filters/openid/openid_filter.php +++ b/src/filters/openid/openid_filter.php @@ -148,7 +148,7 @@ * ); * foreach ( $status as $line ) * { - * list( $key, $value ) = each( $line ); + * $value = current( $line ); $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * ?> diff --git a/src/filters/typekey/typekey_filter.php b/src/filters/typekey/typekey_filter.php index d770ced..e619320 100644 --- a/src/filters/typekey/typekey_filter.php +++ b/src/filters/typekey/typekey_filter.php @@ -117,7 +117,7 @@ * ); * foreach ( $status as $line ) * { - * list( $key, $value ) = each( $line ); + * $value = current( $line ); $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * ?> diff --git a/src/session/authentication_session.php b/src/session/authentication_session.php index 391bec5..cc00c97 100644 --- a/src/session/authentication_session.php +++ b/src/session/authentication_session.php @@ -68,7 +68,7 @@ * ); * foreach ( $status as $line ) * { - * list( $key, $value ) = each( $line ); + * $value = current( $line ); $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * } From 28e596290abfad0b465e41a3e8a16567452893d9 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Thu, 20 Sep 2018 13:22:06 +0200 Subject: [PATCH 2/3] splitting commands --- docs/tutorial/tutorial_authentication.php | 3 ++- docs/tutorial/tutorial_group.php | 3 ++- docs/tutorial/tutorial_htpasswd.php | 3 ++- docs/tutorial/tutorial_ldap.php | 3 ++- docs/tutorial/tutorial_openid_dumb.php | 3 ++- docs/tutorial/tutorial_session.php | 3 ++- docs/tutorial/tutorial_typekey.php | 3 ++- src/authentication.php | 3 ++- src/filters/htpasswd/htpasswd_filter.php | 3 ++- src/filters/ldap/ldap_filter.php | 3 ++- src/filters/openid/openid_filter.php | 3 ++- src/filters/typekey/typekey_filter.php | 3 ++- src/session/authentication_session.php | 3 ++- 13 files changed, 26 insertions(+), 13 deletions(-) diff --git a/docs/tutorial/tutorial_authentication.php b/docs/tutorial/tutorial_authentication.php index b003d48..1f28c38 100644 --- a/docs/tutorial/tutorial_authentication.php +++ b/docs/tutorial/tutorial_authentication.php @@ -17,7 +17,8 @@ ); foreach ( $status as $line ) { - $value = current( $line ); $key = key( $line ); + $value = current( $line ); + $key = key( $line ); echo $err[$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_group.php b/docs/tutorial/tutorial_group.php index 9140ba4..e044109 100644 --- a/docs/tutorial/tutorial_group.php +++ b/docs/tutorial/tutorial_group.php @@ -32,7 +32,8 @@ ); foreach ( $status as $line ) { - $value = current( $line ); $key = key( $line ); + $value = current( $line ); + $key = key( $line ); echo $err[$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_htpasswd.php b/docs/tutorial/tutorial_htpasswd.php index 21a6bf1..baab97b 100644 --- a/docs/tutorial/tutorial_htpasswd.php +++ b/docs/tutorial/tutorial_htpasswd.php @@ -18,7 +18,8 @@ ); foreach ( $status as $line ) { - $value = current( $line ); $key = key( $line ); + $value = current( $line ); + $key = key( $line ); echo $err[$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_ldap.php b/docs/tutorial/tutorial_ldap.php index ae7cb2d..951ca61 100644 --- a/docs/tutorial/tutorial_ldap.php +++ b/docs/tutorial/tutorial_ldap.php @@ -18,7 +18,8 @@ ); foreach ( $status as $line ) { - $value = current( $line ); $key = key( $line ); + $value = current( $line ); + $key = key( $line ); echo $err[$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_openid_dumb.php b/docs/tutorial/tutorial_openid_dumb.php index 316e302..6573288 100644 --- a/docs/tutorial/tutorial_openid_dumb.php +++ b/docs/tutorial/tutorial_openid_dumb.php @@ -39,7 +39,8 @@ ); foreach ( $status as $line ) { - $value = current( $line ); $key = key( $line ); + $value = current( $line ); + $key = key( $line ); echo $err[$key][$value] . "\n"; } ?> diff --git a/docs/tutorial/tutorial_session.php b/docs/tutorial/tutorial_session.php index cc98165..b7015c5 100644 --- a/docs/tutorial/tutorial_session.php +++ b/docs/tutorial/tutorial_session.php @@ -27,7 +27,8 @@ ); foreach ( $status as $line ) { - $value = current( $line ); $key = key( $line ); + $value = current( $line ); + $key = key( $line ); echo $err[$key][$value] . "\n"; } } diff --git a/docs/tutorial/tutorial_typekey.php b/docs/tutorial/tutorial_typekey.php index a9d048a..6e96eec 100644 --- a/docs/tutorial/tutorial_typekey.php +++ b/docs/tutorial/tutorial_typekey.php @@ -32,7 +32,8 @@ ); foreach ( $status as $line ) { - $value = current( $line ); $key = key( $line ); + $value = current( $line ); + $key = key( $line ); echo $err[$key][$value] . "\n"; } ?> diff --git a/src/authentication.php b/src/authentication.php index 971a1cb..9ac1994 100644 --- a/src/authentication.php +++ b/src/authentication.php @@ -58,7 +58,8 @@ * ); * foreach ( $status as $line ) * { - * $value = current( $line ); $key = key( $line ); + * $value = current( $line ); + * $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * } diff --git a/src/filters/htpasswd/htpasswd_filter.php b/src/filters/htpasswd/htpasswd_filter.php index fbbf4c0..fbed082 100644 --- a/src/filters/htpasswd/htpasswd_filter.php +++ b/src/filters/htpasswd/htpasswd_filter.php @@ -60,7 +60,8 @@ * ); * foreach ( $status as $line ) * { - * $value = current( $line ); $key = key( $line ); + * $value = current( $line ); + * $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * } diff --git a/src/filters/ldap/ldap_filter.php b/src/filters/ldap/ldap_filter.php index ff6b766..133a948 100644 --- a/src/filters/ldap/ldap_filter.php +++ b/src/filters/ldap/ldap_filter.php @@ -52,7 +52,8 @@ * ); * foreach ( $status as $line ) * { - * $value = current( $line ); $key = key( $line ); + * $value = current( $line ); + * $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * } diff --git a/src/filters/openid/openid_filter.php b/src/filters/openid/openid_filter.php index bdf64c0..a9c47ec 100644 --- a/src/filters/openid/openid_filter.php +++ b/src/filters/openid/openid_filter.php @@ -148,7 +148,8 @@ * ); * foreach ( $status as $line ) * { - * $value = current( $line ); $key = key( $line ); + * $value = current( $line ); + * $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * ?> diff --git a/src/filters/typekey/typekey_filter.php b/src/filters/typekey/typekey_filter.php index e619320..67a9953 100644 --- a/src/filters/typekey/typekey_filter.php +++ b/src/filters/typekey/typekey_filter.php @@ -117,7 +117,8 @@ * ); * foreach ( $status as $line ) * { - * $value = current( $line ); $key = key( $line ); + * $value = current( $line ); + * $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * ?> diff --git a/src/session/authentication_session.php b/src/session/authentication_session.php index cc00c97..eb7434d 100644 --- a/src/session/authentication_session.php +++ b/src/session/authentication_session.php @@ -68,7 +68,8 @@ * ); * foreach ( $status as $line ) * { - * $value = current( $line ); $key = key( $line ); + * $value = current( $line ); + * $key = key( $line ); * echo $err[$key][$value] . "\n"; * } * } From d2f7141f214a89413162dca66048ad9bbbfd0cbd Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Thu, 20 Sep 2018 13:28:28 +0200 Subject: [PATCH 3/3] splitting more commands --- docs/tutorial/tutorial_multiple_credentials.php | 3 ++- src/filters/group/group_filter.php | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/tutorial/tutorial_multiple_credentials.php b/docs/tutorial/tutorial_multiple_credentials.php index 5d8916f..da600e2 100644 --- a/docs/tutorial/tutorial_multiple_credentials.php +++ b/docs/tutorial/tutorial_multiple_credentials.php @@ -37,7 +37,8 @@ foreach ( $status as $line => $error ) { - $value = current( $error ); $key = key( $error ); + $value = current( $error ); + $key = key( $error ); echo $err[$line][$key][$value] . "\n"; } } diff --git a/src/filters/group/group_filter.php b/src/filters/group/group_filter.php index 31bca2f..879dddc 100644 --- a/src/filters/group/group_filter.php +++ b/src/filters/group/group_filter.php @@ -80,7 +80,8 @@ * ); * foreach ( $status as $line => $error ) * { - * $value = current( $error ); $key = key( $error ); + * $value = current( $error ); + * $key = key( $error ); * echo $err[$line][$key][$value] . "\n"; * } * } @@ -133,7 +134,8 @@ * * foreach ( $status as $line => $error ) * { - * $value = current( $error ); $key = key( $error ); + * $value = current( $error ); + * $key = key( $error ); * echo $err[$line][$key][$value] . "\n"; * } * }