Skip to content

Commit 871f555

Browse files
committed
update, format codes
1 parent 340346f commit 871f555

40 files changed

+583
-690
lines changed

libs/asset/AssetBag.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212

1313
/**
1414
* 命名资源 -- 保存了指定名称的一组资源 (reference Yii2 AssetBundle)
15-
*
1615
* AssetManager::loadAsset($name, $assets)
17-
*
1816
* Class AssetBag
1917
* @package Inhere\Library\asset
2018
*/
@@ -29,34 +27,27 @@ class AssetBag extends StdObject
2927
/**
3028
* @var string the directory that contains the source asset files for this asset bundle.
3129
* A source asset file is a file that is part of your source code repository of your Web application.
32-
*
3330
* You must set this property if the directory containing the source asset files is not Web accessible.
3431
* By setting this property, [[AssetManager]] will publish the source asset files
3532
* to a Web-accessible directory automatically when the asset bundle is registered on a page.
36-
*
3733
* If you do not set this property, it means the source asset files are located under [[basePath]].
38-
*
3934
* You can use either a directory or an alias of the directory.
4035
* @see $publishOptions
4136
*/
4237
public $sourcePath;
4338

4439
/**
4540
* @var string the Web-accessible directory that contains the asset files in this bundle.
46-
*
4741
* If [[sourcePath]] is set, this property will be *overwritten* by [[AssetManager]]
4842
* when it publishes the asset files from [[sourcePath]].
49-
*
5043
* You can use either a directory or an alias of the directory.
5144
*/
5245
public $basePath;
5346

5447
/**
5548
* @var string the base URL for the relative asset files listed in [[js]] and [[css]].
56-
*
5749
* If [[sourcePath]] is set, this property will be *overwritten* by [[AssetManager]]
5850
* when it publishes the asset files from [[sourcePath]].
59-
*
6051
* You can use either a URL or an alias of the URL.
6152
*/
6253
public $baseUrl;

libs/asset/AssetLoad.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,18 @@
1616
use Inhere\Library\Files\Directory;
1717
use Inhere\Library\Files\File;
1818
use Inhere\Library\Helpers\UrlHelper;
19-
use Inhere\LibraryPlus\Html\Html;
2019
use Inhere\Library\StdObject;
20+
use Inhere\LibraryPlus\Html\Html;
2121
use MatthiasMullie\Minify;
2222

2323
/**
2424
* Class AssetLoad
2525
* @package Inhere\Library\asset
26-
*
2726
* usage (in template file):
28-
*
2927
* <?php
30-
*
3128
* echo AssetLoad::css([
3229
* 'xx/zz.css',
3330
* ])->dump();
34-
*
3531
*/
3632
class AssetLoad extends StdObject
3733
{
@@ -146,9 +142,7 @@ public static function js($asset, array $options = [])
146142
}
147143

148144
/**
149-
*
150145
* @param string|array $assets 要加载的资源
151-
*
152146
* 1. $assets = 'file path' 加载一个文件
153147
* 2. $assets = 'a,b,c' 加载 a,b,c 多个文件
154148
* 3. 直接使用数组配置
@@ -159,7 +153,6 @@ public static function js($asset, array $options = [])
159153
* 'file4',
160154
* ...
161155
* ]
162-
*
163156
* @param string $assetType 资源文件类型 css js
164157
* @return $this
165158
* @throws InvalidArgumentException
@@ -486,18 +479,15 @@ public function setCheckFileExists($value)
486479

487480
/**
488481
* get base path
489-
*
490482
* maybe path use alias. (e.g. like '@app' --> '/xx/yy/app')
491483
* you can define
492-
*
493484
* $this->resolvePath = function($path) {
494485
* if ( $path{0} ==='@' ) {
495486
* // some handle logic ... ...
496487
* // $path = App::resolvePath($basePath);
497488
* }
498489
* return $path;
499490
* }
500-
*
501491
* @return string
502492
*/
503493
public function getBasePath()

