Code Duplication    Length = 10-10 lines in 9 locations

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

@@ 80-89 (lines=10) @@
77
        return $this;
78
    }
79
80
    private function assertNonEmptyString($value, $name)
81
    {
82
        $message = sprintf(
83
            '"%s" must be a non-empty string, "%s" given',
84
            $name,
85
            (is_object($value) ? get_class($value) : gettype($value))
86
        );
87
88
        Assert\that($value)->string($message)->notEmpty($message);
89
    }
90
91
    public function toHttpQuery()
92
    {

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

@@ 95-104 (lines=10) @@
92
        return $this;
93
    }
94
95
    private function assertNonEmptyString($value, $name)
96
    {
97
        $message = sprintf(
98
            '"%s" must be a non-empty string, "%s" given',
99
            $name,
100
            (is_object($value) ? get_class($value) : gettype($value))
101
        );
102
103
        Assert\that($value)->string($message)->notEmpty($message);
104
    }
105
106
    /**
107
     * @return string

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

@@ 90-99 (lines=10) @@
87
        return $this;
88
    }
89
90
    private function assertNonEmptyString($value, $parameterName)
91
    {
92
        $message = sprintf(
93
            '"%s" must be a non-empty string, "%s" given',
94
            $parameterName,
95
            (is_object($value) ? get_class($value) : gettype($value))
96
        );
97
98
        Assert\that($value)->string($message)->notEmpty($message);
99
    }
100
101
    public function toHttpQuery()
102
    {

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

@@ 207-216 (lines=10) @@
204
        $this->orderDirection = $orderDirection ?: null;
205
    }
206
207
    private function assertNonEmptyString($value, $name)
208
    {
209
        $message = sprintf(
210
            '"%s" must be a non-empty string, "%s" given',
211
            $name,
212
            (is_object($value) ? get_class($value) : gettype($value))
213
        );
214
215
        Assert\that($value)->string($message)->notEmpty($message);
216
    }
217
218
    /**
219
     * Return the Http Query string as should be used, MUST include the '?' prefix.

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

@@ 94-103 (lines=10) @@
91
        $this->orderDirection = $orderDirection ?: null;
92
    }
93
94
    private function assertNonEmptyString($value, $name)
95
    {
96
        $message = sprintf(
97
            '"%s" must be a non-empty string, "%s" given',
98
            $name,
99
            (is_object($value) ? get_class($value) : gettype($value))
100
        );
101
102
        Assert\that($value)->string($message)->notEmpty($message);
103
    }
104
105
    /**
106
     * Return the Http Query string as should be used, MUST include the '?' prefix.

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

@@ 62-71 (lines=10) @@
59
        return $this;
60
    }
61
62
    private function assertNonEmptyString($value, $name)
63
    {
64
        $message = sprintf(
65
            '"%s" must be a non-empty string, "%s" given',
66
            $name,
67
            (is_object($value) ? get_class($value) : gettype($value))
68
        );
69
70
        Assert\that($value)->string($message)->notEmpty($message);
71
    }
72
73
    public function toHttpQuery()
74
    {

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

@@ 44-53 (lines=10) @@
41
        return $this;
42
    }
43
44
    private function assertNonEmptyString($value, $name)
45
    {
46
        $message = sprintf(
47
            '"%s" must be a non-empty string, "%s" given',
48
            $name,
49
            (is_object($value) ? get_class($value) : gettype($value))
50
        );
51
52
        Assert\that($value)->string($message)->notEmpty($message);
53
    }
54
55
    public function toHttpQuery()
56
    {

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

@@ 73-82 (lines=10) @@
70
        return $this;
71
    }
72
73
    private function assertNonEmptyString($value, $name)
74
    {
75
        $message = sprintf(
76
            '"%s" must be a non-empty string, "%s" given',
77
            $name,
78
            (is_object($value) ? get_class($value) : gettype($value))
79
        );
80
81
        Assert\that($value)->string($message)->notEmpty($message);
82
    }
83
84
    public function toHttpQuery()
85
    {

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

@@ 169-178 (lines=10) @@
166
     * @param string      $parameterName
167
     * @param string|null $message
168
     */
169
    private function assertNonEmptyString($value, $parameterName, $message = null)
170
    {
171
        $message = sprintf(
172
            $message ?: '"%s" must be a non-empty string, "%s" given',
173
            $parameterName,
174
            (is_object($value) ? get_class($value) : gettype($value))
175
        );
176
177
        Assert\that($value)->string($message)->notEmpty($message);
178
    }
179
180
    /**
181
     * @param array $values