mirror of
https://github.com/getgrav/grav.git
synced 2026-02-22 22:51:13 +01:00
PSR cleanup
This commit is contained in:
@@ -4,10 +4,12 @@ namespace Grav\Common\GPM\Local;
|
||||
use Grav\Common\GravTrait;
|
||||
use Grav\Common\Iterator;
|
||||
|
||||
class Collection extends Iterator {
|
||||
class Collection extends Iterator
|
||||
{
|
||||
use GravTrait;
|
||||
|
||||
public function toJson() {
|
||||
public function toJson()
|
||||
{
|
||||
$items = [];
|
||||
|
||||
foreach ($this->items as $name => $theme) {
|
||||
@@ -17,7 +19,8 @@ class Collection extends Iterator {
|
||||
return json_encode($items);
|
||||
}
|
||||
|
||||
public function toArray() {
|
||||
public function toArray()
|
||||
{
|
||||
$items = [];
|
||||
|
||||
foreach ($this->items as $name => $theme) {
|
||||
|
||||
@@ -3,11 +3,13 @@ namespace Grav\Common\GPM\Local;
|
||||
|
||||
use Grav\Common\Data\Data;
|
||||
|
||||
class Package {
|
||||
class Package
|
||||
{
|
||||
protected $data;
|
||||
protected $blueprints;
|
||||
|
||||
public function __construct(Data $package, $package_type = false) {
|
||||
public function __construct(Data $package, $package_type = false)
|
||||
{
|
||||
$this->data = $package;
|
||||
$this->blueprints = $this->data->blueprints();
|
||||
|
||||
@@ -16,28 +18,33 @@ class Package {
|
||||
}
|
||||
}
|
||||
|
||||
public function isEnabled() {
|
||||
public function isEnabled()
|
||||
{
|
||||
return $this->data['enabled'];
|
||||
}
|
||||
|
||||
public function getData() {
|
||||
public function getData()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function __get($key) {
|
||||
public function __get($key)
|
||||
{
|
||||
return $this->blueprints->get($key);
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
public function __toString()
|
||||
{
|
||||
return $this->toJson();
|
||||
}
|
||||
|
||||
public function toJson() {
|
||||
public function toJson()
|
||||
{
|
||||
return $this->blueprints->toJson();
|
||||
}
|
||||
|
||||
public function toArray() {
|
||||
public function toArray()
|
||||
{
|
||||
return $this->blueprints->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,10 +3,13 @@ namespace Grav\Common\GPM\Local;
|
||||
|
||||
use Grav\Common\Iterator;
|
||||
|
||||
class Packages extends Iterator {
|
||||
private $plugins, $themes;
|
||||
class Packages extends Iterator
|
||||
{
|
||||
private $plugins;
|
||||
private $themes;
|
||||
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$plugins = new Plugins();
|
||||
$themes = new Themes();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user