Skip to content

Commit

Permalink
php 5.5 class
Browse files Browse the repository at this point in the history
  • Loading branch information
loveorigami committed Jun 17, 2016
1 parent 95f4c02 commit 43f5e54
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
],
"require": {
"yiisoft/yii2": ">=2.0.6",
"php": ">=5.5.0",
"components/highlightjs":"*",
"loveorigami/yii2-jsoneditor": "*",
"tpoxa/shortcodes": "dev-master"
Expand Down
2 changes: 1 addition & 1 deletion controllers/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'class' => VerbFilter::class,
'actions' => [
'delete' => ['post'],
],
Expand Down
2 changes: 1 addition & 1 deletion controllers/ItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'class' => VerbFilter::class,
'actions' => [
'delete' => ['post'],
],
Expand Down
2 changes: 1 addition & 1 deletion models/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function attributeLabels()
*/
public function getEvents()
{
return $this->hasMany(Event::className(), ['app_id' => 'id']);
return $this->hasMany(Event::class, ['app_id' => 'id']);
}

}
10 changes: 5 additions & 5 deletions models/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public function rules()
[['plugin_id', 'app_id'], 'required'],
[['plugin_id', 'status', 'pos'], 'integer'],
[['trigger_class', 'trigger_event', 'handler_method'], 'string', 'max' => 255],
[['data'], JsonValidator::className()],
//[['plugin_id'], 'exist', 'skipOnError' => true, 'targetClass' => Item::className(), 'targetAttribute' => ['id']],
//[['app_id'], 'exist', 'skipOnError' => true, 'targetClass' => App::className(), 'targetAttribute' => ['id']],
[['data'], JsonValidator::class],
//[['plugin_id'], 'exist', 'skipOnError' => true, 'targetClass' => Item::class, 'targetAttribute' => ['id']],
//[['app_id'], 'exist', 'skipOnError' => true, 'targetClass' => App::class, 'targetAttribute' => ['id']],
];

}
Expand Down Expand Up @@ -71,15 +71,15 @@ public function attributeLabels()
*/
public function getApp()
{
return $this->hasOne(App::className(), ['id' => 'app_id']);
return $this->hasOne(App::class, ['id' => 'app_id']);
}

/**
* @return \yii\db\ActiveQuery
*/
public function getPlugin()
{
return $this->hasOne(Item::className(), ['id' => 'plugin_id']);
return $this->hasOne(Item::class, ['id' => 'plugin_id']);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion models/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function attributeLabels()
*/
public function getEvents()
{
return $this->hasMany(Event::className(), ['plugin_id' => 'id']);
return $this->hasMany(Event::class, ['plugin_id' => 'id']);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion views/event/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<div class="row">
<div class="col-md-6">
<?= $form->field($model, 'data')->widget(Jsoneditor::className(),
<?= $form->field($model, 'data')->widget(Jsoneditor::class,
[
'editorOptions' => [
'modes' => ['code', 'form', 'text', 'tree', 'view'], // available modes
Expand Down

0 comments on commit 43f5e54

Please sign in to comment.