Skip to content

Commit

Permalink
phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedik committed Sep 30, 2018
1 parent 4e223d5 commit c4d03bc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
24 changes: 14 additions & 10 deletions libraries/src/WebAsset/WebAssetItem.php
Expand Up @@ -136,14 +136,15 @@ class WebAssetItem
/**
* Class constructor
*
* @param string $name The asset name
* @param array $data The Asset information
* @param string $name The asset name
* @param array $data The Asset information
*
* @since __DEPLOY_VERSION__
*/
public function __construct($name, array $data = [])
{
$this->name = strtolower($name); // No fancy Camels or Elephants
// No fancy Camels or Elephants
$this->name = strtolower($name);
$this->version = !empty($data['version']) ? $data['version'] : null;
$this->assetSource = !empty($data['assetSource']) ? $data['assetSource'] : null;

Expand All @@ -152,14 +153,16 @@ public function __construct($name, array $data = [])
// Check for Scripts and StyleSheets, and their attributes
if (!empty($data['js']))
{
foreach ($data['js'] as $js) {
foreach ($data['js'] as $js)
{
$this->js[$js] = empty($attributes[$js]) ? [] : $attributes[$js];
}
}

if (!empty($data['css']))
{
foreach ($data['css'] as $css) {
foreach ($data['css'] as $css)
{
$this->css[$css] = empty($attributes[$css]) ? [] : $attributes[$css];
}
}
Expand Down Expand Up @@ -265,7 +268,7 @@ public function getWeight()
/**
* Get CSS files
*
* @param boolean $resolvePath Whether need to search for real path
* @param boolean $resolvePath Whether need to search for real path
*
* @return array
*
Expand Down Expand Up @@ -302,7 +305,7 @@ public function getStylesheetFiles($resolvePath = true)
/**
* Get JS files
*
* @param boolean $resolvePath Whether need to search for real path
* @param boolean $resolvePath Whether need to search for real path
*
* @return array
*
Expand Down Expand Up @@ -354,8 +357,8 @@ public function getAssetFiles()
/**
* Resolve path
*
* @param string $path The path to resolve
* @param string $type The resolver method
* @param string $path The path to resolve
* @param string $type The resolver method
*
* @return array
*
Expand All @@ -379,7 +382,8 @@ protected function resolvePath($path, $type)
if (!$external)
{
// Get the file path
$file = HTMLHelper::_($type, $path, [
$file = HTMLHelper::_($type, $path,
[
'pathOnly' => true,
'relative' => !$this->isPathAbsolute($path)
]
Expand Down
15 changes: 8 additions & 7 deletions libraries/src/WebAsset/WebAssetRegistry.php
Expand Up @@ -254,8 +254,8 @@ public function removeAsset($name)
/**
* Change the asset State
*
* @param string $name Asset name
* @param integer $state New state
* @param string $name Asset name
* @param integer $state New state
*
* @return self
*
Expand Down Expand Up @@ -308,7 +308,7 @@ public function setAssetState($name, $state = WebAssetItem::ASSET_STATE_ACTIVE)
/**
* Activate the Asset item
*
* @param $name
* @param string $name The asset name
*
* @return self
*
Expand All @@ -322,7 +322,7 @@ public function enableAsset($name)
/**
* Deactivate the Asset item
*
* @param $name
* @param string $name The asset name
*
* @return self
*
Expand Down Expand Up @@ -514,8 +514,8 @@ function($a, $b)
/**
* Prepare new Asset instance.
*
* @param string $name Asset name
* @param array $data Asset information
* @param string $name Asset name
* @param array $data Asset information
*
* @return WebAssetItem
*
Expand Down Expand Up @@ -635,7 +635,8 @@ public function debugAssets()
$assets = $this->assets;
$result = [];

foreach ($assets as $asset) {
foreach ($assets as $asset)
{
$result[$asset->getName()] = [
'deps' => implode(', ', $asset->getDependencies()),
'state' => $asset->getState(),
Expand Down

0 comments on commit c4d03bc

Please sign in to comment.