Skip to content

Commit

Permalink
Cleanup Code
Browse files Browse the repository at this point in the history
  • Loading branch information
aljawaid committed Oct 13, 2023
1 parent 822bee0 commit 3d59003
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion Helper/PluginManagerHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @author aljawaid
* @author creecros Craig Crosby
* @author alfredbuehler Alfred Bühler
* @author cptsanifair Cpt. Sanifair
*/
class PluginManagerHelper extends Base
{
Expand Down Expand Up @@ -48,6 +49,7 @@ public function embedSVGIcon($icon_filename)
* @var $url
* @return string
* @author aljawaid
* @author cptsanifair Cpt. Sanifair
*/
public function checkRootDomain($url)
{
Expand All @@ -71,6 +73,14 @@ public function checkRootDomain($url)
}
}

/**
* Count Total Types
*
* @var $available_plugins
* @return int
* @author creecros Craig Crosby
* @author cptsanifair Cpt. Sanifair
*/
public function countTypes($available_plugins)
{
$types = array();
Expand All @@ -86,11 +96,26 @@ public function countTypes($available_plugins)
return $count_types;
}

/**
* Get All Plugins
*
* @var $url string
* @return int
* @author aljawaid
* @author cptsanifair Cpt. Sanifair
*/
public function getAllPlugins($url = PLUGIN_API_URL)
{
return array_filter($this->httpClient->getJson($url), array($this, 'isNotInstallable'));
}

/**
* Get Not Installable Plugins
*
* @return int
* @author aljawaid
* @author cptsanifair Cpt. Sanifair
*/
public function isNotInstallable(array $plugin)
{
return $plugin['remote_install'] === false;
Expand Down Expand Up @@ -146,7 +171,7 @@ public function lastUpdatedDirectory()
* Create List of Updatable Plugins
*
* @return array with plugin titles
* @author creecros Craig Crosby
* @author creecros Craig Crosby
*/
public function getPluginUpdates(): array
{
Expand Down

0 comments on commit 3d59003

Please sign in to comment.