Commit 465a9aa4 authored by Gaurav Kapoor's avatar Gaurav Kapoor Committed by rsvelko
Browse files

Issue #3257760 by gaurav.kapoor, andregp: Resolve warning messages shown by the PHPCS

parent af7d10ca
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ function login_destination_user_logout(AccountInterface $account) {
 * Implements hook_form_FORM_ID_alter() for user_form().
 */
function login_destination_form_user_form_alter(array &$form, FormStateInterface $form_state) {
  if (isset($_GET['pass-reset-token'])) {
  if (\Drupal::request()->query->get('pass-reset-token') !== NULL) {
    // If the query parameter 'pass-reset-token' is set, it is assumed that the
    // user just used a one-time login url.
    // If we add the $form_state['redirect'] here it will be overriden by
@@ -129,14 +129,14 @@ function login_destination_toolbar_alter(&$items) {
function login_destination_link_alter(&$variables) {
  $routes = [
    'user.login',
    'user.logout'
    'user.logout',
  ];
  /* @var Drupal\Core\Url $url */
  /** @var Drupal\Core\Url $url */
  $url = $variables['url'];
  if ($url->isRouted() && in_array($url->getRouteName(), $routes)) {
    // Get current path.
    $current = \Drupal::service('path.current')->getPath();
    $variables['options']['query']['current'] = $current;
    $current = \Drupal::request()->getpathInfo(); /*with lang prefix*/
    $variables['options']['query']['destination'] = $current;
  }
}

@@ -169,7 +169,7 @@ function login_destination_entity_presave(EntityInterface $entity) {
 *   User Account.
 */
function login_destination_perform_redirect($trigger, AccountInterface $account) {
  /* @var Drupal\login_destination\LoginDestinationManager $service */
  /** @var Drupal\login_destination\LoginDestinationManager $service */
  $service = \Drupal::service('login_destination.manager');
  $destination = $service->findDestination($trigger, $account);
  if ($destination) {
+1 −0
Original line number Diff line number Diff line
@@ -260,6 +260,7 @@ class LoginDestinationRuleForm extends EntityForm {
   *
   * @return string
   *   Returns a $displayable_string for the URI.
   *
   * @see LinkWidget::getUriAsDisplayableString()
   */
  protected function getUriAsDisplayableString($uri) {
+0 −1
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ class RedirectTest extends BrowserTestBase {
   */
  protected function drupalLogout() {
    // Make a request to the logout page.
    $assert_session = $this->assertSession();
    $this->drupalGet('user/logout');

    // @see BrowserTestBase::drupalUserIsLoggedIn()