conditions->get( (string) ( $condition['type'] ?? '' ) ); if ( ! $object || ! $object->matches( $condition, $context, $this ) ) { return false; } } return true; } /** * Whether the list contains conditions that are not registered (top level). * * @param array $conditions Condition list. */ public function has_unknown( array $conditions ): bool { foreach ( $conditions as $condition ) { if ( ! is_array( $condition ) || ! $this->conditions->has( (string) ( $condition['type'] ?? '' ) ) ) { return true; } } return false; } /** * Context dependencies of a list (for frontend resync). * * @param array $conditions Condition list. * @return string[] */ public function dependencies( array $conditions ): array { $deps = array(); foreach ( $conditions as $condition ) { $object = is_array( $condition ) ? $this->conditions->get( (string) ( $condition['type'] ?? '' ) ) : null; if ( $object ) { $deps = array_merge( $deps, $object->context_dependencies() ); } } return array_values( array_unique( $deps ) ); } }