Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
15 / 15
100.00% covered (success)
100.00%
11 / 11
CRAP
100.00% covered (success)
100.00%
1 / 1
Specs
100.00% covered (success)
100.00%
15 / 15
100.00% covered (success)
100.00%
11 / 11
11
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
1
 getRules
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setRules
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getComments
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setComments
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getActionsNames
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setActionsNames
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getGroup
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setGroup
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\Extension\AbuseFilter\Filter;
4
5/**
6 * (Mutable) value object that represents the "specs" of a filter.
7 */
8class Specs {
9    /** @var string */
10    private $rules;
11    /** @var string */
12    private $comments;
13    /** @var string */
14    private $name;
15    /** @var string[] */
16    private $actionsNames;
17    /** @var string */
18    private $group;
19
20    /**
21     * @param string $rules
22     * @param string $comments
23     * @param string $name
24     * @param string[] $actionsNames
25     * @param string $group
26     */
27    public function __construct( string $rules, string $comments, string $name, array $actionsNames, string $group ) {
28        $this->rules = $rules;
29        $this->comments = $comments;
30        $this->name = $name;
31        $this->actionsNames = $actionsNames;
32        $this->group = $group;
33    }
34
35    /**
36     * @return string
37     */
38    public function getRules(): string {
39        return $this->rules;
40    }
41
42    /**
43     * @param string $rules
44     */
45    public function setRules( string $rules ): void {
46        $this->rules = $rules;
47    }
48
49    /**
50     * @return string
51     */
52    public function getComments(): string {
53        return $this->comments;
54    }
55
56    /**
57     * @param string $comments
58     */
59    public function setComments( string $comments ): void {
60        $this->comments = $comments;
61    }
62
63    /**
64     * @return string
65     */
66    public function getName(): string {
67        return $this->name;
68    }
69
70    /**
71     * @param string $name
72     */
73    public function setName( string $name ): void {
74        $this->name = $name;
75    }
76
77    /**
78     * @return string[]
79     */
80    public function getActionsNames(): array {
81        return $this->actionsNames;
82    }
83
84    /**
85     * @param string[] $actionsNames
86     */
87    public function setActionsNames( array $actionsNames ): void {
88        $this->actionsNames = $actionsNames;
89    }
90
91    /**
92     * @return string
93     */
94    public function getGroup(): string {
95        return $this->group;
96    }
97
98    /**
99     * @param string $group
100     */
101    public function setGroup( string $group ): void {
102        $this->group = $group;
103    }
104}