original_string: public function createConnection($parameters)
      {
          $connection = new \PDO(
              'mysql:host=' . $parameters['host'] . ';dbname=' . $parameters['database'],
              $parameters['username'],
              $parameters['password']
          );
  
          if (isset($parameters['charset'])) {
              $connection->exec('SET CHARACTER SET ' . $parameters['charset']);
          }
  
          return $connection;
      }
code: public function createConnection($parameters)
      {
          $connection = new \PDO(
              'mysql:host=' . $parameters['host'] . ';dbname=' . $parameters['database'],
              $parameters['username'],
              $parameters['password']
          );
  
          if (isset($parameters['charset'])) {
              $connection->exec('SET CHARACTER SET ' . $parameters['charset']);
          }
  
          return $connection;
      }
code_tokens: public function createConnection ( $ parameters ) { $ connection = new \ PDO ( 'mysql:host=' . $ parameters [ 'host' ] . ';dbname=' . $ parameters [ 'database' ] , $ parameters [ 'username' ] , $ parameters [ 'password' ] ) ; if ( isset ( $ parameters [ 'charset' ] ) ) { $ connection -> exec ( 'SET CHARACTER SET ' . $ parameters [ 'charset' ] ) ; } return $ connection ; }
docstring: Creates a MySql Connection
  
  @param array $parameters Connection parameters
  <pre>
  host: eg. localhost
  database: eg. my_app
  username: eg. root
  password: eg. 123456
  charset:  (Optional)
  </pre>
  
  @return \PDO
docstring_tokens: Creates a MySql Connection