code: public function clean($dirty, $config = null)
      {
          if (is_array($dirty)) {
              return array_map(function ($item) use ($config) {
                  return $this->clean($item, $config);
              }, $dirty);
          }
  
          return $this->purifier->purify($dirty, $config ? $this->getConfig($config) : null);
      }
docs: @param      $dirty
  @param null $config
  
  @return mixed