mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
default value for sort input & fixes for strlen
This commit is contained in:
parent
ae5b9c0dd4
commit
f27cca7f09
@ -91,7 +91,7 @@ class BankIntegrationFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -124,7 +124,7 @@ class BankTransactionFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -62,7 +62,7 @@ class BankTransactionRuleFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -60,7 +60,7 @@ class ClientFilters extends QueryFilters
|
||||
{
|
||||
$parts = explode(':', $balance);
|
||||
|
||||
if (! is_array($parts)) {
|
||||
if (!is_array($sort_col) || count($sort_col) != 2) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ class ClientFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -43,7 +43,7 @@ class CompanyGatewayFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -100,7 +100,7 @@ class CreditFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -44,7 +44,7 @@ class DesignFilters extends QueryFilters
|
||||
*
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -41,7 +41,7 @@ class ExpenseCategoryFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -147,7 +147,7 @@ class ExpenseFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -77,7 +77,7 @@ class PaymentFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -42,7 +42,7 @@ class PaymentTermFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -58,7 +58,7 @@ class ProductFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -53,7 +53,7 @@ class ProjectFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Illuminate\Eloquent\Query\Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -115,7 +115,7 @@ class PurchaseOrderFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -126,7 +126,7 @@ class QuoteFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -55,7 +55,7 @@ class RecurringExpenseFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -98,7 +98,7 @@ class RecurringInvoiceFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -54,7 +54,7 @@ class RecurringQuoteFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -42,7 +42,7 @@ class SubscriptionFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -20,7 +20,7 @@ class SystemLogFilters extends QueryFilters
|
||||
{
|
||||
public function type_id(string $type_id = ''): Builder
|
||||
{
|
||||
if (strlen($type_id)) {
|
||||
if (strlen($type_id) == 0) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ class SystemLogFilters extends QueryFilters
|
||||
|
||||
public function category_id(string $category_id = ''): Builder
|
||||
{
|
||||
if (strlen($category_id)) {
|
||||
if (strlen($category_id) == 0) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ class SystemLogFilters extends QueryFilters
|
||||
|
||||
public function event_id(string $event_id = ''): Builder
|
||||
{
|
||||
if (strlen($event_id)) {
|
||||
if (strlen($event_id) == 0) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ class SystemLogFilters extends QueryFilters
|
||||
*/
|
||||
public function filter(string $filter = ''): Builder
|
||||
{
|
||||
if (strlen($filter)) {
|
||||
if (strlen($filter) == 0) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ class SystemLogFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -97,7 +97,7 @@ class TaskFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -42,7 +42,7 @@ class TaskStatusFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -42,7 +42,7 @@ class TaxRateFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -42,7 +42,7 @@ class TokenFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -46,7 +46,7 @@ class UserFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
@ -80,8 +80,9 @@ class UserFilters extends QueryFilters
|
||||
public function with(string $value = ''): Builder
|
||||
{
|
||||
|
||||
if(strlen($value) == 0)
|
||||
if(strlen($value) == 0) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
return $this->builder
|
||||
->orWhere($this->with_property, $value)
|
||||
|
@ -61,7 +61,7 @@ class VendorFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
@ -42,7 +42,7 @@ class WebhookFilters extends QueryFilters
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort): Builder
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user