Issues (1369)

classes/Pages/PageQuest.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * Created by Gorlum 12.02.2017 8:51
4
 */
5
6
namespace Pages;
7
8
use \SN;
0 ignored issues
show
The type \SN was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
class PageQuest extends PageAjax {
11
  /**
12
   * List of allowed actions for this page
13
   *
14
   * @var array[] $allowedActions [(string)action] => true
15
   */
16
  protected $allowedActions = [
17
    'saveFilter' => true,
18
  ];
19
20
  protected $filterQuestStatus = QUEST_STATUS_ALL;
21
22
  /**
23
   * Loading page data from page params
24
   */
25
  public function loadParams() {
26
    $this->filterQuestStatus = sys_get_param_int('filterQuestStatus', QUEST_STATUS_ALL);
27
    $this->checkParams();
28
  }
29
30
  protected function checkParams() {
31
    static $statuses = array(
32
      QUEST_STATUS_ALL => '',
33
      QUEST_STATUS_EXCEPT_COMPLETE => '',
34
      QUEST_STATUS_NOT_STARTED => '',
35
      QUEST_STATUS_STARTED => '',
36
      QUEST_STATUS_COMPLETE => '',
37
    );
38
39
    if(!isset($statuses[$this->filterQuestStatus])) {
40
      $this->filterQuestStatus = QUEST_STATUS_ALL;
41
    }
42
  }
43
44
  // Page Actions ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
45
  /**
46
   * Finishes current tutorial
47
   */
48
  public function saveFilter() {
49
    SN::$user_options[PLAYER_OPTION_QUEST_LIST_FILTER] = $this->filterQuestStatus;
50
    return array(
51
      'quest' => array(
52
        'filterQuestStatus' => $this->filterQuestStatus,
53
      ),
54
    );
55
  }
56
57
}
58