Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — main (#4988)
by Cristian
27:11 queued 12:10
created

UploadersRepository::getGroupUploaders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Backpack\CRUD\app\Library\CrudPanel\Uploads;
4
5
final class UploadersRepository
6
{
7
    private array $uploaders;
8
9
    private array $handledUploaders = [];
10
11
    public function __construct()
12
    {
13
        $this->uploaders = config('backpack.crud.uploaders');
14
    }
15
16
    public function markAsHandled(string $objectName)
17
    {
18
        $this->handledUploaders[] = $objectName;
19
    }
20
21
    public function isUploadHandled(string $objectName)
22
    {
23
        return in_array($objectName, $this->handledUploaders);
24
    }
25
26
    public function hasUploadFor(string $objectType, $group)
27
    {
28
        return array_key_exists($objectType, $this->uploaders[$group]);
29
    }
30
31
    public function getUploadFor(string $objectType, $group)
32
    {
33
        return $this->uploaders[$group][$objectType];
34
    }
35
36
    public function addUploaders(array $uploaders, $group)
37
    {
38
        $this->uploaders[$group] = array_merge($this->getGroupUploaders($group), $uploaders);
39
    }
40
41
    private function getGroupUploaders($group)
42
    {
43
        return $this->uploaders[$group] ?? [];
44
    }
45
}
46