Ejegg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/272833
Change subject: Rename config's 'obj' function to 'object'
......................................................................
Rename config's 'obj' function to 'object'
We don't abbreviate object anyplace else.
Old name invited errors like this:
config()->obj( 'data-store/blah' )->addObj( $message );
Change-Id: I95f35fc36ce6f233f4cdc2a2219626d59cadddec
---
M Core/Configuration.php
M Core/Http/RequestHandler.php
M Core/Listeners/ListenerBase.php
M Core/Logging/Logger.php
M Maintenance/TestDatastore.php
M PaymentProviders/Adyen/Actions/CaptureResponseAction.php
M PaymentProviders/Adyen/Actions/PaymentCaptureAction.php
M PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php
M PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
M PaymentProviders/Adyen/Jobs/RecordCaptureJob.php
M PaymentProviders/Amazon/Actions/AddMessageToQueue.php
M PaymentProviders/Amazon/Actions/CloseOrderReference.php
M PaymentProviders/Amazon/AmazonApi.php
M PaymentProviders/Amazon/Audit/ReportDownloader.php
M PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
M PaymentProviders/AstroPay/Actions/IncomingMessage.php
M PaymentProviders/GlobalCollect/Actions/IncomingMessage.php
17 files changed, 22 insertions(+), 22 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig
refs/changes/33/272833/1
diff --git a/Core/Configuration.php b/Core/Configuration.php
index 9f865c1..5a90727 100644
--- a/Core/Configuration.php
+++ b/Core/Configuration.php
@@ -224,7 +224,7 @@
* value is contained under additional keys.
* @param bool $persistent If true the object is saved for future
calls.
*/
- public function &obj( $node, $persistent = true ) {
+ public function &object( $node, $persistent = true ) {
// First look and see if we already have a $persistent object.
if ( array_key_exists( $node, $this->objects ) ) {
return $this->objects[ $node ];
diff --git a/Core/Http/RequestHandler.php b/Core/Http/RequestHandler.php
index e56d3fa..4dbb0b0 100644
--- a/Core/Http/RequestHandler.php
+++ b/Core/Http/RequestHandler.php
@@ -97,7 +97,7 @@
}
// --- Actually get the endpoint object and start the request
---
- $endpointObj = $config->obj( "endpoints/$action" );
+ $endpointObj = $config->object( "endpoints/$action" );
if ( $endpointObj instanceof IHttpActionHandler ) {
$endpointObj->execute( $request, $response, $parts );
} else {
diff --git a/Core/Listeners/ListenerBase.php b/Core/Listeners/ListenerBase.php
index fffa26a..a995eb8 100644
--- a/Core/Listeners/ListenerBase.php
+++ b/Core/Listeners/ListenerBase.php
@@ -25,7 +25,7 @@
public function __construct() {
$this->c = Context::get()->getConfiguration();
- $this->inflightStore = $this->c->obj( 'data-store/inflight' );
+ $this->inflightStore = $this->c->object( 'data-store/inflight'
);
}
public function execute( Request $request, Response $response,
$pathParts ) {
diff --git a/Core/Logging/Logger.php b/Core/Logging/Logger.php
index 155860e..4877053 100644
--- a/Core/Logging/Logger.php
+++ b/Core/Logging/Logger.php
@@ -35,7 +35,7 @@
$streams = $config->val( 'logging/enabled-log-streams'
);
foreach ( $streams as $streamName ) {
- $streamObjs[] = $config->obj(
"logging/log-streams/$streamName", false );
+ $streamObjs[] = $config->object(
"logging/log-streams/$streamName", false );
}
} catch ( \Exception $ex ) {
diff --git a/Maintenance/TestDatastore.php b/Maintenance/TestDatastore.php
index c6c992a..6f5c748 100644
--- a/Maintenance/TestDatastore.php
+++ b/Maintenance/TestDatastore.php
@@ -32,7 +32,7 @@
* Do the actual work of the script.
*/
public function execute() {
- $this->datastore = Context::get()->getConfiguration()->obj(
+ $this->datastore = Context::get()->getConfiguration()->object(
'data-store/' . $this->getArgument( 0, 'test' ),
false
);
@@ -51,7 +51,7 @@
shuffle( $this->testObjects );
// Now attempt to find them and their pairs!
- $this->datastore = Context::get()->getConfiguration()->obj(
+ $this->datastore = Context::get()->getConfiguration()->object(
'data-store/' . $this->getArgument( 0, 'test' ),
false
);
diff --git a/PaymentProviders/Adyen/Actions/CaptureResponseAction.php
b/PaymentProviders/Adyen/Actions/CaptureResponseAction.php
index 7bb40be..404d6b4 100644
--- a/PaymentProviders/Adyen/Actions/CaptureResponseAction.php
+++ b/PaymentProviders/Adyen/Actions/CaptureResponseAction.php
@@ -19,7 +19,7 @@
if ( $msg instanceof Capture ) {
if ( $msg->success ) {
$recordJob = RecordCaptureJob::factory( $msg );
- $jobQueue =
Configuration::getDefaultConfig()->obj( 'data-store/jobs' );
+ $jobQueue =
Configuration::getDefaultConfig()->object( 'data-store/jobs' );
$jobQueue->addObject( $recordJob );
} else {
$tl->warning(
@@ -31,4 +31,4 @@
return true;
}
-}
\ No newline at end of file
+}
diff --git a/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php
b/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php
index 173be04..088b0df 100644
--- a/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php
+++ b/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php
@@ -23,7 +23,7 @@
$tl->info(
"Adding Adyen capture job for
{$msg->currency} {$msg->amount} with id {$msg->correlationId} and psp reference
{$msg->pspReference}."
);
- $jobQueueObj =
Context::get()->getConfiguration()->obj( 'data-store/jobs' );
+ $jobQueueObj =
Context::get()->getConfiguration()->object( 'data-store/jobs' );
$jobQueueObj->addObject(
ProcessCaptureRequestJob::factory( $msg
)
);
@@ -34,7 +34,7 @@
"Adyen payment with correlation id
{$msg->correlationId} reported status failed: '{$msg->reason}'. Deleting
orphans."
);
$tl->debug( "Deleting all queue objects with
correlation ID '{$msg->correlationId}'" );
- $pendingQueueObj =
Context::get()->getConfiguration()->obj( 'data-store/pending' );
+ $pendingQueueObj =
Context::get()->getConfiguration()->object( 'data-store/pending' );
$pendingQueueObj->removeObjectsById(
$msg->correlationId );
}
}
diff --git a/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php
b/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php
index d9996e4..4c4f2d6 100644
--- a/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php
+++ b/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php
@@ -20,7 +20,7 @@
$this->reason
);
- $jobQueueObj = Context::get()->getConfiguration()->obj(
'data-store/jobs' );
+ $jobQueueObj = Context::get()->getConfiguration()->object(
'data-store/jobs' );
if ( strpos( $this->pspReference, 'settlement_detail_report' )
=== 0 ) {
$jobQueueObj->addObject(
DownloadReportJob::factory(
diff --git a/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
b/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
index b2af546..57b84aa 100644
--- a/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
+++ b/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
@@ -53,7 +53,7 @@
// we need to check $capture_requested in case we have
requested a capture
// but have not yet received notification of capture success.
Logger::debug( 'Attempting to locate associated message in
pending queue.' );
- $pendingQueue = Configuration::getDefaultConfig()->obj(
'data-store/pending' );
+ $pendingQueue = Configuration::getDefaultConfig()->object(
'data-store/pending' );
$queueMessage = $pendingQueue->queueGetObject( null,
$this->correlationId );
$success = true;
@@ -150,6 +150,6 @@
$queueMessage, $this->merchantReference, $riskScore,
$scoreBreakdown, $action
);
Logger::debug( "Sending antifraud message with risk score
$riskScore and action $action." );
- Configuration::getDefaultConfig()->obj( 'data-store/antifraud'
)->addObject( $antifraudMessage );
+ Configuration::getDefaultConfig()->object(
'data-store/antifraud' )->addObject( $antifraudMessage );
}
}
diff --git a/PaymentProviders/Adyen/Jobs/RecordCaptureJob.php
b/PaymentProviders/Adyen/Jobs/RecordCaptureJob.php
index f99bce4..65a97e4 100644
--- a/PaymentProviders/Adyen/Jobs/RecordCaptureJob.php
+++ b/PaymentProviders/Adyen/Jobs/RecordCaptureJob.php
@@ -43,7 +43,7 @@
$config = Configuration::getDefaultConfig();
// Find the details from the payment site in the pending queue.
Logger::debug( 'Attempting to locate associated message in
pending queue' );
- $pendingQueue = $config->obj( 'data-store/pending' );
+ $pendingQueue = $config->object( 'data-store/pending' );
$queueMessage = $pendingQueue->queueGetObject( null,
$this->correlationId );
if ( $queueMessage && ( $queueMessage instanceof
DonationInterfaceMessage ) ) {
@@ -51,7 +51,7 @@
// Add the gateway transaction ID and send it to the
completed queue
$queueMessage->gateway_txn_id = $this->pspReference;
- $config->obj( 'data-store/verified' )->addObject(
$queueMessage );
+ $config->object( 'data-store/verified' )->addObject(
$queueMessage );
// Remove it from the pending queue
Logger::debug( "Removing all references to donation in
pending queue" );
diff --git a/PaymentProviders/Amazon/Actions/AddMessageToQueue.php
b/PaymentProviders/Amazon/Actions/AddMessageToQueue.php
index 697934e..f392324 100644
--- a/PaymentProviders/Amazon/Actions/AddMessageToQueue.php
+++ b/PaymentProviders/Amazon/Actions/AddMessageToQueue.php
@@ -11,7 +11,7 @@
$destinationQueue = $msg->getDestinationQueue();
if ( $destinationQueue ) {
- $queue = Context::get()->getConfiguration()->obj(
"data-store/{$destinationQueue}" );
+ $queue = Context::get()->getConfiguration()->object(
"data-store/{$destinationQueue}" );
$queueMsg = $msg->normalizeForQueue();
$queue->addObject( $queueMsg );
diff --git a/PaymentProviders/Amazon/Actions/CloseOrderReference.php
b/PaymentProviders/Amazon/Actions/CloseOrderReference.php
index 1eecdb0..34acd0e 100644
--- a/PaymentProviders/Amazon/Actions/CloseOrderReference.php
+++ b/PaymentProviders/Amazon/Actions/CloseOrderReference.php
@@ -15,7 +15,7 @@
}
$config = Context::get()->getConfiguration();
- $client = $config->obj( 'payments-client', true );
+ $client = $config->object( 'payments-client', true );
$captureId = $msg->getGatewayTransactionId();
$orderReferenceId = substr( $captureId, 0, 19 );
diff --git a/PaymentProviders/Amazon/AmazonApi.php
b/PaymentProviders/Amazon/AmazonApi.php
index 10bbc38..e7411b3 100644
--- a/PaymentProviders/Amazon/AmazonApi.php
+++ b/PaymentProviders/Amazon/AmazonApi.php
@@ -16,7 +16,7 @@
public static function findRefundParentId( $refundId ) {
$config = Context::get()->getConfiguration();
- $client = $config->obj( 'payments-client', true );
+ $client = $config->object( 'payments-client', true );
// The order reference ID is the first 19 characters of the
refund ID
$orderReferenceId = substr( $refundId, 0, 19 );
diff --git a/PaymentProviders/Amazon/Audit/ReportDownloader.php
b/PaymentProviders/Amazon/Audit/ReportDownloader.php
index d4459b0..51dc8ca 100644
--- a/PaymentProviders/Amazon/Audit/ReportDownloader.php
+++ b/PaymentProviders/Amazon/Audit/ReportDownloader.php
@@ -55,7 +55,7 @@
$this->ensureAndScanFolder( $this->downloadPath );
$this->reportsClient =
- Context::get()->getConfiguration()->obj(
'reports-client', true );
+ Context::get()->getConfiguration()->object(
'reports-client', true );
Logger::info( 'Getting report list' );
$startDate = new DateTime( "-{$this->days} days", new
DateTimeZone( 'UTC' ) );
diff --git a/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
b/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
index 948f08d..9f908f1 100644
--- a/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
+++ b/PaymentProviders/Amazon/Tests/phpunit/ApiTest.php
@@ -17,7 +17,7 @@
true
);
Context::init( $config );
- $this->mockClient = Context::get()->getConfiguration()->obj(
'payments-client', true );
+ $this->mockClient = Context::get()->getConfiguration()->object(
'payments-client', true );
$this->mockClient->calls = array();
$this->mockClient->returns = array();
$this->mockClient->exceptions = array();
diff --git a/PaymentProviders/AstroPay/Actions/IncomingMessage.php
b/PaymentProviders/AstroPay/Actions/IncomingMessage.php
index 9e18a67..d181627 100644
--- a/PaymentProviders/AstroPay/Actions/IncomingMessage.php
+++ b/PaymentProviders/AstroPay/Actions/IncomingMessage.php
@@ -11,7 +11,7 @@
$destinationQueue = $msg->getDestinationQueue();
if ( $destinationQueue ) {
- $queue = Context::get()->getConfiguration()->obj(
"data-store/{$destinationQueue}" );
+ $queue = Context::get()->getConfiguration()->object(
"data-store/{$destinationQueue}" );
$queueMsg = $msg->normalizeForQueue();
$queue->addObject( $queueMsg );
diff --git a/PaymentProviders/GlobalCollect/Actions/IncomingMessage.php
b/PaymentProviders/GlobalCollect/Actions/IncomingMessage.php
index 6aa9885..8637c3f 100644
--- a/PaymentProviders/GlobalCollect/Actions/IncomingMessage.php
+++ b/PaymentProviders/GlobalCollect/Actions/IncomingMessage.php
@@ -10,7 +10,7 @@
$destinationQueue = $msg->getDestinationQueue();
if ( $destinationQueue ) {
- $queue = Context::get()->getConfiguration()->obj(
"data-store/{$destinationQueue}" );
+ $queue = Context::get()->getConfiguration()->object(
"data-store/{$destinationQueue}" );
$queueMsg = $msg->normalizeForQueue();
$queue->addObject( $queueMsg );
--
To view, visit https://gerrit.wikimedia.org/r/272833
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I95f35fc36ce6f233f4cdc2a2219626d59cadddec
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits