Skip to content

Commit be65a56

Browse files
committed
在类的属性,常量,和方法之间添加空行。
1 parent c00cd90 commit be65a56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+526
-81
lines changed

.php_cs.dist

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ $config = PhpCsFixer\Config::create()
1919
'align_multiline_comment' => true,
2020
'array_indentation' => true,
2121
'array_syntax' => ['syntax' => 'short'],
22+
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
2223
'header_comment' => ['header' => $header],
2324
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
2425
'single_line_comment_style' => true,

services/AdminUser.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
class AdminUser extends Service
2121
{
2222
protected $_adminUserLoginModelName = '\fecshop\models\mysqldb\adminUser\AdminUserLogin';
23-
protected $_adminUserLoginModel;
2423

24+
protected $_adminUserLoginModel;
2525

2626
public function init()
2727
{
2828
parent::init();
2929
list($this->_adminUserLoginModelName, $this->_adminUserLoginModel) = \Yii::mapGet($this->_adminUserLoginModelName);
3030
}
31+
3132
/**
3233
* @property $ids | Int Array
3334
* @return 得到相应用户的数组。
@@ -85,7 +86,6 @@ protected function actionLoginAndGetAccessToken($username, $password)
8586
}
8687
}
8788

88-
8989
/**
9090
* @property $data|array
9191
* 数组格式:['username'=>'[email protected]','password'=>'xxxx']
@@ -113,8 +113,6 @@ protected function actionSetHeaderAccessToken($accessToken)
113113
}
114114
}
115115

116-
117-
118116
/** AppServer 部分使用的函数
119117
* @property $type | null or Object
120118
* 从request headers中获取access-token,然后执行登录

services/Application.php

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
class Application
2323
{
2424
public $childService;
25+
2526
public $_childService;
2627

2728
/**
@@ -57,6 +58,7 @@ public function getChildService($childServiceName)
5758

5859
return $this->_childService[$childServiceName];
5960
}
61+
6062
/**
6163
* @property $attr | String , service的name。
6264
* 魔术方法,当调用一个属性,对象不存在的时候就会执行该方法,然后

services/Cache.php

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Cache extends Service
2323
{
2424
// 各个页面cache的配置
2525
public $cacheConfig;
26+
2627
// cache 总开关
2728
public $enable;
2829

services/Cart.php

+1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ protected function actionUpdateGuestCart($address, $shipping_method, $payment_me
193193
{
194194
return Yii::$service->cart->quote->updateGuestCart($address, $shipping_method, $payment_method);
195195
}
196+
196197
/**
197198
* @property $address_id | Int
198199
* @property $shipping_method | String 货运方式

services/Category.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ class Category extends Service
2626
* 可以在配置中更改,更改后,就会通过容器注入的方式修改相应的配置值
2727
*/
2828
public $storage = 'CategoryMongodb'; // 当前的storage,如果在config中配置,那么在初始化的时候会被注入修改
29+
2930
/**
3031
* 设置storage的path路径,
3132
* 如果不设置,则系统使用默认路径
3233
* 如果设置了路径,则使用自定义的路径
3334
*/
3435
public $storagePath = '';
36+
3537
protected $_category;
3638

3739
/**
@@ -52,8 +54,6 @@ public function init()
5254
*/
5355
}
5456

55-
56-
5757
protected function actionGetCategoryEnableStatus()
5858
{
5959
return $this->_category->getCategoryEnableStatus();
@@ -88,6 +88,7 @@ protected function actionGetByPrimaryKey($primaryKey)
8888
{
8989
return $this->_category->getByPrimaryKey($primaryKey);
9090
}
91+
9192
/**
9293
* @property $urlKey | String or Int , Url Key
9394
* 通过主键,得到category info

services/Customer.php

+17-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,19 @@
2424
class Customer extends Service
2525
{
2626
public $customer_register;
27+
2728
const USER_LOGIN_SUCCESS_REDIRECT_URL_KEY = 'usr_login_success_redirect_url';
2829

2930
protected $_customerModelName = '\fecshop\models\mysqldb\Customer';
31+
3032
protected $_customerModel;
33+
3134
protected $_customerLoginModelName = '\fecshop\models\mysqldb\customer\CustomerLogin';
35+
3236
protected $_customerLoginModel;
37+
3338
protected $_customerRegisterModelName = '\fecshop\models\mysqldb\customer\CustomerRegister';
39+
3440
protected $_customerRegisterModel;
3541

3642
public function init()
@@ -45,6 +51,7 @@ public function init()
4551
list($this->_customerLoginModelName, $this->_customerLoginModel) = \Yii::mapGet($this->_customerLoginModelName);
4652
list($this->_customerRegisterModelName, $this->_customerRegisterModel) = \Yii::mapGet($this->_customerRegisterModelName);
4753
}
54+
4855
/**
4956
* 注册用户名字的最小长度.
5057
*/
@@ -147,6 +154,7 @@ protected function actionRegister($param)
147154
}
148155
return false;
149156
}
157+
150158
/**
151159
* @property $email | String , email字符串
152160
* 查看该email是否被注册过。
@@ -160,6 +168,7 @@ protected function actionIsRegistered($email)
160168
return false;
161169
}
162170
}
171+
163172
/**
164173
* @property $param | array ,用户的数组
165174
* 数据格式如下:
@@ -237,6 +246,7 @@ protected function actionGetModelName()
237246

238247
return get_class($model);
239248
}
249+
240250
/**
241251
* 通过主键,得到customer model
242252
*/
@@ -372,6 +382,7 @@ protected function actionGetLoginSuccessRedirectUrl()
372382