libs/asset/AssetManager.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* 前端资源加载管理
1818
* - 允许设定加载位置
1919
* - 自动注入到HTML中指定位置
20-
*
2120
* Class AssetManager
2221
* @package Inhere\Library\asset
2322
*/
@@ -26,12 +25,9 @@ class AssetManager extends StdObject
2625
/**
2726
* asset bag list
2827
* @var array
29-
*
3028
* e.g:
31-
*
3229
* $bags = [
3330
* self::POS_BODY => [
34-
*
3531
* ],
3632
* self::POS_END => [
3733
* ''
@@ -120,9 +116,7 @@ class AssetManager extends StdObject
120116

121117
/**
122118
* register named asset
123-
*
124119
* e.g.
125-
*
126120
* $manager->loadAsset('homePage',[
127121
* 'css' => [
128122
* 'xx/zz.css',
@@ -134,7 +128,6 @@ class AssetManager extends StdObject
134128
* 'cssOptions' => [],
135129
* 'jsOptions' => [],
136130
* ]);
137-
*
138131
* @param array|AssetBag $name define zhe asset name. 当前注册资源添加命名标记
139132
* @param array $config 要添加的资源以及相关选项
140133
* @return $this
@@ -361,10 +354,8 @@ public function getAssetTypes()
361354

362355
/**
363356
* 自动注入资源到指定的位置
364-
*
365357
* - 在渲染好html后,输出html字符之前调用此方法
366358
* `$html = $manager->injectAssets($html);`
367-
*
368359
* @param string $html html document string
369360
* @return mixed|string [type]
370361
*/
@@ -505,7 +496,6 @@ public function getBaseUrl()
505496

506497
/**
507498
* Gets the $baseUrl 对应的物理路径
508-
*
509499
* @return string
510500
*/
511501
public function getBasePath()
@@ -518,9 +508,7 @@ public function getBasePath()
518508
* @example
519509
* $baseUrl: '/static/'
520510
* $basePath: 'D:/www/web/static/'.
521-
*
522511
* @param string $basePath the base path
523-
*
524512
* @return self
525513
*/
526514
protected function setBasePath($basePath)

libs/auth/IdentityInterface.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,33 @@
1010

1111
/**
1212
* IdentityInterface is the interface that should be implemented by a class providing identity information.
13-
*
1413
* This interface can typically be implemented by a user model class. For example, the following
1514
* code shows how to implement this interface by a User ActiveRecord class:
16-
*
1715
* ```php
1816
* class User extends RecordModel implements IdentityInterface
1917
* {
2018
* public static function findIdentity($id)
2119
* {
2220
* return static::findByPk($id);
2321
* }
24-
*
2522
* public static function findIdentityByAccessToken($token, $type = null)
2623
* {
2724
* return static::findOne(['access_token' => $token]);
2825
* }
29-
*
3026
* public function getId()
3127
* {
3228
* return $this->id;
3329
* }
34-
*
3530
* public function getAuthKey()
3631
* {
3732
* return $this->authKey;
3833
* }
39-
*
4034
* public function validateAuthKey($authKey)
4135
* {
4236
* return $this->authKey === $authKey;
4337
* }
4438
* }
4539
* ```
46-
*
4740
*/
4841
interface IdentityInterface
4942
{

libs/auth/StorageInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
interface StorageInterface
1616
{
1717
public function get($key, $default = null);
18+
1819
public function set($key, $value);
1920
}

libs/auth/User.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@
88

99
namespace Inhere\LibraryPlus\Auth;
1010

11+
use Inhere\Exceptions\InvalidArgumentException;
12+
use Inhere\Exceptions\InvalidConfigException;
1113
use Inhere\Library\Collections\CollectionInterface;
1214
use Inhere\Library\Collections\SimpleCollection;
1315
use Inhere\Library\Helpers\Obj;
14-
use Inhere\Exceptions\InvalidArgumentException;
15-
use Inhere\Exceptions\InvalidConfigException;
1616

1717
/**
1818
* Class User
1919
* @package Inhere\LibraryPlus\Auth
20-
*
2120
* @property int id
2221
*/
2322
class User extends SimpleCollection

libs/env/AbstractEnv.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ abstract class AbstractEnv extends SimpleCollection
2626
* 初始化信息
2727
* @param array $data
2828
*/
29-
public function __construct(array $data=[])
29+
public function __construct(array $data = [])
3030
{
3131
parent::__construct($data);
3232

@@ -38,5 +38,6 @@ public function __construct(array $data=[])
3838
}
3939

4040
public function init()
41-
{}
41+
{
42+
}
4243
}

0 commit comments

Comments
 (0)