Skip to content

Commit

Permalink
🤖 Automatic code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain authored and github-actions[bot] committed Apr 2, 2024
1 parent 5838e15 commit 8c6a1f0
Show file tree
Hide file tree
Showing 8 changed files with 279 additions and 266 deletions.
29 changes: 13 additions & 16 deletions HTTP/DokuHTTPClient.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php


namespace dokuwiki\plugin\upgrade\HTTP;


use dokuwiki\Extension\Event;

/**
* Adds DokuWiki specific configs to the HTTP client
*
* @author Andreas Goetz <[email protected]>
*/
class DokuHTTPClient extends HTTPClient {

class DokuHTTPClient extends HTTPClient
{
/**
* Constructor.
*
* @author Andreas Gohr <[email protected]>
*/
public function __construct(){
public function __construct()
{
global $conf;

// call parent constructor
Expand All @@ -32,8 +32,8 @@ public function __construct(){
$this->proxy_except = $conf['proxy']['except'];

// allow enabling debugging via URL parameter (if debugging allowed)
if($conf['allowdebug']) {
if(
if ($conf['allowdebug']) {
if (
isset($_REQUEST['httpdebug']) ||
(
isset($_SERVER['HTTP_REFERER']) &&
Expand All @@ -58,20 +58,17 @@ public function __construct(){
* @param string $method
* @return bool
*/
public function sendRequest($url,$data='',$method='GET'){
$httpdata = array('url' => $url,
'data' => $data,
'method' => $method);
$evt = new \Doku_Event('HTTPCLIENT_REQUEST_SEND',$httpdata);
if($evt->advise_before()){
public function sendRequest($url, $data = '', $method = 'GET')
{
$httpdata = ['url' => $url, 'data' => $data, 'method' => $method];
$evt = new Event('HTTPCLIENT_REQUEST_SEND', $httpdata);
if ($evt->advise_before()) {
$url = $httpdata['url'];
$data = $httpdata['data'];
$method = $httpdata['method'];
}
$evt->advise_after();
unset($evt);
return parent::sendRequest($url,$data,$method);
return parent::sendRequest($url, $data, $method);
}

}

Loading

0 comments on commit 8c6a1f0

Please sign in to comment.