Skip to content

Commit

Permalink
Fix phpcs errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Escalante Álvarez committed Jun 6, 2024
1 parent 4effc01 commit d60421a
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: docker run --rm -v "$(pwd)":/app -w /app composer:latest composer install

- name: PHP_CodeSniffer
run: docker run --rm -v "$(pwd)":/app -w /app php:7.2-cli-alpine php vendor/bin/phpcs --standard=.phpcs.xml.dist .
run: docker run --rm -v "$(pwd)":/app -w /app php:7.2-cli-alpine php vendor/bin/phpcs --standard=.phpcs.xml.dist --warning-severity=0 . # Ignore Warnings for now...

# - name: PHPStan
# run: docker run --rm -v "$(pwd)":/app -w /app php:7.2-cli-alpine php vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=512M
Expand Down
15 changes: 9 additions & 6 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,31 @@
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->
<!-- Rules: Check PHP version compatibility -->
<config name="testVersion" value="7.2-"/>
<!-- <rule ref="PHPCompatibility">
<exclude-pattern>tests/</exclude-pattern>
</rule> -->
<rule ref="Generic.Commenting">
<exclude-pattern>tests/</exclude-pattern>
</rule>
<rule ref="Generic.Commenting.Todo.TaskFound">
<exclude name="Generic.Commenting.Todo.TaskFound"/>
</rule>
<!-- <rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable">
<exclude name="VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable"/>
</rule> -->
<rule ref="Generic.Commenting.DocComment.MissingShort">
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
</rule>
<rule ref="Generic.Files.LineLength.TooLong">
<exclude name="Generic.Files.LineLength.TooLong"/>
</rule>
<rule ref="Squiz.PHP.CommentedOutCode.Found">
<exclude name="Squiz.PHP.CommentedOutCode.Found"/>
</rule>
<rule ref="Squiz.Commenting.ClassComment.Missing">
<exclude-pattern>tests/</exclude-pattern>
<exclude-pattern>src/</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.VariableComment.Missing">
<exclude-pattern>tests/</exclude-pattern>
<exclude-pattern>src/</exclude-pattern>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.Missing">
<exclude-pattern>tests/</exclude-pattern>
<exclude-pattern>src/</exclude-pattern>
</rule>
</ruleset>
5 changes: 3 additions & 2 deletions src/BusinessLogic/AdminAPI/Response/ErrorResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ public function __construct(Throwable $error)
/**
* Implementation is swallowing all undefined calls to avoid undefined method call exceptions when
*
* @param $methodName
* @param $arguments
*
* @see ErrorHandlingAspect already hanled the API call exception but because of chaining calle will trigger
* API controller messages on instance of the @see self.
*
* @param $methodName
* @param $arguments
* @return self Already handled error response
*/
public function __call($methodName, $arguments)
Expand Down
3 changes: 2 additions & 1 deletion src/BusinessLogic/CheckoutAPI/CheckoutAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public static function get(): object
}

/**
* @param string $storeId
* @param string $storeId
*
* @return SolicitationController
*/
public function solicitation(string $storeId): object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ public function getItemByExecutionId(int $executionId): ?TransactionLog
}

/**
* @param DateTime|null $disconnectTime
* @param DateTime|null $disconnectTime
*
* @return int
*
* @throws QueryFilterInvalidParamException
Expand Down
13 changes: 7 additions & 6 deletions src/BusinessLogic/Domain/Order/Models/OrderRequest/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ class Cart extends OrderRequestDTO
private $items;

/**
* @param string $currency
* @param bool $gift
* @param array $items
* @param string|int|null $cartRef
* @param string|null $createdAt
* @param string|null $updatedAt
* @param string $currency
* @param bool $gift
* @param array $items
* @param string|int|null $cartRef
* @param string|null $createdAt
* @param string|null $updatedAt
*
* @throws InvalidCartItemsException
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public function __construct(
/**
* Create a CreateOrderRequest instance from an array.
*
* @param array $data
* @param array $data
*
* @return CreateOrderRequest
* @throws InvalidCartItemsException
* @throws InvalidGuiLayoutValueException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public function __construct($orderRef1, $orderRef2 = null)
/**
* Creates a new MerchantReference instance from an array.
*
* @param array $data
* @param array $data
*
* @return MerchantReference
*/
public static function fromArray(array $data): MerchantReference
Expand Down
4 changes: 2 additions & 2 deletions src/BusinessLogic/Domain/Order/Models/SeQuraOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ public function getConfig(): EntityConfiguration
}

/**
* @inheritDoc
* Sets raw array data to this entity instance properties.
*
* @param array $data
* @param array $data Raw array data with keys for class fields. @see self::$fields for field names.
*
* @throws Exception
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,53 @@ interface SeQuraOrderRepositoryInterface
/**
* Gets Sequra order by shop order reference
*
* @param string $shopOrderReference
* @param string $shopOrderReference
*
* @return SeQuraOrder|null
*/
public function getByShopReference(string $shopOrderReference): ?SeQuraOrder;

