original_string: public function hasRole($role = ''){
  
          $session = $this->getSession();
          $cookie = $this->getCookie();
  
  
          if ($cookie->has(self::USER_SESSION)) {
              $login = $cookie->get(self::USER_SESSION);
          }elseif (false !== $session->has(self::USER_SESSION)) {
              $login = $session->get(self::USER_SESSION);
          }else{
              return false;
          }
  
          $roleLogin = $login['role'];
  
          if (is_string($role)) {
              return $roleLogin === $role;
          }elseif(is_array($role)){
              return array_search($roleLogin, $role);
          }
  
          return false;
      }
code: public function hasRole($role = ''){
  
          $session = $this->getSession();
          $cookie = $this->getCookie();
  
  
          if ($cookie->has(self::USER_SESSION)) {
              $login = $cookie->get(self::USER_SESSION);
          }elseif (false !== $session->has(self::USER_SESSION)) {
              $login = $session->get(self::USER_SESSION);
          }else{
              return false;
          }
  
          $roleLogin = $login['role'];
  
          if (is_string($role)) {
              return $roleLogin === $role;
          }elseif(is_array($role)){
              return array_search($roleLogin, $role);
          }
  
          return false;
      }
code_tokens: public function hasRole ( $ role = '' ) { $ session = $ this -> getSession ( ) ; $ cookie = $ this -> getCookie ( ) ; if ( $ cookie -> has ( self :: USER_SESSION ) ) { $ login = $ cookie -> get ( self :: USER_SESSION ) ; } elseif ( false !== $ session -> has ( self :: USER_SESSION ) ) { $ login = $ session -> get ( self :: USER_SESSION ) ; } else { return false ; } $ roleLogin = $ login [ 'role' ] ; if ( is_string ( $ role ) ) { return $ roleLogin === $ role ; } elseif ( is_array ( $ role ) ) { return array_search ( $ roleLogin , $ role ) ; } return false ; }
docstring: check the user role
  
  @param string|int $role
  @return bool
docstring_tokens: check the user role