Changeset:
        1be9c48d8f9c
        
https://sourceforge.net/p/mrbs/hg-code/ci/1be9c48d8f9c63fc01488cb5489f9448f2150245
Author:
        Campbell Morrison <[email protected]>
Date:
        Sat Oct 29 09:50:35 2016 +0100
Log message:

Simplified code and added type hinting

diffstat:

 web/auth/auth_wordpress.inc |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (25 lines):

diff -r 4269cec9ef42 -r 1be9c48d8f9c web/auth/auth_wordpress.inc
--- a/web/auth/auth_wordpress.inc       Sat Oct 29 09:02:35 2016 +0100
+++ b/web/auth/auth_wordpress.inc       Sat Oct 29 09:50:35 2016 +0100
@@ -107,7 +107,7 @@
 
 // Checks to see whether any of the user's roles are contained in $mrbs_roles, 
which can be a
 // string or an array of strings.
-function check_roles($wp_user, $mrbs_roles)
+function check_roles(\WP_User $wp_user, $mrbs_roles)
 {
   if (!isset($mrbs_roles))
   {
@@ -115,10 +115,8 @@
   }
   
   // Turn $mrbs_roles into an array if it isn't already
-  if (!is_array($mrbs_roles))
-  {
-    $mrbs_roles = array($mrbs_roles);
-  }
+  $mrbs_roles = (array)$mrbs_roles;
+
   // Put the roles into the standard WordPress format
   $mrbs_roles = array_map(__NAMESPACE__ . "\\standardise_role_name", 
$mrbs_roles);
   

------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to