Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| SwiftFileOpHandle | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * OpenStack Swift based file backend. |
| 4 | * |
| 5 | * @license GPL-2.0-or-later |
| 6 | * @file |
| 7 | * @ingroup FileBackend |
| 8 | * @author Russ Nelson |
| 9 | */ |
| 10 | |
| 11 | namespace Wikimedia\FileBackend\FileOpHandle; |
| 12 | |
| 13 | use Closure; |
| 14 | use Wikimedia\FileBackend\SwiftFileBackend; |
| 15 | |
| 16 | class SwiftFileOpHandle extends FileBackendStoreOpHandle { |
| 17 | /** @var array[] List of HTTP request maps for SwiftFileBackend::requestWithAuth */ |
| 18 | public $httpOp; |
| 19 | /** @var Closure Function to run after each HTTP request finishes */ |
| 20 | public $callback; |
| 21 | |
| 22 | /** @var int Class CONTINUE_* constant */ |
| 23 | public $state = self::CONTINUE_IF_OK; |
| 24 | |
| 25 | /** @var int Continue with the next requests stages if no errors occurred */ |
| 26 | public const CONTINUE_IF_OK = 0; |
| 27 | /** @var int Cancel the next requests stages */ |
| 28 | public const CONTINUE_NO = 1; |
| 29 | |
| 30 | /** |
| 31 | * Construct a handle to be use with SwiftFileOpHandle::doExecuteOpHandlesInternal() |
| 32 | * |
| 33 | * The callback returns a class CONTINUE_* constant and takes the following parameters: |
| 34 | * - An HTTP request map array with 'response' filled |
| 35 | * - A StatusValue instance to be updated as needed |
| 36 | * |
| 37 | * @param SwiftFileBackend $backend |
| 38 | * @param Closure $callback |
| 39 | * @param array $httpOp Request to send via SwiftFileBackend::requestWithAuth() |
| 40 | */ |
| 41 | public function __construct( SwiftFileBackend $backend, Closure $callback, array $httpOp ) { |
| 42 | $this->backend = $backend; |
| 43 | $this->callback = $callback; |
| 44 | $this->httpOp = $httpOp; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | /** @deprecated class alias since 1.43 */ |
| 49 | class_alias( SwiftFileOpHandle::class, 'SwiftFileOpHandle' ); |