title: Yii2 Declaration beforeAction should be compatible with Controller
body: <p>Whenever I include the <code>beforeAction</code> function event with something simple I get an error saying it has to be compatible. This does not happen on my live server only on my local one. The only difference I can think of is my local server is running PHP7 and my live one is running PHP5.6. Is that what is causing the issue? The only thing I have found that will fix it is removing it completely.</p>
  
  <p>This is what my <code>beforeAction</code> looks like</p>
  
  <pre><code> public function beforeAction()
      { 
          if(Yii::$app-&gt;user-&gt;isGuest){
              return $this-&gt;redirect(['site/login']);
          } else {
              if(strtotime(UserInfo::findOne(Yii::$app-&gt;user-&gt;Id)-&gt;active_until) &lt; strtotime(date("Y-m-d H:i:s"))){
                  Yii::$app-&gt;session-&gt;setFlash('warning', 'You need an active subscription to access events.');
                  echo("&lt;script&gt;location.href = '".Url::toRoute('site/subscription')."';&lt;/script&gt;");
                  exit;
                  //return $this-&gt;redirect(['site/subscription']);
              }else {
                  return true;
              }
          }
      }
  </code></pre>
  
  <p>I also tried this simple one to check and got the same issue</p>
  
  <pre><code>public function beforeAction()
      {
          if (!parent::beforeAction($action)) {
              return false;
          }
          return true;
      }
  </code></pre>
  
  <p>Here is the error message I get</p>
  
  <pre><code>Declaration of frontend\controllers\EventController::beforeAction() should be compatible with yii\web\Controller::beforeAction($action)
  </code></pre>