1
1
<?php
2
2
3
+ /*
4
+ * Asset Packagist
5
+ *
6
+ * @link https://github.com/hiqdev/asset-packagist
7
+ * @package asset-packagist
8
+ * @license BSD-3-Clause
9
+ * @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
10
+ */
11
+
3
12
namespace hiqdev \assetpackagist \models ;
4
13
5
- use Exception ;
6
14
use Composer \Factory ;
7
15
use Composer \IO \NullIO ;
16
+ use Exception ;
8
17
use hiqdev \assetpackagist \registry \RegistryFactory ;
9
18
10
19
class AssetPackage
@@ -19,7 +28,7 @@ class AssetPackage
19
28
protected $ _composer ;
20
29
protected $ _storage ;
21
30
22
- static protected $ _commonComposer ;
31
+ protected static $ _commonComposer ;
23
32
24
33
public function __construct ($ type , $ name )
25
34
{
@@ -40,20 +49,20 @@ public function checkType($type)
40
49
41
50
public function checkName ($ name )
42
51
{
43
- return strlen ($ name )> 1 ;
52
+ return strlen ($ name ) > 1 ;
44
53
}
45
54
46
55
public function getFullName ()
47
56
{
48
57
return static ::buildFullName ($ this ->_type , $ this ->_name );
49
58
}
50
59
51
- static public function buildFullName ($ type , $ name )
60
+ public static function buildFullName ($ type , $ name )
52
61
{
53
62
return $ type . '-asset/ ' . $ name ;
54
63
}
55
64
56
- static public function splitFullName ($ full )
65
+ public static function splitFullName ($ full )
57
66
{
58
67
list ($ temp , $ name ) = explode ('/ ' , $ full );
59
68
list ($ type , $ temp ) = explode ('- ' , $ temp );
@@ -76,7 +85,7 @@ public function getHash()
76
85
return $ this ->_hash ;
77
86
}
78
87
79
- static public function getCommonComposer ()
88
+ public static function getCommonComposer ()
80
89
{
81
90
if (static ::$ _commonComposer === null ) {
82
91
static ::$ _commonComposer = Factory::create (new NullIO ());
@@ -111,13 +120,13 @@ public function getIO()
111
120
}
112
121
113
122
/**
114
- * findOne
123
+ * findOne.
115
124
*
116
125
* @param string $type
117
126
* @param string $name
118
127
* @return static|null
119
128
*/
120
- static public function findOne ($ type , $ name )
129
+ public static function findOne ($ type , $ name )
121
130
{
122
131
$ package = new static ($ type , $ name );
123
132
$ package ->load ();
0 commit comments