Skip to content

Commit

Permalink
fix: docs regarding traits, add return true to approval methods
Browse files Browse the repository at this point in the history
  • Loading branch information
fajarwz committed Aug 11, 2024
1 parent 23d7fe3 commit 1d38abc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Include the necessary traits in your models:
For models that can be reviewed, use the `CanBeReviewed` trait:

```php
use Fajarwz\LaravelReview\CanBeReviewed;
use Fajarwz\LaravelReview\Traits\CanBeReviewed;

class Mentor extends Model
{
Expand All @@ -45,7 +45,7 @@ class Mentor extends Model
For models that can submit reviews, use the `CanReview` trait:

```php
use Fajarwz\LaravelReview\CanReview;
use Fajarwz\LaravelReview\Traits\CanReview;

class Mentee extends Model
{
Expand Down
4 changes: 4 additions & 0 deletions src/Models/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public function approve(): void
/** @phpstan-ignore-next-line */
$this->reviewable->updateReviewSummary($params);
});

return true;

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.3 - L11.* - prefer-lowest - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.2 - L11.* - prefer-lowest - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-lowest - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Fajarwz\LaravelReview\Models\Review::approve() with return type void returns true but should not return anything.

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.3 - L11.* - prefer-stable - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-lowest - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.2 - L11.* - prefer-lowest - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-lowest - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / P8.2 - L11.* - prefer-stable - ubuntu-latest

A void function must not return a value

Check failure on line 73 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Fajarwz\LaravelReview\Models\Review::approve() with return type void returns true but should not return anything.
}

/**
Expand All @@ -93,6 +95,8 @@ public function unapprove(): void
/** @phpstan-ignore-next-line */
$this->reviewable->updateReviewSummary($params);
});

return true;

Check failure on line 99 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Fajarwz\LaravelReview\Models\Review::unapprove() with return type void returns true but should not return anything.

Check failure on line 99 in src/Models/Review.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Fajarwz\LaravelReview\Models\Review::unapprove() with return type void returns true but should not return anything.
}

/**
Expand Down

0 comments on commit 1d38abc

Please sign in to comment.