mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Fix lint
This commit is contained in:
parent
561d43baf6
commit
26a2b80b1b
6 changed files with 22 additions and 12 deletions
|
@ -39,8 +39,10 @@ class FailureRegistry {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param int $seconds
|
||||
* Returns if there was a failure within a given timeframe.
|
||||
*
|
||||
* @param string $key The cache key.
|
||||
* @param int $seconds The timeframe in seconds.
|
||||
* @return bool
|
||||
*/
|
||||
public function has_failure_in_timeframe( string $key, int $seconds ): bool {
|
||||
|
@ -56,7 +58,9 @@ class FailureRegistry {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* Registers a failure.
|
||||
*
|
||||
* @param string $key The cache key.
|
||||
* @return void
|
||||
*/
|
||||
public function add_failure( string $key ) {
|
||||
|
@ -65,7 +69,9 @@ class FailureRegistry {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* Clear a given failure.
|
||||
*
|
||||
* @param string $key The cache key.
|
||||
* @return void
|
||||
*/
|
||||
public function clear_failures( string $key ) {
|
||||
|
@ -79,9 +85,9 @@ class FailureRegistry {
|
|||
* Build cache key.
|
||||
*
|
||||
* @param string $key The cache key.
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
private function cache_key( string $key ): ?string {
|
||||
private function cache_key( string $key ): string {
|
||||
return implode( '_', array( self::CACHE_KEY, $key ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ namespace WooCommerce\PayPalCommerce\Applepay\Assets;
|
|||
|
||||
use Throwable;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\PartnersEndpoint;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\SellerStatusProduct;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\FailureRegistry;
|
||||
use WooCommerce\PayPalCommerce\Onboarding\State;
|
||||
|
|
|
@ -264,6 +264,11 @@
|
|||
<code>DAY_IN_SECONDS</code>
|
||||
</UndefinedConstant>
|
||||
</file>
|
||||
<file src="modules/ppcp-api-client/src/Helper/FailureRegistry.php">
|
||||
<UndefinedConstant occurrences="1">
|
||||
<code>DAY_IN_SECONDS</code>
|
||||
</UndefinedConstant>
|
||||
</file>
|
||||
<file src="modules/ppcp-button/services.php">
|
||||
<PossiblyFalseArgument occurrences="1">
|
||||
<code>realpath( __FILE__ )</code>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue