mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 12:11:19 +00:00
Improve test coverage.
This commit is contained in:
@@ -86,6 +86,7 @@ class Note extends Model
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setTextAttribute($value): void
|
||||
{
|
||||
|
@@ -38,7 +38,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property int $id
|
||||
* @property User user
|
||||
* @property int $user_id
|
||||
* @property-read \FireflyIII\User $user
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\Preference newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\Preference newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\Preference query()
|
||||
|
@@ -147,6 +147,7 @@ class Rule extends Model
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setDescriptionAttribute($value): void
|
||||
{
|
||||
|
@@ -102,10 +102,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property Carbon updated_at
|
||||
* @property string foreign_currency_code
|
||||
* @SuppressWarnings (PHPMD.TooManyPublicMethods)
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property \Illuminate\Support\Carbon|null $deleted_at
|
||||
* @property bool $reconciled
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\Models\Transaction after(\Carbon\Carbon $date)
|
||||
@@ -185,30 +182,6 @@ class Transaction extends Model
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return Transaction
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public static function routeBinder(string $value): Transaction
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$transactionId = (int)$value;
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var Transaction $transaction */
|
||||
$transaction = $user->transactions()->where('transactions.id', $transactionId)->first(['transactions.*']);
|
||||
if (null !== $transaction) {
|
||||
return $transaction;
|
||||
}
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the account this object belongs to.
|
||||
|
Reference in New Issue
Block a user