Skip to content

Commit

Permalink
Fix argument 2 for trigger_error (#549)
Browse files Browse the repository at this point in the history
It also removes some trailing comma in function calls.
  • Loading branch information
franmomu authored Mar 22, 2021
1 parent 183bd6a commit 244f358
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/Datagrid/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function countResults(): int

@trigger_error(sprintf(
'Relying on the protected property "%s::$nbResults" and its getter/setter is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.7 and will fail 4.0. Use "countResults()" and "setResultsCount()" instead.',
self::class,
self::class
), \E_USER_DEPRECATED);

return $deprecatedCount;
Expand All @@ -63,7 +63,7 @@ public function getNbResults()
if ('sonata_deprecation_mute' !== (\func_get_args()[0] ?? null)) {
@trigger_error(sprintf(
'The %s() method is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.7 and will be removed in 4.0. Use "countResults()" instead.',
__METHOD__,
__METHOD__
), \E_USER_DEPRECATED);
}

Expand All @@ -82,7 +82,7 @@ public function computeNbResult()
if ('sonata_deprecation_mute' !== (\func_get_args()[0] ?? null)) {
@trigger_error(sprintf(
'The %s() method is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.7 and will be removed in 4.0.',
__METHOD__,
__METHOD__
), \E_USER_DEPRECATED);
}

Expand All @@ -104,7 +104,7 @@ public function getResults()
@trigger_error(sprintf(
'Method "%s()" is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.7 and will'
.' be removed in 4.0. Use "getCurrentPageResults()" instead.',
__METHOD__,
__METHOD__
), \E_USER_DEPRECATED);

return $this->getCurrentPageResults();
Expand Down Expand Up @@ -154,7 +154,7 @@ protected function setNbResults($nb)
if ('sonata_deprecation_mute' !== (\func_get_args()[1] ?? null)) {
@trigger_error(sprintf(
'The %s() method is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.7 and will be removed in 4.0. Use "setResultsCount()" instead.',
__METHOD__,
__METHOD__
), \E_USER_DEPRECATED);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Filter/AbstractDateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function filter(BaseProxyQueryInterface $query, $alias, $field, $data)
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);
}

//check data sanity
Expand Down Expand Up @@ -164,7 +164,7 @@ protected function applyType(BaseProxyQueryInterface $query, $operation, $field,
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);
}

$query->getQueryBuilder()->field($field)->$operation($datetime);
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/BooleanFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function filter(BaseProxyQueryInterface $query, $alias, $field, $data)
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);
}

if (!$data || !\is_array($data) || !\array_key_exists('type', $data) || !\array_key_exists('value', $data)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/CallbackFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function filter(BaseProxyQueryInterface $query, $alias, $field, $data)
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);
}

if (!\is_callable($this->getOption('callback'))) {
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/ChoiceFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function filter(BaseProxyQueryInterface $query, $alias, $field, $data)
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);
}

if (!$data || !\is_array($data) || !\array_key_exists('type', $data) || !\array_key_exists('value', $data)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/DateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function applyTypeIsEqual(BaseProxyQueryInterface $query, $field, $dat
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);
}

$end = clone $data['value'];
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/DateTimeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function applyTypeIsEqual(BaseProxyQueryInterface $query, $field, $dat
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);
}

/** @var \DateTime $end */
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function apply($query, $filterData)
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);

// throw new \TypeError(sprintf('The query MUST implement "%s".', ProxyQueryInterface::class));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/ModelFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function filter(BaseProxyQueryInterface $query, $alias, $field, $data)
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);
}

if (!$data || !\is_array($data) || !\array_key_exists('value', $data)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/NumberFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function filter(BaseProxyQueryInterface $query, $alias, $field, $data)
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);
}

if (!$data || !\is_array($data) || !\array_key_exists('value', $data) || !is_numeric($data['value'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/StringFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function filter(BaseProxyQueryInterface $query, $alias, $field, $data)
\get_class($query),
__METHOD__,
ProxyQueryInterface::class
));
), \E_USER_DEPRECATED);
}

if (!$data || !\is_array($data) || !\array_key_exists('value', $data) || null === $data['value']) {
Expand Down

0 comments on commit 244f358

Please sign in to comment.