• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mpyw / laravel-file-errors / 13674508507

05 Mar 2025 11:04AM UTC coverage: 100.0%. Remained the same
13674508507

push

github

web-flow
chore: 🤖 Bump version (#7)

24 of 24 relevant lines covered (100.0%)

24.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/IncludesFileErrorDetails.php
1
<?php
2

3
namespace Mpyw\LaravelFileErrors;
4

5
use Illuminate\Http\UploadedFile;
6

7
/**
8
 * Class IncludesFileErrorDetails
9
 *
10
 * @mixin \Illuminate\Validation\Validator
11
 */
12
trait IncludesFileErrorDetails
13
{
14
    /**
15
     * Add a failed rule and error message to the collection.
16
     *
17
     * @param string $attribute
18
     * @param string $rule
19
     * @param array  $parameters
20
     */
21
    public function addFailure($attribute, $rule, $parameters = []): void
22
    {
23
        if ($rule === 'uploaded' && ($value = $this->getValue($attribute)) instanceof UploadedFile) {
16✔
24
            $rule = 'uploaded.' . UploadError::fromFile($value);
16✔
25
        }
26

27
        parent::addFailure($attribute, $rule, $parameters);
16✔
28
    }
29
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc