Skip to content

Commit

Permalink
Additional phpdoc and minor code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed May 31, 2015
1 parent 67658cf commit 816ebd1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
26 changes: 24 additions & 2 deletions build/controllers/DevController.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ public function actionApp($app, $repo = null)
*
* @param string $extension the application name e.g. `basic` or `advanced`.
* @param string $repo url of the git repo to clone if it does not already exist.
*
* @return int
*/
public function actionExt($extension, $repo = null)
{
Expand Down Expand Up @@ -223,16 +225,23 @@ public function actionExt($extension, $repo = null)
return 0;
}

/**
* @inheritdoc
*/
public function options($actionID)
{
$options = parent::options($actionID);
if (in_array($actionID, ['ext', 'app', 'all'])) {
if (in_array($actionID, ['ext', 'app', 'all'], true)) {
$options[] = 'useHttp';
}
return $options;
}


/**
* Remove all symlinks in the vendor subdirectory of the directory specified
* @param string $dir base directory
*/
protected function cleanupVendorDir($dir)
{
if (is_link($link = "$dir/vendor/yiisoft/yii2")) {
Expand All @@ -248,6 +257,13 @@ protected function cleanupVendorDir($dir)
}
}

/**
* Creates symlinks to freamework and extension sources for the application
* @param string $dir application directory
* @param string $base Yii sources base directory
*
* @return int
*/
protected function linkFrameworkAndExtensions($dir, $base)
{
if (is_dir($link = "$dir/vendor/yiisoft/yii2")) {
Expand Down Expand Up @@ -287,6 +303,12 @@ protected function unlink($file)
}
}

/**
* Get a list of subdirectories for directory specified
* @param string $dir directory to read
*
* @return array list of subdirectories
*/
protected function listSubDirs($dir)
{
$list = [];
Expand Down Expand Up @@ -335,7 +357,7 @@ protected function findDirs($dir)
closedir($handle);

foreach($list as $i => $e) {
if ($e == 'composer') { // skip composer to not break composer update
if ($e === 'composer') { // skip composer to not break composer update
unset($list[$i]);
}
}
Expand Down
16 changes: 12 additions & 4 deletions framework/caching/MemCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class MemCache extends Cache
/**
* @var \Memcache|\Memcached the Memcache instance
*/
private $_cache = null;
private $_cache;
/**
* @var array list of memcache server configurations
*/
Expand All @@ -114,8 +114,10 @@ public function init()
}

/**
* Add servers to the server pool of the cache specified
*
* @param \Memcache|\Memcached $cache
* @param array $servers
* @param MemCacheServer[] $servers
* @throws InvalidConfigException
*/
protected function addServers($cache, $servers)
Expand All @@ -140,8 +142,11 @@ protected function addServers($cache, $servers)
}

/**
* Add servers to the server pool of the cache specified
* Used for memcached PECL extension.
*
* @param \Memcached $cache
* @param array $servers
* @param MemCacheServer[] $servers
*/
protected function addMemcachedServers($cache, $servers)
{
Expand All @@ -159,8 +164,11 @@ protected function addMemcachedServers($cache, $servers)
}

/**
* Add servers to the server pool of the cache specified
* Used for memcache PECL extension.
*
* @param \Memcache $cache
* @param array $servers
* @param MemCacheServer[] $servers
*/
protected function addMemcacheServers($cache, $servers)
{
Expand Down

0 comments on commit 816ebd1

Please sign in to comment.