original_string: public function getFlashObject($name)
      {
          $serialized = $this->__get($name);
  
          $object = \is_string($serialized) ? unserialize($serialized, ['allowed_classes' => true]) : $serialized;
  
          $this->__unset($name);
  
          if ($name === 'files-upload') {
              $grav = Grav::instance();
  
              // Make sure that Forms 3.0+ has been installed.
              if (null === $object && isset($grav['forms'])) {
                  user_error(
                      __CLASS__ . '::' . __FUNCTION__ . '(\'files-upload\') is deprecated since Grav 1.6, use $form->getFlash()->getLegacyFiles() instead',
                      E_USER_DEPRECATED
                  );
  
                  /** @var Uri $uri */
                  $uri = $grav['uri'];
                  /** @var Grav\Plugin\Form\Forms $form */
                  $form = $grav['forms']->getActiveForm();
  
                  $sessionField = base64_encode($uri->url);
  
                  /** @var FormFlash $flash */
                  $flash = $form ? $form->getFlash() : null;
                  $object = $flash ? [$sessionField => $flash->getLegacyFiles()] : null;
              }
          }
  
          return $object;
      }
code: public function getFlashObject($name)
      {
          $serialized = $this->__get($name);
  
          $object = \is_string($serialized) ? unserialize($serialized, ['allowed_classes' => true]) : $serialized;
  
          $this->__unset($name);
  
          if ($name === 'files-upload') {
              $grav = Grav::instance();
  
              // Make sure that Forms 3.0+ has been installed.
              if (null === $object && isset($grav['forms'])) {
                  user_error(
                      __CLASS__ . '::' . __FUNCTION__ . '(\'files-upload\') is deprecated since Grav 1.6, use $form->getFlash()->getLegacyFiles() instead',
                      E_USER_DEPRECATED
                  );
  
                  /** @var Uri $uri */
                  $uri = $grav['uri'];
                  /** @var Grav\Plugin\Form\Forms $form */
                  $form = $grav['forms']->getActiveForm();
  
                  $sessionField = base64_encode($uri->url);
  
                  /** @var FormFlash $flash */
                  $flash = $form ? $form->getFlash() : null;
                  $object = $flash ? [$sessionField => $flash->getLegacyFiles()] : null;
              }
          }
  
          return $object;
      }
code_tokens: public function getFlashObject ( $ name ) { $ serialized = $ this -> __get ( $ name ) ; $ object = \ is_string ( $ serialized ) ? unserialize ( $ serialized , [ 'allowed_classes' => true ] ) : $ serialized ; $ this -> __unset ( $ name ) ; if ( $ name === 'files-upload' ) { $ grav = Grav :: instance ( ) ; // Make sure that Forms 3.0+ has been installed. if ( null === $ object && isset ( $ grav [ 'forms' ] ) ) { user_error ( __CLASS__ . '::' . __FUNCTION__ . '(\'files-upload\') is deprecated since Grav 1.6, use $form->getFlash()->getLegacyFiles() instead' , E_USER_DEPRECATED ) ; /** @var Uri $uri */ $ uri = $ grav [ 'uri' ] ; /** @var Grav\Plugin\Form\Forms $form */ $ form = $ grav [ 'forms' ] -> getActiveForm ( ) ; $ sessionField = base64_encode ( $ uri -> url ) ; /** @var FormFlash $flash */ $ flash = $ form ? $ form -> getFlash ( ) : null ; $ object = $ flash ? [ $ sessionField => $ flash -> getLegacyFiles ( ) ] : null ; } } return $ object ; }
docstring: Return object and remove it from session.
  
  @param string $name
  @return mixed
docstring_tokens: Return object and remove it from session .