Skip to content

Commit f5932d7

Browse files
timacdonaldtaylorotwell
authored andcommitted
added isNotEmpty methods (#19944)
1 parent 3f69b1e commit f5932d7

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

src/Illuminate/Contracts/Pagination/Paginator.php

+7
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ public function hasMorePages();
9999
*/
100100
public function isEmpty();
101101

102+
/**
103+
* Determine if the list of items is not empty.
104+
*
105+
* @return bool
106+
*/
107+
public function isNotEmpty();
108+
102109
/**
103110
* Render the paginator using a given view.
104111
*

src/Illuminate/Contracts/Support/MessageBag.php

+7
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ public function setFormat($format = ':message');
8484
*/
8585
public function isEmpty();
8686

87+
/**
88+
* Determine if the message bag has any messages.
89+
*
90+
* @return bool
91+
*/
92+
public function isNotEmpty();
93+
8794
/**
8895
* Get the number of messages in the container.
8996
*

src/Illuminate/Pagination/AbstractPaginator.php

+10
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,16 @@ public function isEmpty()
465465
return $this->items->isEmpty();
466466
}
467467

468+
/**
469+
* Determine if the list of items is not empty.
470+
*
471+
* @return bool
472+
*/
473+
public function isNotEmpty()
474+
{
475+
return $this->items->isNotEmpty();
476+
}
477+
468478
/**
469479
* Get the number of items for the current page.
470480
*

src/Illuminate/Support/MessageBag.php

+10
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,16 @@ public function isEmpty()
321321
return ! $this->any();
322322
}
323323

324+
/**
325+
* Determine if the message bag has any messages.
326+
*
327+
* @return bool
328+
*/
329+
public function isNotEmpty()
330+
{
331+
return $this->any();
332+
}
333+
324334
/**
325335
* Determine if the message bag has any messages.
326336
*

0 commit comments

Comments
 (0)