Code Duplication    Length = 17-17 lines in 2 locations

src/Route.php 2 locations

@@ 82-98 (lines=17) @@
79
     * @param array|null $conditions An array of conditions to set.
80
     * @return Route|array
81
     */
82
    public function conditions($conditions = null) {
83
        if ($this->conditions === null) {
84
            $this->conditions = [];
85
        }
86
87
        if (is_array($conditions)) {
88
            $conditions = array_change_key_case($conditions);
89
90
            $this->conditions = array_replace(
91
                $this->conditions,
92
                $conditions
93
            );
94
            return $this;
95
        }
96
97
        return $this->conditions;
98
    }
99
100
    /**
101
     * Gets or sets the allowed http methods for this route.
@@ 144-160 (lines=17) @@
141
     * @param array|null $mappings An array of mappings to set.
142
     * @return Route|array Returns the current mappings or `$this` for fluent calls.
143
     */
144
    public function mappings($mappings = null) {
145
        if ($this->mappings === null) {
146
            $this->mappings = [];
147
        }
148
149
        if (is_array($mappings)) {
150
            $mappings = array_change_key_case($mappings);
151
152
            $this->mappings = array_replace(
153
                $this->mappings,
154
                $mappings
155
            );
156
            return $this;
157
        }
158
159
        return $this->mappings;
160
    }
161
162
    /**
163
     * Gets or sets the global mappings array that maps parameter names to mappings.