/**
* Gets Sequra orders by shop order references
*
* @param string[] $shopOrderReferences
* @param string[] $shopOrderReferences
*
* @return SeQuraOrder[]
*/
public function getOrderBatchByShopReferences(array $shopOrderReferences): array;

/**
* Gets Sequra order by shop cart/quote reference
*
* @param string $cartId
* @param string $cartId
*
* @return SeQuraOrder|null
*/
public function getByCartId(string $cartId): ?SeQuraOrder;

/**
* Gets Sequra order by Sequra order reference
*
* @param string $sequraOrderReference
* @param string $sequraOrderReference
*
* @return SeQuraOrder|null
*/
public function getByOrderReference(string $sequraOrderReference): ?SeQuraOrder;

/**
* Insert/update SeQuraOrder for current store context.
*
* @param SeQuraOrder $order
* @param SeQuraOrder $order
*
* @return void
*/
public function setSeQuraOrder(SeQuraOrder $order): void;

/**
* Deletes Sequra order form storage
*
* @param SeQuraOrder $existingOrder
* @param SeQuraOrder $existingOrder
*
* @return void
*/
public function deleteOrder(SeQuraOrder $existingOrder): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public function getMessages(): array
}

/**
* @param array $messages
* @param array $messages
*
* @return void
*/
public function setMessages(array $messages): void
Expand All @@ -59,7 +60,8 @@ public function getMessagesBelowLimit(): array
}

/**
* @param array $messagesBelowLimit
* @param array $messagesBelowLimit
*
* @return void
*/
public function setMessagesBelowLimit(array $messagesBelowLimit): void
Expand Down
1 change: 0 additions & 1 deletion src/Infrastructure/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ public function getHttpConfigurationOptions($domain)
* Sets HTTP configuration options for given domain.
*
* @param string $domain A domain for which to save configuration options.
*
* @param Options[] $options HTTP configuration options
*/
public function setHttpConfigurationOptions($domain, array $options)
Expand Down
4 changes: 2 additions & 2 deletions src/Infrastructure/Http/CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CurlHttpClient extends HttpClient
*/
public const SSL_STRICT_MODE = false;
/**
* cURL options for the request.
* CURL options for the request.
*
* @var array
*/
Expand All @@ -46,7 +46,7 @@ class CurlHttpClient extends HttpClient
*/
protected $followLocation = true;
/**
* cURL handler.
* CURL handler.
*
* @var resource
*/
Expand Down
4 changes: 3 additions & 1 deletion src/Infrastructure/Serializer/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
abstract class Serializer
{
/**
* string CLASS_NAME Class name identifier.
* Class name identifier.
*
* @var string CLASS_NAME
*/
const CLASS_NAME = __CLASS__;

Expand Down
5 changes: 3 additions & 2 deletions src/Infrastructure/TaskExecution/Composite/Orchestrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ abstract protected function getSubTask();
/**
* Creates sub-job.
*
* @param Task $task
* @param int $weight
* @param Task $task
* @param int $weight
*
* @return ExecutionDetails
*
* @throws QueueStorageUnavailableException
Expand Down
20 changes: 10 additions & 10 deletions src/Infrastructure/TaskExecution/QueueService.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ public function batchStatusUpdate(array $ids, $status)
/**
* Creates queue item.
*
* @param $queueName
* @param Task $task
* @param string $context
* @param int $priority
* @param int $parent
* @param $queueName
* @param Task $task
* @param string $context
* @param int $priority
* @param int $parent
*
* @return QueueItem
*
* @throws QueueStorageUnavailableException
Expand All @@ -110,7 +111,6 @@ public function create($queueName, Task $task, $context = '', $priority = Priori
* @param string $context Task execution context. If integration supports multiple accounts (middleware
* integration) context based on account id should be provided. Failing to do this will result in global task
* context and unpredictable task execution.
*
* @param int $priority
*
* @return QueueItem Created queue item.
Expand Down Expand Up @@ -415,12 +415,12 @@ public function keepAlive(QueueItem $queueItem)
}

/**
* @noinspection PhpDocMissingThrowsInspection
*
* Finds queue item by Id.
*
* @param int $id Id of a queue item to find.
*
* @noinspection PhpDocMissingThrowsInspection
*
* @return QueueItem|null Queue item if found; otherwise, NULL.
*/
public function find($id)
Expand All @@ -435,13 +435,13 @@ public function find($id)
}

/**
* @noinspection PhpDocMissingThrowsInspection
*
* Finds latest queue item by type.
*
* @param string $type Type of a queue item to find.
* @param string $context Task scope restriction, default is global scope.
*
* @noinspection PhpDocMissingThrowsInspection
*
* @return QueueItem|null Queue item if found; otherwise, NULL.
*/
public function findLatestByType($type, $context = '')
Expand Down

0 comments on commit d60421a

Please sign in to comment.