Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions includes/rules.core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class RulesEntityController extends EntityPlusControllerExportable {
return $config;
}

public function save($rules_config, DatabaseTransaction $transaction = NULL) {
public function save($rules_config, ?DatabaseTransaction $transaction = NULL) {
$transaction = isset($transaction) ? $transaction : db_transaction();

// Load the stored entity, if any.
Expand Down Expand Up @@ -296,7 +296,7 @@ class RulesEntityController extends EntityPlusControllerExportable {
*
* @see EntityAPIControllerExportable::delete()
*/
public function delete($ids, DatabaseTransaction $transaction = NULL) {
public function delete($ids, ?DatabaseTransaction $transaction = NULL) {
$transaction = isset($transaction) ? $transaction : db_transaction();
// Use entity-load as ids may be the names as well as the ids.
$configs = $ids ? entity_load('rules_config', $ids) : array();
Expand Down Expand Up @@ -1745,7 +1745,7 @@ abstract class RulesAbstractPlugin extends RulesPlugin {
/**
* Execute the configured execution callback and log that.
*/
abstract protected function executeCallback(array $args, RulesState $state = NULL);
abstract protected function executeCallback(array $args, ?RulesState $state = NULL);

public function evaluate(RulesState $state) {
$this->processSettings();
Expand Down
6 changes: 3 additions & 3 deletions includes/rules.plugins.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class RulesAction extends RulesAbstractPlugin implements RulesActionInterface {
/**
* Execute the callback and update/save data as specified by the action.
*/
protected function executeCallback(array $args, RulesState $state = NULL) {
protected function executeCallback(array $args, ?RulesState $state = NULL) {
rules_log('Evaluating the action %name.', array(
'%name' => $this->label($this->elementName),
), RulesLog::INFO, $this);
Expand Down Expand Up @@ -107,7 +107,7 @@ class RulesCondition extends RulesAbstractPlugin implements RulesConditionInterf
return $this->negate;
}

protected function executeCallback(array $args, RulesState $state = NULL) {
protected function executeCallback(array $args, ?RulesState $state = NULL) {
$return = (bool) $this->__call('execute', empty($this->info['named parameter']) ? $args : array($args));
$return = $this->negate ? !$return : $return;
rules_log('The condition %name evaluated to %bool', array(
Expand Down Expand Up @@ -416,7 +416,7 @@ class RulesReactionRule extends Rule implements RulesTriggerableInterface {
/**
* Implements RulesTriggerableInterface::event().
*/
public function event($event_name, array $settings = NULL) {
public function event($event_name, ?array $settings = NULL) {
// Process any settings and determine the configured event's name.
if ($settings) {
$handler = rules_get_event_handler($event_name, $settings);
Expand Down
4 changes: 2 additions & 2 deletions rules.module
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function rules_action_set($variables = array(), $provides = array()) {
* (optional) This may be used to denote the beginning (TRUE) or the end
* (FALSE) of a new execution scope.
*/
function rules_log($msg, $args = array(), $priority = RulesLog::INFO, RulesPlugin $element = NULL, $scope = NULL) {
function rules_log($msg, $args = array(), $priority = RulesLog::INFO, ?RulesPlugin $element = NULL, $scope = NULL) {
static $logger, $settings;

// Statically cache the variable settings as this is called very often.
Expand Down Expand Up @@ -711,7 +711,7 @@ function rules_get_event_base_name($event_name) {
* @return RulesEventHandlerInterface
* The event handler.
*/
function rules_get_event_handler($event_name, array $settings = NULL) {
function rules_get_event_handler($event_name, ?array $settings = NULL) {
$event_name = rules_get_event_base_name($event_name);
$event_info = rules_get_event_info($event_name);
$class = !empty($event_info['class']) ? $event_info['class'] : 'RulesEventDefaultHandler';
Expand Down
2 changes: 1 addition & 1 deletion ui/ui.core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ class RulesPluginUI extends FacesExtender implements RulesPluginUIInterface {
* Generates a path using the given operation for the element with the given
* id of the configuration with the given name.
*/
public static function path($name, $op = NULL, RulesPlugin $element = NULL, $parameter = FALSE) {
public static function path($name, $op = NULL, ?RulesPlugin $element = NULL, $parameter = FALSE) {
$element_id = isset($element) ? $element->elementId() : FALSE;
if (isset(self::$basePath)) {
$base_path = self::$basePath;
Expand Down