Code Duplication    Length = 9-12 lines in 4 locations

src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaListingSearchQuery.php 1 location

@@ 78-88 (lines=11) @@
75
     * @param string|null $orderDirection
76
     * @return RaListingSearchQuery
77
     */
78
    public function setOrderDirection($orderDirection)
79
    {
80
        Assert\that($orderDirection)->choice(
81
            ['asc', 'desc', '', null],
82
            "Invalid order direction, must be one of 'asc', 'desc'"
83
        );
84
85
        $this->orderDirection = $orderDirection ?: null;
86
87
        return $this;
88
    }
89
90
    private function assertNonEmptyString($value, $parameterName)
91
    {

src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaSecondFactorSearchQuery.php 1 location

@@ 197-205 (lines=9) @@
194
    /**
195
     * @param string|null $orderDirection
196
     */
197
    public function setOrderDirection($orderDirection)
198
    {
199
        Assert\that($orderDirection)->choice(
200
            ['asc', 'desc', '', null],
201
            "Invalid order direction, must be one of 'asc', 'desc'"
202
        );
203
204
        $this->orderDirection = $orderDirection ?: null;
205
    }
206
207
    private function assertNonEmptyString($value, $name)
208
    {

src/Surfnet/StepupMiddlewareClient/Identity/Dto/SecondFactorAuditLogSearchQuery.php 1 location

@@ 84-92 (lines=9) @@
81
    /**
82
     * @param string|null $orderDirection
83
     */
84
    public function setOrderDirection($orderDirection)
85
    {
86
        Assert\that($orderDirection)->choice(
87
            ['asc', 'desc', '', null],
88
            "Invalid order direction, must be one of 'asc', 'desc'"
89
        );
90
91
        $this->orderDirection = $orderDirection ?: null;
92
    }
93
94
    private function assertNonEmptyString($value, $name)
95
    {

src/Surfnet/StepupMiddlewareClient/Configuration/Dto/RaLocationSearchQuery.php 1 location

@@ 52-63 (lines=12) @@
49
     * @param string $orderDirection
50
     * @return $this
51
     */
52
    public function setOrderDirection($orderDirection)
53
    {
54
        $this->assertNonEmptyString($orderDirection, 'orderDirection');
55
        Assert\that($orderDirection)->choice(
56
            ['asc', 'desc', '', null],
57
            "Invalid order direction, must be one of 'asc', 'desc'"
58
        );
59
60
        $this->orderDirection = $orderDirection;
61
62
        return $this;
63
    }
64
65
    private function assertNonEmptyString($value, $name)
66
    {