Skip to content

Commit

Permalink
Merge pull request #22 from gietos/callback_event_configure_merge_fix
Browse files Browse the repository at this point in the history
Use `Yii::configure` instead of static call to `yii\base\Object` constructor
  • Loading branch information
Sergey Kasatkin committed Nov 14, 2017
2 parents 3e55558 + c5df2e6 commit 22f5882
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CallbackEvent.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?php

namespace omnilight\scheduling;
use Yii;
use yii\base\Application;
use yii\base\InvalidParamException;
use yii\base\Object;


/**
* Class CallbackEvent
Expand Down Expand Up @@ -34,7 +33,9 @@ public function __construct($callback, array $parameters = [], $config = [])
$this->callback = $callback;
$this->parameters = $parameters;

Object::__construct($config);
if (!empty($config)) {
Yii::configure($this, $config);
}

if ( ! is_string($this->callback) && ! is_callable($this->callback))
{
Expand Down Expand Up @@ -67,4 +68,4 @@ public function getSummaryForDisplay()
return is_string($this->callback) ? $this->callback : 'Closure';
}

}
}

0 comments on commit 22f5882

Please sign in to comment.