Completed
Push — try/capabilities ( 1eedd1...45f305 )
by
unknown
06:43
created

AllRule::check()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * A rule composed of other rules that must all be true
4
 *
5
 * @package automattic/jetpack-capabilities
6
 */
7
8
namespace Automattic\Jetpack\Capabilities;
9
10
// TODO: should this be called "AggregateRule"?
11
// phpcs:ignore Squiz.Commenting.ClassComment.Missing
12
class AllRule extends AggregateRule {
13
	// phpcs:ignore Squiz.Commenting.FunctionComment.Missing
14
	public function check( ...$args ) {
15
		$permission = new AggregatePermission();
16
		foreach ( $this->rules as $rule ) {
17
			$permission->add_permission( $rule->check() );
18
		}
19
		return $permission;
20
	}
21
}
22