original_string: public static function setter($request, $params)
      {
          if (is_array($params)) {
              foreach ($params as $property => $value) {
                  $property = Utils::deleteUnderscore($property);
                  $setter = 'set'.ucfirst($property);
                  if (method_exists($request, $setter)) {
                      $request->$setter($value);
                  } else {
                      throw new NavitiaCreationException(
                          sprintf(
                              'Neither property "%s" nor method "%s"'.
                              'nor method "%s" exist.',
                              $property,
                              'get'.ucfirst($property),
                              $setter
                          )
                      );
                  }
              }
          } else {
              throw new NavitiaCreationException(
                  sprintf(
                      'The parameter (type "%s") will be an Array',
                      gettype($params)
                  )
              );
          }
          return $request;
      }
code: public static function setter($request, $params)
      {
          if (is_array($params)) {
              foreach ($params as $property => $value) {
                  $property = Utils::deleteUnderscore($property);
                  $setter = 'set'.ucfirst($property);
                  if (method_exists($request, $setter)) {
                      $request->$setter($value);
                  } else {
                      throw new NavitiaCreationException(
                          sprintf(
                              'Neither property "%s" nor method "%s"'.
                              'nor method "%s" exist.',
                              $property,
                              'get'.ucfirst($property),
                              $setter
                          )
                      );
                  }
              }
          } else {
              throw new NavitiaCreationException(
                  sprintf(
                      'The parameter (type "%s") will be an Array',
                      gettype($params)
                  )
              );
          }
          return $request;
      }
code_tokens: public static function setter ( $ request , $ params ) { if ( is_array ( $ params ) ) { foreach ( $ params as $ property => $ value ) { $ property = Utils :: deleteUnderscore ( $ property ) ; $ setter = 'set' . ucfirst ( $ property ) ; if ( method_exists ( $ request , $ setter ) ) { $ request -> $ setter ( $ value ) ; } else { throw new NavitiaCreationException ( sprintf ( 'Neither property "%s" nor method "%s"' . 'nor method "%s" exist.' , $ property , 'get' . ucfirst ( $ property ) , $ setter ) ) ; } } } else { throw new NavitiaCreationException ( sprintf ( 'The parameter (type "%s") will be an Array' , gettype ( $ params ) ) ) ; } return $ request ; }
docstring: Fonction permettant de setter
  @param object $request
  @param array $params
  @return object
  @throws NavitiaCreationException
docstring_tokens: Fonction permettant de setter