original_string: public function onAttachProject()
      {
          try {
              if (!$projectId = trim(post('project_id'))) {
                  throw new ApplicationException(Lang::get('system::lang.project.id.missing'));
              }
  
              $manager = UpdateManager::instance();
              $result = $manager->requestProjectDetails($projectId);
  
              Parameter::set([
                  'system::project.id'    => $projectId,
                  'system::project.name'  => $result['name'],
                  'system::project.owner' => $result['owner'],
              ]);
  
              return $this->onForceUpdate();
          }
          catch (Exception $ex) {
              $this->handleError($ex);
              return $this->makePartial('project_form');
          }
      }
code: public function onAttachProject()
      {
          try {
              if (!$projectId = trim(post('project_id'))) {
                  throw new ApplicationException(Lang::get('system::lang.project.id.missing'));
              }
  
              $manager = UpdateManager::instance();
              $result = $manager->requestProjectDetails($projectId);
  
              Parameter::set([
                  'system::project.id'    => $projectId,
                  'system::project.name'  => $result['name'],
                  'system::project.owner' => $result['owner'],
              ]);
  
              return $this->onForceUpdate();
          }
          catch (Exception $ex) {
              $this->handleError($ex);
              return $this->makePartial('project_form');
          }
      }
code_tokens: public function onAttachProject ( ) { try { if ( ! $ projectId = trim ( post ( 'project_id' ) ) ) { throw new ApplicationException ( Lang :: get ( 'system::lang.project.id.missing' ) ) ; } $ manager = UpdateManager :: instance ( ) ; $ result = $ manager -> requestProjectDetails ( $ projectId ) ; Parameter :: set ( [ 'system::project.id' => $ projectId , 'system::project.name' => $ result [ 'name' ] , 'system::project.owner' => $ result [ 'owner' ] , ] ) ; return $ this -> onForceUpdate ( ) ; } catch ( Exception $ ex ) { $ this -> handleError ( $ ex ) ; return $ this -> makePartial ( 'project_form' ) ; } }
docstring: Validate the project ID and execute the project installation
docstring_tokens: Validate the project ID and execute the project installation