373383
return $url ? $url : '';
374384
}
385+
375386
/**
376387
* @property $urlKey | String
377388
* **注意**:该方法不能在接口类型里面使用
@@ -412,13 +423,15 @@ protected function actionGetStatusActive()
412423
$model = $this->_customerModel;
413424
return $model::STATUS_ACTIVE;
414425
}
426+
415427
/**
416428
* 得到customer 表的主键(mysql表)
417429
*/
418430
protected function actionGetPrimaryKey()
419431
{
420432
return 'id';
421433
}
434+
422435
/**
423436
* @property $filter|array
424437
* get collection by $filter
@@ -447,7 +460,6 @@ protected function actionColl($filter = '')
447460
];
448461
}
449462

450-
451463
/**
452464
* @property $id | String 主键值
453465
* 通过主键值找到分类,并且删除分类在url rewrite表中的记录
@@ -497,6 +509,7 @@ protected function actionGetEmailByIds($user_ids)
497509
}
498510

499511
//2. 创建第三方用户的账户,密码自动生成
512+
500513
/**
501514
* @property $user | Array ,example:
502515
* ['first_name' => $first_name,'last_name' => $last_name,'email' => $email,]
@@ -555,6 +568,7 @@ protected function getRandomPassword()
555568
//return $authnum;
556569
return $authnum;
557570
}
571+
558572
/** AppServer 部分使用的函数
559573
* @property $email | String
560574
* @property $password | String
@@ -596,6 +610,7 @@ protected function actionLoginAndGetAccessToken($email, $password)
596610
return $identity->access_token;
597611
}
598612
}
613+
599614
/** AppServer 部分使用的函数
600615
* @property $type | null or Object
601616
* 从request headers中获取access-token,然后执行登录
@@ -631,6 +646,7 @@ protected function actionLoginByAccessToken($type = null)
631646
}
632647
}
633648
}
649+
634650
/**
635651
* 通过accessToek的方式,进行登出从操作。
636652
*/
@@ -649,7 +665,6 @@ public function logoutByAccessToken()
649665

650666
return $userComponent->getIsGuest();
651667
}
652-
653668

654669
protected function actionSetHeaderAccessToken($accessToken)
655670
{

services/Email.php

+5
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,20 @@
2020
class Email extends Service
2121
{
2222
public $mailerConfig;
23+
2324
public $defaultForm;
25+
2426
public $mailerInfo;
27+
2528
/**
2629
* 邮件模板部分动态数据提供类的返回数据的函数名字,使用默认值即可。
2730
*/
2831
public $defaultObMethod = 'getLastData';
2932

3033
protected $_mailer; // Array
34+
3135
protected $_mailer_from; //Array
36+
3237
protected $_from;
3338

3439
/**

services/FecshopLang.php

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Fecshoplang extends Service
2828
* default language.
2929
*/
3030
public $defaultLangCode;
31+
3132
protected $_allLangCode;
3233

3334
/**
@@ -39,6 +40,7 @@ protected function actionGetLangAttrName($attrName, $langCode)
3940
{
4041
return $attrName.'_'.$langCode;
4142
}
43+
4244
/**
4345
* @property $attrName | String 属性名称
4446
* 得到默认语言的属性名称
@@ -47,6 +49,7 @@ protected function actionGetDefaultLangAttrName($attrName)
4749
{
4850
return $attrName.'_'.$this->defaultLangCode;
4951
}
52+
5053
/**
5154
* 得到所有的语言简码,譬如:en,es,fr,zh,de等
5255
*/

services/Helper.php

+3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
class Helper extends Service
2121
{
2222
protected $_app_name;
23+
2324
protected $_param;
25+
2426
/**
2527
* 得到当前的app入口的名字,譬如 appfront apphtml5 appserver等.
2628
*/
@@ -71,6 +73,7 @@ public function getAppServiceDomain()
7173
{
7274
return isset($this->_param['appServiceDomain']) ? $this->_param['appServiceDomain'] : false;
7375
}
76+
7477
/**
7578
* 该端口是否是Api入口,譬如appserver appapi等,都是属于api的入口
7679
* api入口都会将 Yii::$app->user->enableSession 关闭,因此通过该值判断, 是否是Api App

services/Image.php

+4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ class Image extends Service
2525
* absolute image save floder.
2626
*/
2727
public $imageFloder = 'media/upload';
28+
2829
/**
2930
* upload image max size (MB).
3031
*/
3132
public $maxUploadMSize = 2;
33+
3234
/**
3335
* allow image type.
3436
*/
@@ -41,6 +43,7 @@ class Image extends Service
4143
];
4244

4345
protected $_maxUploadSize;
46+
4447
public $appbase;
4548

4649
/**
@@ -154,6 +157,7 @@ protected function actionGetDirByRelativePath($str)
154157
{
155158
return $this->GetImgDir($this->imageFloder.$str, 'common');
156159
}
160+
157161
/**
158162
* @property $name | String , 图片的原始名字,也就是图片上传的时候的名字。
159163
* @property $length | String , 生成图片随机字符的长度。

0 commit comments

Comments
 (0)