Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions includes/Checker/Checks/Abstract_Runtime_Check.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Class WordPress\Plugin_Check\Checker\Checks\Abstract_Runtime_Check
*
* @package plugin-check
*/

namespace WordPress\Plugin_Check\Checker\Checks;

use WordPress\Plugin_Check\Checker\Check;
use WordPress\Plugin_Check\Checker\Preparation;
use WordPress\Plugin_Check\Checker\Check_Result;
use Exception;

/**
* Check for running one or more PHP CodeSniffer sniffs.
*
* @since n.e.x.t
*/
abstract class Abstract_Runtime_Check implements Check, Preparation {

/**
* Runs preparation step for the environment and returns a closure as a cleanup function.
*
* @since n.e.x.t
*
* @return callable Cleanup function to revert the changes made here.
*
* @throws Exception Thrown when preparation fails.
*/
abstract public function prepare();

/**
* Amends the given result by running the check on the associated plugin.
*
* @since n.e.x.t
*
* @param Check_Result $result The check result to amend, including the plugin context to check.
*
* @throws Exception Thrown when the check fails with a critical error (unrelated to any errors detected as part of
* the check).
*/
abstract public function run( Check_Result $result );
}