Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:

- name: Install dependencies
run: |
cd galette-core/galette
cd galette-core
composer install --ignore-platform-reqs

- name: CS
Expand Down
55 changes: 52 additions & 3 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,60 @@
->setRules([
'@PSR12' => true,
'@PER-CS' => true,
'@PHP82Migration' => true,
'@PHP8x2Migration' => true,
'trailing_comma_in_multiline' => false,
'cast_spaces' => false,
'cast_spaces' => ['space' => 'none'],
'single_line_empty_body' => false,
'no_unused_imports' => true
'no_unused_imports' => true,
// rules for phpdoc
// Removes @param, @return and @var tags that don't provide any useful information - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:no_superfluous_phpdoc_tags
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'remove_inheritdoc' => true,
],
// require phpdoc for non typed arguments - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_add_missing_param_annotation
'phpdoc_add_missing_param_annotation' => true,
// no @access - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_no_access
'phpdoc_no_access' => true,
// no @package - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_no_package
'phpdoc_no_package' => true,
// order phpdoc tags - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_order
'phpdoc_order' => ['order' => ['since', 'var', 'see', 'param', 'return', 'throw', 'todo', 'deprecated']],
// phpdoc param in same order as signature - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_param_order
'phpdoc_param_order' => true,
// align tags - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_align
'phpdoc_align' => [
'align' => 'vertical',
'tags' => [
'param',
'property',
'property-read',
'property-write',
'phpstan-param',
'phpstan-property',
'phpstan-property-read',
'phpstan-property-write',
'phpstan-assert',
'phpstan-assert-if-true',
'phpstan-assert-if-false',
'psalm-param',
'psalm-param-out',
'psalm-property',
'psalm-property-read',
'psalm-property-write',
'psalm-assert',
'psalm-assert-if-true',
'psalm-assert-if-false'
],
],
// Check types case - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_types
'phpdoc_types' => true,
// Use native scalar types - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_scalar
'phpdoc_scalar' => true,
// remove extra empty lines - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_trim
'phpdoc_trim' => true,
// remove empty lines inside phpdoc block - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_trim_consecutive_blank_line_separation
'phpdoc_trim_consecutive_blank_line_separation' => true,
])
->setFinder($finder)
;
2 changes: 1 addition & 1 deletion _config.inc.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down
2 changes: 1 addition & 1 deletion _define.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down
2 changes: 1 addition & 1 deletion _routes.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down
18 changes: 1 addition & 17 deletions lib/GalettePaypal/Controllers/PaypalController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down Expand Up @@ -55,8 +55,6 @@ class PaypalController extends AbstractPluginController
*
* @param Request $request PSR Request
* @param Response $response PSR Response
*
* @return Response
*/
public function form(Request $request, Response $response): Response
{
Expand Down Expand Up @@ -106,8 +104,6 @@ public function form(Request $request, Response $response): Response
* @param Response $response PSR Response
* @param string|null $option Either order, reset or page
* @param string|int|null $value Option value
*
* @return Response
*/
public function logs(
Request $request,
Expand Down Expand Up @@ -164,8 +160,6 @@ public function logs(
*
* @param Request $request PSR Request
* @param Response $response PSR Response
*
* @return Response
*/
public function filter(Request $request, Response $response): Response
{
Expand All @@ -190,8 +184,6 @@ public function filter(Request $request, Response $response): Response
*
* @param Request $request PSR Request
* @param Response $response PSR Response
*
* @return Response
*/
public function preferences(Request $request, Response $response): Response
{
Expand Down Expand Up @@ -223,8 +215,6 @@ public function preferences(Request $request, Response $response): Response
*
* @param Request $request PSR Request
* @param Response $response PSR Response
*
* @return Response
*/
public function storePreferences(Request $request, Response $response): Response
{
Expand Down Expand Up @@ -264,8 +254,6 @@ public function storePreferences(Request $request, Response $response): Response
*
* @param Request $request PSR Request
* @param Response $response PSR Response
*
* @return Response
*/
public function cancel(Request $request, Response $response): Response
{
Expand All @@ -283,8 +271,6 @@ public function cancel(Request $request, Response $response): Response
*
* @param Request $request PSR Request
* @param Response $response PSR Response
*
* @return Response
*/
public function success(Request $request, Response $response): Response
{
Expand Down Expand Up @@ -359,8 +345,6 @@ public function success(Request $request, Response $response): Response
*
* @param Request $request PSR Request
* @param Response $response PSR Response
*
* @return Response
*/
public function notify(Request $request, Response $response): Response
{
Expand Down
36 changes: 1 addition & 35 deletions lib/GalettePaypal/Paypal.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down Expand Up @@ -69,8 +69,6 @@ public function __construct(Db $zdb)

/**
* Load preferences form the database and amounts from core contributions types
*
* @return void
*/
public function load(): void
{
Expand Down Expand Up @@ -111,8 +109,6 @@ public function load(): void

/**
* Load amounts from core contributions types
*
* @return void
*/
private function loadContributionsTypes(): void
{
Expand All @@ -134,8 +130,6 @@ private function loadContributionsTypes(): void

/**
* Store values in the database
*
* @return bool
*/
public function store(): bool
{
Expand Down Expand Up @@ -189,8 +183,6 @@ public function store(): bool

/**
* Get Paypal identifier
*
* @return string
*/
public function getId(): ?string
{
Expand Down Expand Up @@ -229,8 +221,6 @@ public function getAllAmounts(): array

/**
* Is the plugin loaded?
*
* @return bool
*/
public function isLoaded(): bool
{
Expand All @@ -239,8 +229,6 @@ public function isLoaded(): bool

/**
* Are amounts loaded?
*
* @return bool
*/
public function areAmountsLoaded(): bool
{
Expand All @@ -251,8 +239,6 @@ public function areAmountsLoaded(): bool
* Set paypal identifier
*
* @param string $id identifier
*
* @return void
*/
public function setId(string $id): void
{
Expand All @@ -264,8 +250,6 @@ public function setId(string $id): void
*
* @param array<int, string> $ids array of identifier
* @param array<int, string> $amounts array of amounts
*
* @return void
*/
public function setPrices(array $ids, array $amounts): void
{
Expand All @@ -279,8 +263,6 @@ public function setPrices(array $ids, array $amounts): void
* Check if the specified contribution is active
*
* @param int $id type identifier
*
* @return bool
*/
public function isInactive(int $id): bool
{
Expand All @@ -291,8 +273,6 @@ public function isInactive(int $id): bool
* Set inactives types
*
* @param array<int, string> $inactives array of inactives types
*
* @return void
*/
public function setInactives(array $inactives): void
{
Expand All @@ -301,8 +281,6 @@ public function setInactives(array $inactives): void

/**
* Unset inactives types
*
* @return void
*/
public function unsetInactives(): void
{
Expand All @@ -311,8 +289,6 @@ public function unsetInactives(): void

/**
* Get the URL to use for Paypal
*
* @return string
*/
public function getFormURL(): string
{
Expand All @@ -323,8 +299,6 @@ public function getFormURL(): string

/**
* Get the URL for Paypal IPN validation
*
* @return string
*/
public function getIPNValidationURL(): string
{
Expand All @@ -337,8 +311,6 @@ public function getIPNValidationURL(): string
* Validate IPN data
*
* @param array<string, string> $data POST data received from Paypal
*
* @return bool
*/
public function validateIPN(array $data): bool
{
Expand All @@ -359,8 +331,6 @@ public function validateIPN(array $data): bool
* Validate this is our account
*
* @param array<string, string> $data POST data received from Paypal
*
* @return bool
*/
public function validateAccount(array $data): bool
{
Expand All @@ -371,8 +341,6 @@ public function validateAccount(array $data): bool
* Validate request data
*
* @param array<string, mixed> $data POST data received from Paypal
*
* @return bool
*/
public function validateRequest(array $data): bool
{
Expand All @@ -383,8 +351,6 @@ public function validateRequest(array $data): bool
* Validate Paypal request
*
* @param array<string, mixed> $data POST data received from Paypal
*
* @return bool
*/
public function validate(array $data): bool
{
Expand Down
10 changes: 1 addition & 9 deletions lib/GalettePaypal/PaypalHistory.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down Expand Up @@ -111,8 +111,6 @@ public function add(array|string $action, string $argument = '', string $query =
* Get table's name
*
* @param bool $prefixed Whether table name should be prefixed
*
* @return string
*/
protected function getTableName(bool $prefixed = false): string
{
Expand All @@ -125,8 +123,6 @@ protected function getTableName(bool $prefixed = false): string

/**
* Get table's PK
*
* @return string
*/
protected function getPk(): string
{
Expand Down Expand Up @@ -193,8 +189,6 @@ protected function buildOrderClause(): array
* Is payment already processed?
*
* @param string $sign Verify sign paypal parameter
*
* @return bool
*/
public function isProcessed(string $sign): bool
{
Expand All @@ -212,8 +206,6 @@ public function isProcessed(string $sign): bool
* Set payment state
*
* @param int $state State, one of self::STATE_ constants
*
* @return bool
*/
public function setState(int $state): bool
{
Expand Down
2 changes: 1 addition & 1 deletion lib/GalettePaypal/PluginGalettePaypal.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright © 2003-2025 The Galette Team
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
Expand Down
Loading