findings[] = $finding; } /** * Get every finding. * * @since 4.10.0 * * @return Finding[] */ public function all() { return $this->findings; } /** * Whether the run established nothing to report. * * @since 4.10.0 * * @return bool */ public function is_ok() { return empty( $this->findings ); } /** * Whether any finding gates the wizard's Continue action. * * @since 4.10.0 * * @return bool */ public function has_blocking() { foreach ( $this->findings as $finding ) { if ( $finding->is_blocking() ) { return true; } } return false; } /** * Whether the run reached no verdict. * * One inconclusive conjunct means the run as a whole reached no verdict. * * @since 4.10.0 * * @return bool */ public function is_inconclusive() { foreach ( $this->findings as $finding ) { if ( $finding->get_severity() === Finding::INCONCLUSIVE ) { return true; } } return false; } /** * Get the wire shape. * * @since 4.10.0 * * @return array */ public function to_array() { return array_map( function ( Finding $finding ) { return $finding->to_array(); }, $this->findings ); } }