This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version = NetBeans IDE 8.0.2 (Build 201411181905) Operating System = Windows 7 version 6.1 running on amd64 Java; VM; Vendor = 1.7.0_71 Runtime = Java HotSpot(TM) 64-Bit Server VM 24.71-b01 Begin at "if ($archiveStatus) {" Closure format indentation is wrong. <?php namespace backend\models\search; use Yii; use yii\base\Model; use yii\data\ActiveDataProvider; use common\models\AddonAritcle; use common\models\Archive; /** * AddonAritcleSearch represents the model behind the search form about `common\models\AddonAritcle`. */ class AddonAritcleSearch extends AddonAritcle { /** * @inheritdoc */ public function rules() { return [ [['aid'], 'integer'], [['content', 'archive.status'], 'safe'], ]; } public function attributes() { return array_merge(parent::attributes(), ['archive.status']); } /** * @inheritdoc */ public function scenarios() { // bypass scenarios() implementation in the parent class return Model::scenarios(); } /** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = AddonAritcle::find() ->from(['article' => AddonAritcle::tableName()]) ->with(['archive.channel' => function($query) { $query->from(['channel' => \common\models\Channel::tableName()]) ->select(['channel.id', 'channel.channel_name']); }]); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { return $dataProvider; } //get value $archiveStatus = $this->getAttribute('archive.status'); if ($archiveStatus) { $query->joinWith([ 'archive' => function($query) { $query->from(['archive' => Archive::tableName()]); $query->select(['archive.aid', 'archive.channel_id', 'archive.status', 'archive.title', 'archive.click', 'archive.top1', 'archive.top2']); }]); $query->andFilterWhere([ 'archive.status' => $this->getAttribute('archive.status'), ]); } else { $query->with([ 'archive' => function($query) { $query->select(['status', 'title','click', 'top1', 'top2']); }, ]); } $query->andFilterWhere([ 'article.aid' => $this->aid, ]); $query->andFilterWhere(['like', 'article.content', $this->content]); return $dataProvider; } }
Created attachment 154063 [details] IDE log
IMHO your source code should look like this: -------------------------------------------------------- $query->joinWith([ 'archive' => function($query) { $query->from(['archive' => Archive::tableName()]); $query->select(['archive.aid', 'archive.channel_id', 'archive.status', 'archive.title', 'archive.click', 'archive.top1', 'archive.top2']); } ]); -------------------------------------------------------- I mean that the chars "}])" should not be "grouped" together because then it is not possible to decide properly where exactly these chars should be placed. Also, please note that these chars, their "opening" variants, are not "grouped" at all. Thanks for reporting.