Issues (441)

common/config/main.php (2 issues)

Labels
Severity
1
<?php
2
return [
3
  'name' => "The Faster Scale App",
4
  'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
5
  'extensions' => require(__DIR__ . '/../../vendor/yiisoft/extensions.php'),
6
  'container' => [
7
    'definitions' => [
8
      'common\interfaces\UserInterface' => \common\models\User::class,
9
      'common\interfaces\UserBehaviorInterface' => \common\models\UserBehavior::class,
10
      'common\interfaces\QuestionInterface' => \common\models\Question::class,
11
      'common\interfaces\BehaviorInterface' => \common\models\Behavior::class,
12
      'common\interfaces\CategoryInterface' => \common\models\Category::class,
13
      'common\interfaces\CustomBehaviorInterface' => \common\models\CustomBehavior::class,
14
      'common\interfaces\TimeInterface' => function () {
15
        if(Yii::$app->user->getIsGuest()) {
0 ignored issues
show
The method getIsGuest() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        if(Yii::$app->user->/** @scrutinizer ignore-call */ getIsGuest()) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
16
          return new \common\components\Time('UTC');
17
        } else {
18
          return new \common\components\Time(Yii::$app->user->identity->timezone);
0 ignored issues
show
Accessing timezone on the interface yii\web\IdentityInterface suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
19
        }
20
      },
21
    ],
22
  ],
23
  'modules' => [
24
    'blog' => [
25
      'class' => \corwatts\MarkdownFiles\Module::class,
26
      'posts' => '@site/views/blog/posts',
27
      'drafts' => '@site/views/blog/drafts',
28
    ],
29
    'gridview' => '\kartik\grid\Module',
30
  ],
31
  'components' => [
32
    // by default, sessions are stored in a local file
33
    'cache' => [ // DummyCache never actually caches anything
34
      'class'=> yii\caching\DummyCache::class,
35
    ],
36
    'mailer' => [
37
      'class' => yii\swiftmailer\Mailer::class,
38
      'viewPath' => '@common/mail',
39
      'useFileTransport' => true,
40
    ],
41
  ],
42
  'aliases' => [
43
    '@bower' => '@vendor/bower-asset'
44
  ]
45
];
46