Skip to content

Commit

Permalink
Fixes the filter loading issue
Browse files Browse the repository at this point in the history
remp/crm#1135

(cherry picked from commit baeba8e)
  • Loading branch information
miroc committed May 26, 2022
1 parent 7b76d3d commit fe18c19
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [0.32.3] - 2022-05-26

- Fixed deprecated warning because of using `Latte#addFilter()` method. remp/crm#1135
- Fixed the filter loading issue. remp/crm#1135

## [0.32.2] - 2022-05-11

Expand Down
12 changes: 5 additions & 7 deletions Mailer/extensions/mailer-module/src/Filters/FilterLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@

class FilterLoader
{
/** @var array All registered filters */
private $filters = [];
/** All registered filters */
private array $filters = [];

/**
* Check if filter is registered, call filter if is registered
*
* @param string $helper
* @return mixed
* @return ?callable
*/
public function load(string $helper)
public function load(string $helper): ?callable
{
if (isset($this->filters[$helper])) {
return call_user_func_array($this->filters[$helper], array_slice(func_get_args(), 1));
}
return $this->filters[$helper] ?? null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ class YesNoFilter
{
public function process(int $input): string
{
return (boolean)$input ? 'Yes' : 'No';
return (boolean) $input ? 'Yes' : 'No';
}
}

0 comments on commit fe18c19

Please sign in to comment.