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

NIT-Administrative-Systems / dynamic-forms / 13506631453

24 Feb 2025 07:54PM UTC coverage: 94.075% (+0.07%) from 94.003%
13506631453

push

github

web-flow
Laravel 12 (#480)

1302 of 1384 relevant lines covered (94.08%)

209.68 hits per line

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

11.11
/src/Storage/FileDriver.php
1
<?php
2

3
namespace Northwestern\SysDev\DynamicForms\Storage;
4

5
class FileDriver implements StorageInterface
6
{
7
    /** @var string */
8
    const STORAGE_URL = 'url';
9

10
    /**
11
     * @inheritDoc
12
     */
13
    public function findObject(string $key): bool
14
    {
15
        return \File::exists(storage_path('app/uploaded/'.$key));
×
16
    }
17

18
    public function isValid(mixed $value): bool
19
    {
20
        // Check if all fields exist
21
        if (! isset($value) || ! isset($value['name']) || ! isset($value['url']) || ! isset($value['data']) ||
×
22
            ! isset($value['data']['baseUrl']) || ! isset($value['data']['project']) || ! isset($value['data']['form'])) {
×
23
            return false;
×
24
        }
25

26
        // Check consistency of fields
27
        $expectedUrl = route('dynamic-forms.url-file-download').'?baseUrl='.urlencode($value['data']['baseUrl']).'&project=&form=/'.$value['name'];
×
28
        if ($expectedUrl != $value['url']) {
×
29
            return false;
×
30
        }
31

32
        return $this->findObject($value['name']);
×
33
    }
34

35
    public static function getStorageMethod(): string
36
    {
37
        return self::STORAGE_URL;
30✔
38
    }
39
}
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

© 2025 Coveralls, Inc