Completed
Push — master ( 5a3b36...5d92a3 )
by Peter
25:03
created

PostFilter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A filter() 0 12 3
1
<?php
2
3
/*
4
 * To change this license header, choose License Headers in Project Properties.
5
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7
 */
8
9
namespace Maslosoft\Signals\Helpers;
10
11
use Maslosoft\Signals\Interfaces\PostFilterInterface;
12
use Maslosoft\Signals\Interfaces\SignalInterface;
13
use Maslosoft\Signals\Signal;
14
15
/**
16
 * PostFilter
17
 *
18
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
19
 */
20
class PostFilter
21
{
22
23
	public static function filter(Signal $signals, $injected, SignalInterface $signal)
24
	{
25
		$preFilters = $signals->getFilters(PostFilterInterface::class);
26
		foreach ($preFilters as $filter)
27
		{
28
			if (!$filter->filter($injected, $signal))
0 ignored issues
show
Unused Code introduced by
The call to PostFilterInterface::filter() has too many arguments starting with $signal.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
29
			{
30
				return false;
31
			}
32
		}
33
		return true;
34
	}
35
36
}
37