GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (4568)

AdditionalPropertySingletonStore.php (14 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\AdditionalProperties;
4
5
/**
6
 * Handles storing the additional properties models can define using a local array
7
 */
0 ignored issues
show
Missing @category tag in class comment
Loading history...
Missing @package tag in class comment
Loading history...
Missing @author tag in class comment
Loading history...
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
8
class AdditionalPropertySingletonStore implements AdditionalPropertyStore
9
{
10
11
    /**
12
     * Properties that can be used
13
     * 
14
     * Stores with the model as the key, then an array of property keys
15
     * 
16
     * @var array [ 'ModelClassName' => ['student_id', 'faculty']
17
     */
18
    private $properties = [];
0 ignored issues
show
Private member variable "properties" must be prefixed with an underscore
Loading history...
19
20
    /**
21
     * Add a property to a model.
22
     *
23
     * Properties must be initialised before they can be used.
24
     *
25
     * @param string $model Model class name to add the property to
26
     * @param string $key Key of the property
0 ignored issues
show
Expected 3 spaces after parameter name; 1 found
Loading history...
27
     * @return void
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
28
     */
29 47
    public function addProperty(string $model, string $key): void {
0 ignored issues
show
Opening brace should be on a new line
Loading history...
30 47
        if(!$this->hasProperties($model)) {
0 ignored issues
show
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
31 47
            $this->properties[$model] = [];
32
        }
33 47
        $this->properties[$model][] = $key;
34 47
    }
35
36
    /**
37
     * Does the given model have any properties
38
     *
39
     * @param string $model Full class name of the model
40
     * @return bool If the model has properties
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
41
     */
42 447
    public function hasProperties(string $model): bool
43
    {
44 447
        return array_key_exists($model, $this->properties);
45
    }
46
47
    /**
48
     * Get all properties a model has
49
     *
50
     * @param string $model Full class name of the model
51
     * @return array Array of property keys.
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
52
     */
53 445
    public function getProperties(string $model): array
54
    {
55 445
        if($this->hasProperties($model)) {
0 ignored issues
show
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
56 46
            return $this->properties[$model];
57
        }
58 401
        return [];
59
    }
60
    
61
}