Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS: variety of whitespace fixes #360

Merged
merged 1 commit into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bin/create_pear_package.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
);

$context['files'] = '';
$path = realpath(dirname(__FILE__).'/../library/Requests');
$path = realpath(dirname(__FILE__) . '/../library/Requests');
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
if (preg_match('/\.php$/', $file)) {
if (preg_match('/\.php$/', $file)) {
$name = str_replace($path . DIRECTORY_SEPARATOR, '', $file);
$name = str_replace(DIRECTORY_SEPARATOR, '/', $name);
$context['files'][] = "\t\t\t\t\t" . '<file install-as="Requests/' . $name . '" name="' . $name . '" role="php" />';
Expand All @@ -44,9 +44,9 @@

$context['files'] = implode("\n", $context['files']);

$template = file_get_contents(dirname(__FILE__).'/../package.xml.tpl');
$template = file_get_contents(dirname(__FILE__) . '/../package.xml.tpl');
$content = preg_replace_callback('/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/', 'replace_parameters', $template);
file_put_contents(dirname(__FILE__).'/../package.xml', $content);
file_put_contents(dirname(__FILE__) . '/../package.xml', $content);

function replace_parameters($matches) {
global $context;
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
$request = Requests::get('http://httpbin.org/basic-auth/someuser/password', array(), $options);

// Check what we received
var_dump($request);
var_dump($request);
2 changes: 1 addition & 1 deletion examples/cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
$request = Requests::get('http://httpbin.org/cookies', array('Cookie' => $c->formatForHeader()));

// Check what we received
var_dump($request);
var_dump($request);
4 changes: 2 additions & 2 deletions examples/cookie_jar.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Requests::register_autoloader();

// Say you need to fake a login cookie
$c = new Requests_Cookie_Jar(['login_uid' => 'something']);
$c = new Requests_Cookie_Jar(['login_uid' => 'something']);

// Now let's make a request!
$request = Requests::get(
Expand All @@ -17,4 +17,4 @@
);

// Check what we received
var_dump($request);
var_dump($request);
2 changes: 1 addition & 1 deletion examples/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
$request = Requests::get('http://httpbin.org/get', array('Accept' => 'application/json'));

// Check what we received
var_dump($request);
var_dump($request);
2 changes: 1 addition & 1 deletion examples/multiple.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ function my_callback(&$request, $id) {
// my_callback() anyway!
//
// If you don't believe me, uncomment this:
# var_dump($responses);
# var_dump($responses);
2 changes: 1 addition & 1 deletion examples/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
$request = Requests::post('http://httpbin.org/post', array(), array('mydata' => 'something'));

// Check what we received
var_dump($request);
var_dump($request);
2 changes: 1 addition & 1 deletion examples/proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// If you need to authenticate, use the following syntax:
// 'proxy' => array( '127.0.0.1:8080', 'username', 'password' ),
);
$request = Requests::get('http://httpbin.org/ip', array(), $options );
$request = Requests::get('http://httpbin.org/ip', array(), $options);

// See result
var_dump($request->body);
6 changes: 2 additions & 4 deletions library/Requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ protected static function get_default_options($multirequest = false) {
* @return string Default certificate path.
*/
public static function get_certificate_path() {
if ( ! empty( Requests::$certificate_path ) ) {
if (!empty(Requests::$certificate_path)) {
return Requests::$certificate_path;
}

Expand All @@ -547,7 +547,7 @@ public static function get_certificate_path() {
*
* @param string $path Certificate path, pointing to a PEM file.
*/
public static function set_certificate_path( $path ) {
public static function set_certificate_path($path) {
Requests::$certificate_path = $path;
}

Expand Down Expand Up @@ -755,8 +755,6 @@ protected static function decode_chunked($data) {
return $data;
}



$decoded = '';
$encoded = $data;

Expand Down
2 changes: 1 addition & 1 deletion library/Requests/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ interface Requests_Auth {
* @param Requests_Hooks $hooks Hook system
*/
public function register(Requests_Hooks $hooks);
}
}
2 changes: 1 addition & 1 deletion library/Requests/Auth/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ public function fsockopen_header(&$out) {
public function getAuthString() {
return $this->user . ':' . $this->pass;
}
}
}
2 changes: 1 addition & 1 deletion library/Requests/Cookie/Jar.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ public function before_redirect_check(Requests_Response $return) {
$this->cookies = array_merge($this->cookies, $cookies);
$return->cookies = $this;
}
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ public function getType() {
public function getData() {
return $this->data;
}
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ public static function get_class($code) {

return 'Requests_Exception_HTTP_Unknown';
}
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/304.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_304 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Not Modified';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/400.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_400 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Bad Request';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/401.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_401 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Unauthorized';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/402.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_402 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Payment Required';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/403.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_403 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Forbidden';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/404.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_404 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Not Found';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/405.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_405 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Method Not Allowed';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/406.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_406 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Not Acceptable';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/407.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_407 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Proxy Authentication Required';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/408.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_408 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Request Timeout';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/409.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_409 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Conflict';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/410.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_410 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Gone';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/411.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_411 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Length Required';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/412.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_412 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Precondition Failed';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/413.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_413 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Request Entity Too Large';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/414.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_414 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Request-URI Too Large';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/415.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_415 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Unsupported Media Type';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/416.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_416 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Requested Range Not Satisfiable';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/417.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_417 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Expectation Failed';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/418.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ class Requests_Exception_HTTP_418 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = "I'm A Teapot";
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/428.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ class Requests_Exception_HTTP_428 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Precondition Required';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/429.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ class Requests_Exception_HTTP_429 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Too Many Requests';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/431.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ class Requests_Exception_HTTP_431 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Request Header Fields Too Large';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/500.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_500 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Internal Server Error';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/501.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_501 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Not Implemented';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/502.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_502 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Bad Gateway';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/503.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_503 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Service Unavailable';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/504.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_504 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Gateway Timeout';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/505.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class Requests_Exception_HTTP_505 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'HTTP Version Not Supported';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/511.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ class Requests_Exception_HTTP_511 extends Requests_Exception_HTTP {
* @var string
*/
protected $reason = 'Network Authentication Required';
}
}
2 changes: 1 addition & 1 deletion library/Requests/Exception/HTTP/Unknown.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ public function __construct($reason = null, $data = null) {

parent::__construct($reason, $data);
}
}
}
2 changes: 1 addition & 1 deletion library/Requests/Hooker.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ public function register($hook, $callback, $priority = 0);
* @return boolean Successfulness
*/
public function dispatch($hook, $parameters = array());
}
}
2 changes: 1 addition & 1 deletion library/Requests/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ public function dispatch($hook, $parameters = array()) {

return true;
}
}
}
Loading