Skip to content

Commit

Permalink
Merge pull request #261 from wmde/dependabot/composer/wmde/fundraisin…
Browse files Browse the repository at this point in the history
…g-phpcs-12.0.0

Bump wmde/fundraising-phpcs from 10.1.0 to 12.0.0
  • Loading branch information
moiikana authored Jan 7, 2025
2 parents e300ac6 + f37772d commit bb5b534
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 63 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"phpunit/phpunit": "~11.0",
"phpmd/phpmd": "~2.6",
"mikey179/vfsstream": "~1.6",
"wmde/fundraising-phpcs": "~10.1",
"wmde/fundraising-phpcs": "~12.0",
"wmde/psr-log-test-doubles": "~3.0",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-doctrine": "~1.3.62",
Expand Down
110 changes: 63 additions & 47 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private function updatePaymentInformation( DoctrineDonation $doctrineDonation, L
$doctrineDonation->setPaymentType( $legacyPaymentData->paymentName );
}

private function updateComment( DoctrineDonation $doctrineDonation, DonationComment $comment = null ): void {
private function updateComment( DoctrineDonation $doctrineDonation, ?DonationComment $comment = null ): void {
if ( $comment === null ) {
$doctrineDonation->setIsPublic( false );
$doctrineDonation->setComment( '' );
Expand Down
4 changes: 2 additions & 2 deletions src/Domain/Model/Donation.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Donation {
*
* @throws \InvalidArgumentException
*/
public function __construct( int $id, Donor $donor, int $paymentId, DonationTrackingInfo $trackingInfo, DateTimeImmutable $donatedOn, DonationComment $comment = null ) {
public function __construct( int $id, Donor $donor, int $paymentId, DonationTrackingInfo $trackingInfo, DateTimeImmutable $donatedOn, ?DonationComment $comment = null ) {
$this->id = $id;
$this->donor = $donor;
$this->paymentId = $paymentId;
Expand Down Expand Up @@ -167,7 +167,7 @@ public function isExported(): bool {
return $this->exportDate !== null;
}

public function markAsExported( DateTimeImmutable $exportDate = null ): void {
public function markAsExported( ?DateTimeImmutable $exportDate = null ): void {
$this->exportDate = $exportDate ?? new DateTimeImmutable();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Repositories/CommentListingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class CommentListingException extends RuntimeException {

public function __construct( Throwable $previous = null ) {
public function __construct( ?Throwable $previous = null ) {
parent::__construct( 'Could not list comments', 0, $previous );
}

Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Repositories/GetDonationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class GetDonationException extends RuntimeException {

public function __construct( Throwable $previous = null, string $message = 'Could not get donation' ) {
public function __construct( ?Throwable $previous = null, string $message = 'Could not get donation' ) {
parent::__construct( $message, 0, $previous );
}

Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Repositories/StoreDonationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class StoreDonationException extends \RuntimeException {

public function __construct( Throwable $previous = null, string $message = 'Could not store donation' ) {
public function __construct( ?Throwable $previous = null, string $message = 'Could not store donation' ) {
parent::__construct( $message, 0, $previous );
}

Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/DonationEventLogException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class DonationEventLogException extends RuntimeException {

public function __construct( string $message, Throwable $previous = null ) {
public function __construct( string $message, ?Throwable $previous = null ) {
parent::__construct( $message, 0, $previous );
}

Expand Down
2 changes: 1 addition & 1 deletion src/UseCases/GetDonation/GetDonationResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static function newValidResponse( Donation $donation ): self {
return new self( $donation );
}

private function __construct( Donation $donation = null ) {
private function __construct( ?Donation $donation = null ) {
$this->donation = $donation;
}

Expand Down
6 changes: 3 additions & 3 deletions src/UseCases/UpdateDonor/UpdateDonorResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class UpdateDonorResponse {
private string $errorMessage;
private string $successMessage;

public static function newSuccessResponse( string $successMessage, Donation $donation = null ): self {
public static function newSuccessResponse( string $successMessage, ?Donation $donation = null ): self {
return new self( '', $successMessage, $donation );
}

public static function newFailureResponse( string $errorMessage, Donation $donation = null ): self {
public static function newFailureResponse( string $errorMessage, ?Donation $donation = null ): self {
return new self( $errorMessage, '', $donation );
}

private function __construct( string $errorMessage = '', string $successMessage = '', Donation $donation = null ) {
private function __construct( string $errorMessage = '', string $successMessage = '', ?Donation $donation = null ) {
$this->errorMessage = $errorMessage;
$this->successMessage = $successMessage;
$this->donation = $donation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class CancelDonationUseCaseTest extends TestCase {
private const AUTHORIZED_USER = 'admin_adminson';

private function newCancelDonationUseCase(
DonationRepository $repository = null,
DonationAuthorizationChecker $authorizer = null,
DonationEventLogger $logger = null,
CancelPaymentUseCase $cancelPaymentUseCase = null
?DonationRepository $repository = null,
?DonationAuthorizationChecker $authorizer = null,
?DonationEventLogger $logger = null,
?CancelPaymentUseCase $cancelPaymentUseCase = null
): CancelDonationUseCase {
return new CancelDonationUseCase(
$repository ?? new FakeDonationRepository(),
Expand Down

0 comments on commit bb5b534

Please sign in to comment.