com web/bugs: Fix filtering logic: src/Repository/ReasonRepository.php
| From: | Sara Golemon | Date: | Thu, 18 Jul 2019 14:34:26 +0000 |
| Subject: | com web/bugs: Fix filtering logic: src/Repository/ReasonRepository.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-28239@lists.php.net to get a copy of this message | ||
Commit: 87120c33ebb565e547bd010c3f31f06529b846fd
Author: Sara Golemon <pollita@php.net> Thu, 18 Jul 2019 10:34:26 -0400
Parents: 4b52935a8675d6ff6d5b06258e6c74ef135fad35
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=87120c33ebb565e547bd010c3f31f06529b846fd
Log:
Fix filtering logic
Changed paths:
M src/Repository/ReasonRepository.php
Diff:
diff --git a/src/Repository/ReasonRepository.php b/src/Repository/ReasonRepository.php
index f46fdd7..9e4265a 100644
--- a/src/Repository/ReasonRepository.php
+++ b/src/Repository/ReasonRepository.php
@@ -414,11 +414,15 @@ your configure settings should be
*/
public function findByProject(string $project = ''): array
{
- $reasons = array_filter(
- self::REASONS,
- function ($reason) use ($project) {
- return ($reason['project'] ?? '') === $project;
- });
+ $reasons = self::REASONS;
+ if ($project !== '') {
+ $reasons = array_filter(
+ $reasons,
+ function ($reason) use ($project) {
+ return ((($reason['project'] ?? '') === $project) ||
+ (($reason['project'] ?? '') === ''));
+ });
+ }
$resolves = $variations = [];
foreach ($reasons as $row) {