code: public function clean($value, bool $trim = true, bool $clean = true)
      {
          if (is_bool($value) || is_int($value) || is_float($value)) {
              return $value;
          }
  
          $final = null;
  
          if ($value !== null) {
              if (is_array($value)) {
                  $all = $value;
                  $final = [];
                  foreach ($all as $key => $value) {
                      if ($value !== null) {
                          $final[$key] = $this->clean($value, $trim, $clean);
                      }
                  }
              } else {
                  if ($value !== null) {
                      $final = $this->process((string) $value, $trim, $clean);
                  }
              }
          }
  
          return $final;
      }
docs: Clean a specified value or values.
  
  @param mixed $value
  @param bool  $trim
  @param bool  $clean
  
  @return mixed