Skip to content

Commit 6299b87

Browse files
committed
Remove trailing whitespace from files
1 parent 4725dff commit 6299b87

14 files changed

+130
-133
lines changed

Diff for: DEVELOPMENT.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Goals
22

3-
API stability is the primary goal. Users should upgrade from the first released version and their code should work without any issues. Unit tests are present to ensure this.
3+
API stability is the primary goal. Users should upgrade from the first released version and their code should work without any issues. Unit tests are present to ensure this.
44

55
Good documentation is a secondary goal. Every class and method needs to be commented with a [PHPDocumentor](http://www.phpdoc.org/docs/latest/guides/docblocks.html) header.
66

@@ -17,4 +17,3 @@ TLDR: The pace of development is slow. Problems? Do it yourself and submit a pul
1717
* All pull requests are tested for overall code quality and passing existing unit tests. Because of the amount of work required for this, pull requests are merged rarely, in batches, 1-3 times a year.
1818
* Issues asking for new features will not be implemented. [Paid support](https://massivescale.net/contact.html) is available if you want something developed, or do it yourself and submit a pull request.
1919
* Issues reporting non-critical bugs may be fixed if the author has enough free time, which happens rarely. [Paid support](https://massivescale.net/contact.html) is available, the author has plenty of work time. Pull requests implementing these are welcome too.
20-

Diff for: LICENSE

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Copyright (c) 2012, GDR!
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without
7-
modification, are permitted provided that the following conditions are met:
7+
modification, are permitted provided that the following conditions are met:
88

99
1. Redistributions of source code must retain the above copyright notice, this
10-
list of conditions and the following disclaimer.
10+
list of conditions and the following disclaimer.
1111
2. Redistributions in binary form must reproduce the above copyright notice,
1212
this list of conditions and the following disclaimer in the documentation
13-
and/or other materials provided with the distribution.
13+
and/or other materials provided with the distribution.
1414

1515
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1616
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -24,5 +24,5 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2424
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525

2626
The views and conclusions contained in the software and documentation are those
27-
of the authors and should not be interpreted as representing official policies,
28-
either expressed or implied, of the FreeBSD Project.
27+
of the authors and should not be interpreted as representing official policies,
28+
either expressed or implied, of the FreeBSD Project.

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ Last Celery version tested is 3.1.19
1616

1717
[API documentation](https://massivescale.net/celery-php/li_celery-php.html)
1818

19-
## POSTING TASKS
19+
## POSTING TASKS
2020

2121
$c = new Celery('localhost', 'myuser', 'mypass', 'myvhost');
2222
$result = $c->PostTask('tasks.add', array(2,2));
23-
23+
2424
// The results are serializable so you can do the following:
2525
$_SESSION['celery_result'] = $result;
2626
// and use this variable in an AJAX call or whatever
27-
27+
2828
_tip: if using RabbitMQ guest user, set "/" vhost_
2929

3030
## READING ASYNC RESULTS
@@ -92,7 +92,7 @@ Refer to files in testscenario/ for examples of celeryconfig.py.
9292

9393
$c = new Celery(
9494
'localhost', /* Server */
95-
'', /* Login */
95+
'', /* Login */
9696
'test', /* Password */
9797
'wutka', /* vhost */
9898
'celery', /* exchange */

Diff for: amqp.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static function GetBestInstalledExtensionName($ssl = false)
9898
* @return object
9999
*/
100100
abstract function GetConnectionObject($details); // details = array
101-
101+
102102
/**
103103
* Initialize connection on a given connection object
104104
* @return NULL

Diff for: amqplibconnector.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
*
77
* Copyright (c) 2014, GDR!
88
* All rights reserved.
9-
*
9+
*
1010
* Redistribution and use in source and binary forms, with or without
11-
* modification, are permitted provided that the following conditions are met:
12-
*
11+
* modification, are permitted provided that the following conditions are met:
12+
*
1313
* 1. Redistributions of source code must retain the above copyright notice, this
14-
* list of conditions and the following disclaimer.
14+
* list of conditions and the following disclaimer.
1515
* 2. Redistributions in binary form must reproduce the above copyright notice,
1616
* this list of conditions and the following disclaimer in the documentation
17-
* and/or other materials provided with the distribution.
18-
*
17+
* and/or other materials provided with the distribution.
18+
*
1919
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
2020
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2121
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -26,10 +26,10 @@
2626
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2727
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2828
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29-
*
29+
*
3030
* The views and conclusions contained in the software and documentation are those
31-
* of the authors and should not be interpreted as representing official policies,
32-
* either expressed or implied, of the FreeBSD Project.
31+
* of the authors and should not be interpreted as representing official policies,
32+
* either expressed or implied, of the FreeBSD Project.
3333
*
3434
* @link http://massivescale.net/
3535
* @link http://gdr.geekhood.net/
@@ -52,8 +52,8 @@
5252
*/
5353
class AMQPLibConnector extends AbstractAMQPConnector
5454
{
55-
/**
56-
* How long (in seconds) to wait for a message from queue
55+
/**
56+
* How long (in seconds) to wait for a message from queue
5757
* Sadly, this can't be set to zero to achieve complete asynchronity
5858
*/
5959
public $wait_timeout = 0.1;
@@ -120,7 +120,7 @@ function PostToExchange($connection, $details, $task, $params)
120120

121121
/* Satisfy Celery::PostTask() error checking */
122122
/* TODO: catch some exceptions? Which ones? */
123-
return TRUE;
123+
return TRUE;
124124
}
125125

126126
/**

Diff for: amqppeclconnector.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function GetMessageBody($connection, $task_id, $removeMessageFromQueue = true)
8585

8686
$message = $q->get(AMQP_AUTOACK);
8787

88-
if(!$message)
88+
if(!$message)
8989
{
9090
if ($removeMessageFromQueue) {
9191
$q->delete();
@@ -101,8 +101,8 @@ function GetMessageBody($connection, $task_id, $removeMessageFromQueue = true)
101101
}
102102
$connection->disconnect();
103103

104-
throw new CeleryException('Response was not encoded using JSON - found ' .
105-
$message->getContentType().
104+
throw new CeleryException('Response was not encoded using JSON - found ' .
105+
$message->getContentType().
106106
' - check your CELERY_RESULT_SERIALIZER setting!');
107107
}
108108

Diff for: celery.php

+26-27
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
*
88
* Copyright (c) 2012, GDR!
99
* All rights reserved.
10-
*
10+
*
1111
* Redistribution and use in source and binary forms, with or without
12-
* modification, are permitted provided that the following conditions are met:
13-
*
12+
* modification, are permitted provided that the following conditions are met:
13+
*
1414
* 1. Redistributions of source code must retain the above copyright notice, this
15-
* list of conditions and the following disclaimer.
15+
* list of conditions and the following disclaimer.
1616
* 2. Redistributions in binary form must reproduce the above copyright notice,
1717
* this list of conditions and the following disclaimer in the documentation
18-
* and/or other materials provided with the distribution.
19-
*
18+
* and/or other materials provided with the distribution.
19+
*
2020
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
2121
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2222
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -27,10 +27,10 @@
2727
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2828
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2929
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30-
*
30+
*
3131
* The views and conclusions contained in the software and documentation are those
32-
* of the authors and should not be interpreted as representing official policies,
33-
* either expressed or implied, of the FreeBSD Project.
32+
* of the authors and should not be interpreted as representing official policies,
33+
* either expressed or implied, of the FreeBSD Project.
3434
*
3535
* @link http://massivescale.net/
3636
* @link http://gdr.geekhood.net/
@@ -68,7 +68,7 @@ class CeleryPublishException extends CeleryException {};
6868
* Use this class if you don't know what the above means
6969
* @package celery-php
7070
*/
71-
class Celery extends CeleryAbstract
71+
class Celery extends CeleryAbstract
7272
{
7373
/**
7474
* @param string host
@@ -109,16 +109,16 @@ function __construct($host, $login, $password, $vhost, $exchange='celery', $bind
109109
* Client for a Celery server - with a constructor supporting separate backend queue
110110
* @package celery-php
111111
*/
112-
class CeleryAdvanced extends CeleryAbstract
112+
class CeleryAdvanced extends CeleryAbstract
113113
{
114114
/**
115115
* @param array broker_connection - array for connecting to task queue, see Celery class above for supported keys
116116
* @param array backend_connection - array for connecting to result backend, see Celery class above for supported keys
117117
*/
118-
function __construct($broker_connection, $backend_connection=false)
118+
function __construct($broker_connection, $backend_connection=false)
119119
{
120-
if($backend_connection == false)
121-
{
120+
if($backend_connection == false)
121+
{
122122
$backend_connection = $broker_connection;
123123
}
124124

@@ -222,9 +222,9 @@ function PostTask($task, $args, $async_result=true,$routing_key="celery", $task_
222222
$kwargs = $args;
223223
$args = array();
224224
}
225-
226-
/*
227-
* $task_args may contain additional arguments such as eta which are useful in task execution
225+
226+
/*
227+
* $task_args may contain additional arguments such as eta which are useful in task execution
228228
* The usecase of this field is as follows:
229229
* $task_args = array( 'eta' => "2014-12-02T16:00:00" );
230230
*/
@@ -237,7 +237,7 @@ function PostTask($task, $args, $async_result=true,$routing_key="celery", $task_
237237
),
238238
$task_args
239239
);
240-
240+
241241
$task = json_encode($task_array);
242242
$params = array('content_type' => 'application/json',
243243
'content_encoding' => 'UTF-8',
@@ -263,11 +263,11 @@ function PostTask($task, $args, $async_result=true,$routing_key="celery", $task_
263263
throw new CeleryPublishException();
264264
}
265265

266-
if($async_result)
266+
if($async_result)
267267
{
268268
return new AsyncResult($id, $this->backend_connection_details, $task_array['task'], $args);
269-
}
270-
else
269+
}
270+
else
271271
{
272272
return true;
273273
}
@@ -306,7 +306,7 @@ public function getAsyncResultMessage($taskName, $taskId, $args = null, $removeM
306306
* Asynchronous result of Celery task
307307
* @package celery-php
308308
*/
309-
class AsyncResult
309+
class AsyncResult
310310
{
311311
private $task_id; // string, queue name
312312
private $connection; // AMQPConnection instance
@@ -352,7 +352,7 @@ private function getCompleteResult()
352352
}
353353

354354
$message = $this->amqp->GetMessageBody($this->connection, $this->task_id,$this->connection_details['result_expire'], true);
355-
355+
356356
if($message !== false)
357357
{
358358
$this->complete_result = $message['complete_result'];
@@ -365,12 +365,12 @@ private function getCompleteResult()
365365
}
366366

367367
/**
368-
* Helper function to return current microseconds time as float
368+
* Helper function to return current microseconds time as float
369369
*/
370370
static private function getmicrotime()
371371
{
372372
list($usec, $sec) = explode(" ",microtime());
373-
return ((float)$usec + (float)$sec);
373+
return ((float)$usec + (float)$sec);
374374
}
375375

376376
/**
@@ -499,7 +499,7 @@ function get($timeout=10, $propagate=TRUE, $interval=0.5)
499499
public function __get($property)
500500
{
501501
/**
502-
* When the task has been executed, this contains the return value.
502+
* When the task has been executed, this contains the return value.
503503
* If the task raised an exception, this will be the exception instance.
504504
*/
505505
if($property == 'result')
@@ -583,4 +583,3 @@ function wait($timeout=10, $propagate=TRUE, $interval=0.5)
583583
return $this->get($timeout, $propagate, $interval);
584584
}
585585
}
586-

0 commit comments

Comments
 (0)