Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405004 )
Change subject: Fix parameters in phpDoc blocks ...................................................................... Fix parameters in phpDoc blocks Add missing parameters, correct types, add descriptions. Use @inheritdoc for overridden methods in subclasses Change-Id: Ia837c71ef914df7977d05c934e8b85e32f2b3896 --- M adyen_gateway/AdyenHostedSignature.php M adyen_gateway/FullNameWithExceptions.php M adyen_gateway/adyen.adapter.php M amazon_gateway/amazon.adapter.php M astropay_gateway/AstroPayFinancialNumbers.php M astropay_gateway/AstroPayMethodCodec.php M astropay_gateway/astropay.adapter.php M extras/custom_filters/custom_filters.body.php M gateway_common/DonationData.php M gateway_common/GatewayPage.php M gateway_common/GatewayType.php M gateway_common/StreetAddress.php M gateway_common/gateway.adapter.php M globalcollect_gateway/IngenicoMethodCodec.php M globalcollect_gateway/globalcollect.adapter.php M modules/CurrencyRatesModule.php M paypal_gateway/express_checkout/paypal_express.adapter.php M special/GatewayFormChooser.php 18 files changed, 45 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/04/405004/1 diff --git a/adyen_gateway/AdyenHostedSignature.php b/adyen_gateway/AdyenHostedSignature.php index 78fea55..8bb045a 100644 --- a/adyen_gateway/AdyenHostedSignature.php +++ b/adyen_gateway/AdyenHostedSignature.php @@ -3,6 +3,7 @@ class AdyenHostedSignature implements StagingHelper { /** * Sign the Adyen API request + * @inheritdoc */ public function stage( GatewayType $adapter, $normalized, &$stagedData ) { $params = $adapter->buildRequestParams(); diff --git a/adyen_gateway/FullNameWithExceptions.php b/adyen_gateway/FullNameWithExceptions.php index b14564c..637faca 100644 --- a/adyen_gateway/FullNameWithExceptions.php +++ b/adyen_gateway/FullNameWithExceptions.php @@ -5,6 +5,7 @@ * We're automatically filling and hiding the cardholder name box, except * for Hebrew speakers, who Amir tells us enter contact name and billing * name in different scripts. + * @inheritdoc * TODO: If anyone wants more languages on the list, make a config file */ public function stage( GatewayType $adapter, $normalized, &$stagedData ) { diff --git a/adyen_gateway/adyen.adapter.php b/adyen_gateway/adyen.adapter.php index 9a68fdb..673971f 100644 --- a/adyen_gateway/adyen.adapter.php +++ b/adyen_gateway/adyen.adapter.php @@ -159,6 +159,7 @@ /** * FIXME: I can't help but feel like it's bad that the parent's do_transaction * is never used at all. + * @inheritdoc */ function do_transaction( $transaction ) { $this->ensureUniqueOrderID(); diff --git a/amazon_gateway/amazon.adapter.php b/amazon_gateway/amazon.adapter.php index 5f4eb4c..302d31f 100644 --- a/amazon_gateway/amazon.adapter.php +++ b/amazon_gateway/amazon.adapter.php @@ -217,6 +217,8 @@ * we can check on the capture status. TODO: determine if capture status * check is really needed. According to our tech contact, Amazon guarantees * that the capture will eventually succeed if the authorization succeeds. + * @param bool $recurring whether the payment is recurring + * @throws ResponseProcessingException */ protected function authorizeAndCapturePayment( $recurring = false ) { if ( $recurring ) { @@ -381,6 +383,7 @@ /** * Replace decimal point with a dash to comply with Amazon's restrictions on * seller reference ID format. + * @inheritdoc */ public function generateOrderID( $dataObj = null ) { $dotted = parent::generateOrderID( $dataObj ); diff --git a/astropay_gateway/AstroPayFinancialNumbers.php b/astropay_gateway/AstroPayFinancialNumbers.php index babc1ed..0fde4c9 100644 --- a/astropay_gateway/AstroPayFinancialNumbers.php +++ b/astropay_gateway/AstroPayFinancialNumbers.php @@ -9,6 +9,7 @@ /** * They need a 20 char string for a customer ID - give them the first 20 * characters of the email address for easy lookup + * @inheritdoc */ protected function stage_donor_id( GatewayType $adapter, $normalized, &$stagedData ) { if ( !isset( $stagedData['email'] ) ) { diff --git a/astropay_gateway/AstroPayMethodCodec.php b/astropay_gateway/AstroPayMethodCodec.php index a064443..f2182c3 100644 --- a/astropay_gateway/AstroPayMethodCodec.php +++ b/astropay_gateway/AstroPayMethodCodec.php @@ -3,6 +3,7 @@ class AstroPayMethodCodec implements UnstagingHelper { /** * Transforms the astropay payment method into our method name + * @inheritdoc */ public function unstage( GatewayType $adapter, $stagedData, &$unstagedData ) { $method = $stagedData['payment_method']; diff --git a/astropay_gateway/astropay.adapter.php b/astropay_gateway/astropay.adapter.php index 1f747f1..5d5733c 100644 --- a/astropay_gateway/astropay.adapter.php +++ b/astropay_gateway/astropay.adapter.php @@ -215,7 +215,7 @@ /** * Overriding parent method to add fiscal number - * @return array of required field names + * @inheritdoc */ public function getRequiredFields( $knownData = null ) { $fields = parent::getRequiredFields( $knownData ); diff --git a/extras/custom_filters/custom_filters.body.php b/extras/custom_filters/custom_filters.body.php index 2951038..69b9fce 100644 --- a/extras/custom_filters/custom_filters.body.php +++ b/extras/custom_filters/custom_filters.body.php @@ -72,7 +72,9 @@ } /** - * @throws InvalidArgumentException + * Add a component to the array of risk scores + * @param float $score Score calculated by the indicated filter + * @param string $source Name of the risk filter */ public function addRiskScore( $score, $source ) { if ( !is_numeric( $score ) ) { diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php index 39d1828..d5bb120 100644 --- a/gateway_common/DonationData.php +++ b/gateway_common/DonationData.php @@ -107,7 +107,7 @@ /** * DonationData constructor - * @param GatewayAdapter $gateway + * @param GatewayType $gateway * @param mixed $data An optional array of donation data that will, if * present, circumvent the usual process of gathering the data from various * places in the request, or 'false' to gather the data the usual way. diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php index 30dcd1a..00a59db 100644 --- a/gateway_common/GatewayPage.php +++ b/gateway_common/GatewayPage.php @@ -478,6 +478,8 @@ /** * Take UI action suggested by the payment result + * @param PaymentResult $result returned by gateway adapter's doPayment + * or processDonorReturn function */ protected function renderResponse( PaymentResult $result ) { if ( $result->isFailed() ) { diff --git a/gateway_common/GatewayType.php b/gateway_common/GatewayType.php index b5226f9..24c2253 100644 --- a/gateway_common/GatewayType.php +++ b/gateway_common/GatewayType.php @@ -165,6 +165,8 @@ * (probably with $this->addRequestData()). * DO NOT set default payment information here (or anywhere, really). * That would be naughty. + * @param array $options associative array of values as given to the + * GateWayType constructor. */ function setGatewayDefaults( $options = array() ); @@ -348,8 +350,9 @@ public function addStandardMessageFields( $transaction ); /** - * returns information about how to manage the Order ID - * @param string $key The key to retrieve. Optional. + * Returns information about how to manage the Order ID, either a specific + * value or the whole associative array. + * @param string|false $key The key to retrieve. Optional. * @return mixed|false Data requested, or false if it is not set. */ function getOrderIDMeta( $key = false ); diff --git a/gateway_common/StreetAddress.php b/gateway_common/StreetAddress.php index b35b499..0e9657f 100644 --- a/gateway_common/StreetAddress.php +++ b/gateway_common/StreetAddress.php @@ -19,6 +19,8 @@ * * The zero is intentional: Allegedly, Some banks won't perform the check * if the address line contains no numerical data. + * @param array $normalized data from gateway adapter + * @return string */ protected function stage_street( $normalized ) { $street = ''; @@ -39,6 +41,8 @@ * * In the event that there isn't anything in there, we need to send * something along so that AVS checks get triggered at all. + * @param array $normalized all data from gateway adapter + * @return string */ protected function stage_postal_code( $normalized ) { $postalCode = ''; diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index 7c9a124..8558201 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -758,10 +758,12 @@ /** * Builds a set of transaction data in XML format - * *)The current transaction must be set before you call this function. - * *)(eventually) uses getTransactionSpecificValue to assign staged + * *)The current transaction must be set before you call this function. + * *)(eventually) uses getTransactionSpecificValue to assign staged * values to the fields required by the gateway. Look there for more insight * into the heirarchy of all possible data sources. + * @param string $rootElement Name of root element + * @param string $encoding Character set to use for tag values * @return string The raw transaction in xml format, ready to be * curl'd off to the remote server. */ @@ -1492,6 +1494,7 @@ /** * Check the response for general sanity - e.g. correct data format, keys exists + * @param mixed $response Whatever came back from the API call * @return bool true if response looks sane */ protected function parseResponseCommunicationStatus( $response ) { @@ -1500,6 +1503,7 @@ /** * Parse the response to get the errors in a format we can log and otherwise deal with. + * @param mixed $response Whatever came back from the API call * @return array a key/value array of codes (if they exist) and messages. * TODO: Move to a parsing class, where these are part of an interface * rather than empty although non-abstract. @@ -1510,6 +1514,7 @@ /** * Harvest the data we need back from the gateway. + * @param mixed $response Whatever came back from the API call * @return array a key/value array */ protected function parseResponseData( $response ) { @@ -2091,6 +2096,7 @@ /** * Build and send a message to the payments-init queue, once the initial workflow is complete. + * @param string $status one of the constants in @see SmashPig\CrmLink\FinalStatus */ public function sendFinalStatusMessage( $status ) { $transaction = array( diff --git a/globalcollect_gateway/IngenicoMethodCodec.php b/globalcollect_gateway/IngenicoMethodCodec.php index 88a1fe2..bdf07e8 100644 --- a/globalcollect_gateway/IngenicoMethodCodec.php +++ b/globalcollect_gateway/IngenicoMethodCodec.php @@ -7,7 +7,8 @@ /** * Stage: payment_product and a few minor tweaks * Stages the payment product ID for GC. - * Not what I had in mind to begin with, but this *completely* blew up. + * Not what I had in mind to begin with, but this *completely* blew up.\ + * @inheritdoc */ public function stage( GatewayType $adapter, $normalized, &$stagedData ) { $logger = DonationLoggerFactory::getLogger( $adapter ); diff --git a/globalcollect_gateway/globalcollect.adapter.php b/globalcollect_gateway/globalcollect.adapter.php index 7059d6e..8c6a1d9 100644 --- a/globalcollect_gateway/globalcollect.adapter.php +++ b/globalcollect_gateway/globalcollect.adapter.php @@ -35,6 +35,8 @@ * Add a key to the transaction INSERT_ORDERWITHPAYMENT. * * $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS'][$section][] = $value + * @param string $value the default value to add to the structure + * @param string $section the key name */ protected function addKeyToTransaction( $value, $section = 'PAYMENT' ) { if ( !in_array( $value, $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS'][$section] ) ) { @@ -593,7 +595,7 @@ * Because GC has some processes that involve more than one do_transaction * chained together, we're catching those special ones in an overload and * letting the rest behave normally. - * @return PaymentTransactionResponse + * @inheritdoc */ public function do_transaction( $transaction ) { $this->session_addDonorData(); @@ -1509,7 +1511,7 @@ /** * OUR language codes which are available to use in GlobalCollect. - * @return string + * @return array */ public function getAvailableLanguages() { $languages = array( @@ -1670,6 +1672,7 @@ /** * Add keys to transaction for submethod * TODO: Candidate for pushing to the base class. + * @param string $payment_submethod our code for the payment submethod */ protected function addKeysToTransactionForSubmethod( $payment_submethod ) { // If there are no keys to add, do not proceed. diff --git a/modules/CurrencyRatesModule.php b/modules/CurrencyRatesModule.php index a133c6c..b8d6565 100644 --- a/modules/CurrencyRatesModule.php +++ b/modules/CurrencyRatesModule.php @@ -8,6 +8,7 @@ /** * @see ResourceLoaderModule::getScript() + * @inheritdoc */ public function getScript( ResourceLoaderContext $context ) { return diff --git a/paypal_gateway/express_checkout/paypal_express.adapter.php b/paypal_gateway/express_checkout/paypal_express.adapter.php index 3565b03..c4658ac 100644 --- a/paypal_gateway/express_checkout/paypal_express.adapter.php +++ b/paypal_gateway/express_checkout/paypal_express.adapter.php @@ -590,6 +590,7 @@ * Shared snippet to parse the ACK response field and store it as * communication status. * + * @param array $response The response from the PayPal API call * @throws ResponseProcessingException */ protected function checkResponseAck( $response ) { diff --git a/special/GatewayFormChooser.php b/special/GatewayFormChooser.php index 5b323ed..1ac61fa 100644 --- a/special/GatewayFormChooser.php +++ b/special/GatewayFormChooser.php @@ -357,9 +357,10 @@ } /** - * - * @param string $form_key - * @return bool + * Is the given country supported by the given form + * @param string $country_iso All-caps ISO 3166-1 alpha-2 + * @param string $form_key Name of form + * @return bool true if the country is supported */ static function isSupportedCountry( $country_iso, $form_key ) { static $countries = array(); -- To view, visit https://gerrit.wikimedia.org/r/405004 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia837c71ef914df7977d05c934e8b85e32f2b3896 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Ejegg <ej...@ejegg.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits