Skip to content

Commit f6aa46d

Browse files
committed
csfixed
1 parent 9f7d0b6 commit f6aa46d

22 files changed

+112
-72
lines changed

.php_cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
$header = <<<EOF
4-
asset-packagist.hiqdev.com
4+
Asset Packagist
55
6-
@link http://asset-packagist.hiqdev.com/
7-
@package asset-packagist.hiqdev.com
6+
@link https://github.com/hiqdev/asset-packagist
7+
@package asset-packagist
88
@license BSD-3-Clause
99
@copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
EOF;

src/_bootstrap.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

src/assets/AppAsset.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

src/config/common.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

src/config/console.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

src/config/hisite-web.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

src/config/params.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/
@@ -20,4 +20,3 @@
2020
$params,
2121
file_exists($local) ? require $local : []
2222
);
23-

src/config/web.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

src/console/AssetPackageController.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/
@@ -21,13 +21,13 @@ public function actionUpdate($type, $name)
2121
{
2222
$package = new AssetPackage($type, $name);
2323
$package->update();
24-
echo "updated " . $package->getHash() . ' ' . $package->getFullName() . "\n";
24+
echo 'updated ' . $package->getHash() . ' ' . $package->getFullName() . "\n";
2525
}
2626

2727
public function actionUpdateList()
2828
{
2929
while ($line = fgets(STDIN)) {
30-
list($full,) = preg_split('/\s+/', trim($line));
30+
list($full) = preg_split('/\s+/', trim($line));
3131
list($type, $name) = AssetPackage::splitFullName($full);
3232
$this->actionUpdate($type, $name);
3333
}
@@ -48,5 +48,4 @@ public function actionTest()
4848
$msg = file_exists($dir) ? 'exists' : 'DOES NOT EXIST';
4949
echo "$dir - $msg\n";
5050
}
51-
5251
}

src/controllers/PackagesController.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

src/controllers/SiteController.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

src/helpers/Locker.php

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
<?php
22

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+
312
namespace hiqdev\assetpackagist\helpers;
413

514
class Locker
615
{
7-
static protected $_handles = [];
8-
static protected $_instances = [];
16+
protected static $_handles = [];
17+
protected static $_instances = [];
918

1019
protected $_path;
1120
protected $_count = 0;
@@ -16,7 +25,7 @@ public function __construct($path)
1625
$this->_path = $path;
1726
}
1827

19-
static public function getInstance($path)
28+
public static function getInstance($path)
2029
{
2130
return isset(static::$_instances[$path]) ? static::$_instances[$path] : new static($path);
2231
}
@@ -28,7 +37,7 @@ protected function getHandle()
2837
$this->_handle = static::$_handles[$this->_path];
2938
} else {
3039
if (!file_exists($this->_path)) {
31-
if (file_put_contents($this->_path, 'lock') === FALSE) {
40+
if (file_put_contents($this->_path, 'lock') === false) {
3241
throw new Exception('failed create lock file');
3342
}
3443
}
@@ -56,7 +65,7 @@ public function lock()
5665

5766
public function release()
5867
{
59-
if ($this->_count<1) {
68+
if ($this->_count < 1) {
6069
throw new Exception('no lock to release');
6170
}
6271
if ($this->_count === 1) {
@@ -66,5 +75,4 @@ public function release()
6675
}
6776
--$this->_count;
6877
}
69-
7078
}

src/models/AssetPackage.php

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
<?php
22

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+
312
namespace hiqdev\assetpackagist\models;
413

5-
use Exception;
614
use Composer\Factory;
715
use Composer\IO\NullIO;
16+
use Exception;
817
use hiqdev\assetpackagist\registry\RegistryFactory;
918

1019
class AssetPackage
@@ -19,7 +28,7 @@ class AssetPackage
1928
protected $_composer;
2029
protected $_storage;
2130

22-
static protected $_commonComposer;
31+
protected static $_commonComposer;
2332

2433
public function __construct($type, $name)
2534
{
@@ -40,20 +49,20 @@ public function checkType($type)
4049

4150
public function checkName($name)
4251
{
43-
return strlen($name)>1;
52+
return strlen($name) > 1;
4453
}
4554

4655
public function getFullName()
4756
{
4857
return static::buildFullName($this->_type, $this->_name);
4958
}
5059

51-
static public function buildFullName($type, $name)
60+
public static function buildFullName($type, $name)
5261
{
5362
return $type . '-asset/' . $name;
5463
}
5564

56-
static public function splitFullName($full)
65+
public static function splitFullName($full)
5766
{
5867
list($temp, $name) = explode('/', $full);
5968
list($type, $temp) = explode('-', $temp);
@@ -76,7 +85,7 @@ public function getHash()
7685
return $this->_hash;
7786
}
7887

79-
static public function getCommonComposer()
88+
public static function getCommonComposer()
8089
{
8190
if (static::$_commonComposer === null) {
8291
static::$_commonComposer = Factory::create(new NullIO());
@@ -111,13 +120,13 @@ public function getIO()
111120
}
112121

113122
/**
114-
* findOne
123+
* findOne.
115124
*
116125
* @param string $type
117126
* @param string $name
118127
* @return static|null
119128
*/
120-
static public function findOne($type, $name)
129+
public static function findOne($type, $name)
121130
{
122131
$package = new static($type, $name);
123132
$package->load();

src/models/Storage.php

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
<?php
22

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+
312
namespace hiqdev\assetpackagist\models;
413

514
use hiqdev\assetpackagist\helpers\Locker;
6-
use Exception;
715
use Yii;
816
use yii\helpers\Json;
917

@@ -19,10 +27,10 @@ protected function __construct()
1927
$this->_path = Yii::getAlias('@storage', false);
2028
}
2129

22-
static public function getInstance()
30+
public static function getInstance()
2331
{
2432
if (static::$_instance === null) {
25-
static::$_instance = new Storage();
33+
static::$_instance = new self();
2634
}
2735

2836
return static::$_instance;
@@ -53,7 +61,7 @@ protected function readLastId()
5361
{
5462
$path = $this->getLastIDPath();
5563

56-
return file_exists($path) ? (int)file_get_contents($path) : 1000000;
64+
return file_exists($path) ? (int) file_get_contents($path) : 1000000;
5765
}
5866

5967
protected function writeLastId($value)

src/registry/BowerRegistry.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

src/registry/NpmRegistry.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

src/registry/RegistryFactory.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
/*
4-
* asset-packagist.hiqdev.com
4+
* Asset Packagist
55
*
6-
* @link http://asset-packagist.hiqdev.com/
7-
* @package asset-packagist.hiqdev.com
6+
* @link https://github.com/hiqdev/asset-packagist
7+
* @package asset-packagist
88
* @license BSD-3-Clause
99
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
1010
*/

0 commit comments

Comments
 (0)