Skip to content

Commit

Permalink
Skip vendor directory for linting; fixed a couple of minor WordPress-…
Browse files Browse the repository at this point in the history
…Extra standards issues.
  • Loading branch information
jamesmorrison committed Jan 26, 2024
1 parent e7bb024 commit 069b9b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
- name: composer install
run: composer install
- name: PHPCS check
run: ./vendor/bin/phpcs --standard=WordPress-Extra .
run: ./vendor/bin/phpcs --standard=WordPress-Extra --ignore=vendor .
8 changes: 4 additions & 4 deletions includes/classes/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public static function get_instance() {
*/
public function setup() {
// Process SSO login on the 1st hook available on the login page.
add_action( 'login_head', [ $this, 'process_login' ] );
add_action( 'login_head', array( $this, 'process_login' ) );

// Logout from Cloudflare Access once WP logout is complete.
add_filter( 'logout_redirect', [ $this, 'set_cloudflare_access_logout_url' ], 10, 3 );
add_filter( 'logout_redirect', array( $this, 'set_cloudflare_access_logout_url' ), 10, 3 );
}

/**
Expand Down Expand Up @@ -100,12 +100,12 @@ public function process_login() {
// If a matching user is not found and create an account
if ( ! is_a( $user, '\WP_User' ) && CF_ACCESS_CREATE_ACCOUNT ?? false ) {
$user_id = wp_insert_user(
[
array(
'user_login' => $jwt->email,
'user_email' => $jwt->email,
'user_pass' => wp_generate_password( 128, true, true ),
'role' => $this->validate_new_user_role( CF_ACCESS_NEW_USER_ROLE ) ?? 'subscriber',
]
)
);

if ( ! is_wp_error( $user_id ) ) {
Expand Down
4 changes: 2 additions & 2 deletions includes/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* @return void
*/
function setup() {
$n = function( $function ) {
return __NAMESPACE__ . "\\$function";
$n = function ( $_fn ) {
return __NAMESPACE__ . "\\$_fn";
};

add_action( 'init', $n( 'i18n' ) );
Expand Down

0 comments on commit 069b9b8

Please sign in to comment.