mirror of
https://github.com/elyby/accounts.git
synced 2024-11-17 18:53:00 +05:30
Добавлен файл для автокомплита в проекте, обновлены обращения к di для лучшего статического анализа
This commit is contained in:
parent
dd0c4fcc9e
commit
2063d7daa0
@ -48,9 +48,7 @@ class OauthController extends Controller {
|
|||||||
* @return \League\OAuth2\Server\AuthorizationServer
|
* @return \League\OAuth2\Server\AuthorizationServer
|
||||||
*/
|
*/
|
||||||
protected function getServer() {
|
protected function getServer() {
|
||||||
/** @var \common\components\oauth\Component $oauth */
|
return Yii::$app->oauth->authServer;
|
||||||
$oauth = Yii::$app->get('oauth');
|
|
||||||
return $oauth->authServer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
42
autocompletion.php
Normal file
42
autocompletion.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Yii bootstrap file.
|
||||||
|
* Used for enhanced IDE code autocompletion.
|
||||||
|
* Note: To avoid "Multiple Implementations" PHPStorm warning and make autocomplete faster
|
||||||
|
* exclude or "Mark as Plain Text" vendor/yiisoft/yii2/Yii.php file
|
||||||
|
*/
|
||||||
|
class Yii extends \yii\BaseYii {
|
||||||
|
/**
|
||||||
|
* @var BaseApplication|WebApplication|ConsoleApplication the application instance
|
||||||
|
*/
|
||||||
|
public static $app;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class BaseApplication
|
||||||
|
* Used for properties that are identical for both WebApplication and ConsoleApplication
|
||||||
|
*
|
||||||
|
* @property \yii\swiftmailer\Mailer $mailer
|
||||||
|
* @property \yii\redis\Connection $redis
|
||||||
|
* @property \common\components\RabbitMQ\Component $amqp
|
||||||
|
*/
|
||||||
|
abstract class BaseApplication extends yii\base\Application {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class WebApplication
|
||||||
|
* Include only Web application related components here
|
||||||
|
*
|
||||||
|
* @property \api\components\User\Component $user User component.
|
||||||
|
* @property \api\components\ReCaptcha\Component $reCaptcha
|
||||||
|
* @property \common\components\oauth\Component $oauth
|
||||||
|
*/
|
||||||
|
class WebApplication extends yii\web\Application {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ConsoleApplication
|
||||||
|
* Include only Console application related components here
|
||||||
|
*/
|
||||||
|
class ConsoleApplication extends yii\console\Application {
|
||||||
|
}
|
@ -43,7 +43,7 @@ abstract class Controller extends \yii\console\Controller {
|
|||||||
* @return Component
|
* @return Component
|
||||||
*/
|
*/
|
||||||
protected function getAmqp() {
|
protected function getAmqp() {
|
||||||
return Yii::$app->get('amqp');
|
return Yii::$app->amqp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +9,7 @@ class Helper {
|
|||||||
* @return Component $amqp
|
* @return Component $amqp
|
||||||
*/
|
*/
|
||||||
public static function getInstance() {
|
public static function getInstance() {
|
||||||
return Yii::$app->get('amqp');
|
return Yii::$app->amqp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function sendToExchange($exchange, $routingKey, $message, $exchangeArgs = []) {
|
public static function sendToExchange($exchange, $routingKey, $message, $exchangeArgs = []) {
|
||||||
|
@ -12,7 +12,7 @@ class Key {
|
|||||||
* @return \yii\redis\Connection
|
* @return \yii\redis\Connection
|
||||||
*/
|
*/
|
||||||
public function getRedis() {
|
public function getRedis() {
|
||||||
return Yii::$app->get('redis');
|
return Yii::$app->redis;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKey() {
|
public function getKey() {
|
||||||
|
@ -10,7 +10,7 @@ class Set extends Key implements IteratorAggregate {
|
|||||||
* @return \yii\redis\Connection
|
* @return \yii\redis\Connection
|
||||||
*/
|
*/
|
||||||
public static function getDb() {
|
public static function getDb() {
|
||||||
return Yii::$app->get('redis');
|
return Yii::$app->redis;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add($value) {
|
public function add($value) {
|
||||||
|
@ -3,21 +3,21 @@ return [
|
|||||||
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
|
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
|
||||||
'components' => [
|
'components' => [
|
||||||
'cache' => [
|
'cache' => [
|
||||||
'class' => 'yii\caching\FileCache',
|
'class' => yii\caching\FileCache::class,
|
||||||
],
|
],
|
||||||
'db' => [
|
'db' => [
|
||||||
'class' => 'yii\db\Connection',
|
'class' => yii\db\Connection::class,
|
||||||
'charset' => 'utf8',
|
'charset' => 'utf8',
|
||||||
],
|
],
|
||||||
'mailer' => [
|
'mailer' => [
|
||||||
'class' => 'yii\swiftmailer\Mailer',
|
'class' => yii\swiftmailer\Mailer::class,
|
||||||
'viewPath' => '@common/mail',
|
'viewPath' => '@common/mail',
|
||||||
],
|
],
|
||||||
'security' => [
|
'security' => [
|
||||||
'passwordHashStrategy' => 'password_hash',
|
'passwordHashStrategy' => 'password_hash',
|
||||||
],
|
],
|
||||||
'redis' => [
|
'redis' => [
|
||||||
'class' => 'yii\redis\Connection',
|
'class' => yii\redis\Connection::class,
|
||||||
],
|
],
|
||||||
'amqp' => [
|
'amqp' => [
|
||||||
'class' => \common\components\RabbitMQ\Component::class,
|
'class' => \common\components\RabbitMQ\Component::class,
|
||||||
|
Loading…
Reference in New Issue
Block a user