Skip to content

Commit a98f8c2

Browse files
committed
Update exception messages.
1 parent dfc510c commit a98f8c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/DataListTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function filter(callable $callback): self
175175
public function filterBy(string $property, $value, string $operator = 'equal'): self
176176
{
177177
if (array_search($operator, ['equal', 'notEqual', 'regExp', 'notRegExp', 'startWith', 'notStartWith', 'endWith', 'notEndWith', 'inArray', 'notInArray']) === false) {
178-
throw new \InvalidArgumentException('Invalid operator (' . $operator . ')');
178+
throw new \InvalidArgumentException('Invalid operator specified (' . $operator . ')');
179179
}
180180
$this->internalDataListActions[] = ['filterBy', $property, $value, $operator];
181181
return $this;
@@ -197,14 +197,14 @@ public function sort(callable $callback): self
197197
* Sorts the elements of the list by specific property.
198198
*
199199
* @param string $property The property name.
200-
* @param string $order The sort order.
200+
* @param string $order The sort order. Available values: asc and desc
201201
* @return self A reference to the list.
202202
* @throws \InvalidArgumentException
203203
*/
204204
public function sortBy(string $property, string $order = 'asc'): self
205205
{
206206
if ($order !== 'asc' && $order !== 'desc') {
207-
throw new \InvalidArgumentException('The order argument must be \'asc\' or \'desc\'');
207+
throw new \InvalidArgumentException('Invalid order specified (' . $order . ')');
208208
}
209209
$this->internalDataListActions[] = ['sortBy', $property, $order];
210210
return $this;

0 commit comments

Comments
 (0)