original_string: public function getFlash(): FormFlash
      {
          if (null === $this->flash) {
              /** @var Grav $grav */
              $grav = Grav::instance();
              $id = null;
  
              $user = $grav['user'] ?? null;
              if (isset($user)) {
                  $rememberState = $this->getBlueprint()->get('form/remember_state');
                  if ($rememberState === 'user') {
                      $id = $user->username;
                  }
              }
  
              // Session Required for flash form
              $session = $grav['session'] ?? null;
              if (isset($session)) {
                  // By default store flash by the session id.
                  if (null === $id) {
                      $id = $session->getId();
                  }
  
  
                  $this->flash = new FormFlash($id, $this->getUniqueId(), $this->getName());
                  $this->flash->setUrl($grav['uri']->url)->setUser($user);
              }
          }
  
          return $this->flash;
      }
code: public function getFlash(): FormFlash
      {
          if (null === $this->flash) {
              /** @var Grav $grav */
              $grav = Grav::instance();
              $id = null;
  
              $user = $grav['user'] ?? null;
              if (isset($user)) {
                  $rememberState = $this->getBlueprint()->get('form/remember_state');
                  if ($rememberState === 'user') {
                      $id = $user->username;
                  }
              }
  
              // Session Required for flash form
              $session = $grav['session'] ?? null;
              if (isset($session)) {
                  // By default store flash by the session id.
                  if (null === $id) {
                      $id = $session->getId();
                  }
  
  
                  $this->flash = new FormFlash($id, $this->getUniqueId(), $this->getName());
                  $this->flash->setUrl($grav['uri']->url)->setUser($user);
              }
          }
  
          return $this->flash;
      }
code_tokens: public function getFlash ( ) : FormFlash { if ( null === $ this -> flash ) { /** @var Grav $grav */ $ grav = Grav :: instance ( ) ; $ id = null ; $ user = $ grav [ 'user' ] ?? null ; if ( isset ( $ user ) ) { $ rememberState = $ this -> getBlueprint ( ) -> get ( 'form/remember_state' ) ; if ( $ rememberState === 'user' ) { $ id = $ user -> username ; } } // Session Required for flash form $ session = $ grav [ 'session' ] ?? null ; if ( isset ( $ session ) ) { // By default store flash by the session id. if ( null === $ id ) { $ id = $ session -> getId ( ) ; } $ this -> flash = new FormFlash ( $ id , $ this -> getUniqueId ( ) , $ this -> getName ( ) ) ; $ this -> flash -> setUrl ( $ grav [ 'uri' ] -> url ) -> setUser ( $ user ) ; } } return $ this -> flash ; }
docstring: Get form flash object.
  
  @return FormFlash
docstring_tokens: Get form flash object .