original_string: public function setLanguage($language)
      {
          if ($this->getStorageMethod() == 'cookie') {
              return cookie()->forever($this->getLanguageKey(), $language);
          }
          if ( interface_exists( \Illuminate\Contracts\Session\Session::class ) && method_exists(\Illuminate\Contracts\Session\Session::class, 'put') ) {
              Session::put($this->getLanguageKey(), $language);
          } else {
              Session::set($this->getLanguageKey(), $language);
          }
          $this->registerLanguage();
          return cookie('dummy-cookie', FALSE, 1); //just for cleaner code in the controller
      }
code: public function setLanguage($language)
      {
          if ($this->getStorageMethod() == 'cookie') {
              return cookie()->forever($this->getLanguageKey(), $language);
          }
          if ( interface_exists( \Illuminate\Contracts\Session\Session::class ) && method_exists(\Illuminate\Contracts\Session\Session::class, 'put') ) {
              Session::put($this->getLanguageKey(), $language);
          } else {
              Session::set($this->getLanguageKey(), $language);
          }
          $this->registerLanguage();
          return cookie('dummy-cookie', FALSE, 1); //just for cleaner code in the controller
      }
code_tokens: public function setLanguage ( $ language ) { if ( $ this -> getStorageMethod ( ) == 'cookie' ) { return cookie ( ) -> forever ( $ this -> getLanguageKey ( ) , $ language ) ; } if ( interface_exists ( \ Illuminate \ Contracts \ Session \ Session :: class ) && method_exists ( \ Illuminate \ Contracts \ Session \ Session :: class , 'put' ) ) { Session :: put ( $ this -> getLanguageKey ( ) , $ language ) ; } else { Session :: set ( $ this -> getLanguageKey ( ) , $ language ) ; } $ this -> registerLanguage ( ) ; return cookie ( 'dummy-cookie' , FALSE , 1 ) ; //just for cleaner code in the controller }
docstring: Sets the language flag and returns the cookie to be created on the redirect
  @param $language
  @return mixed | null
docstring_tokens: Sets the language flag and returns the cookie to be created on the redirect