AuthFactory.php (mrbs-1.9.4) | : | AuthFactory.php (mrbs-1.10.0) | ||
---|---|---|---|---|
<?php | <?php | |||
namespace MRBS\Auth; | namespace MRBS\Auth; | |||
class AuthFactory | class AuthFactory | |||
{ | { | |||
public static function create($type) | public static function create(string $type) | |||
{ | { | |||
// Transform the authentication type from lowercase_separated to LowercaseSe parated | // Transform the authentication type from lowercase_separated to LowercaseSe parated | |||
$parts = explode('_', $type); | $parts = explode('_', $type); | |||
$parts = array_map('ucfirst', $parts); | $parts = array_map('ucfirst', $parts); | |||
$class = __NAMESPACE__ . "\\Auth" . implode('', $parts); | $class = __NAMESPACE__ . "\\Auth" . implode('', $parts); | |||
return new $class; | return new $class; | |||
} | } | |||
} | } | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added |