Files
Grav-Admin-Plugin/classes/plugin/ScssList.php

60 lines
1019 B
PHP
Raw Normal View History

<?php
2021-01-08 18:57:41 +02:00
2023-01-02 11:17:40 -07:00
/**
* @package Grav\Plugin\Admin
*
2024-01-05 11:50:46 +00:00
* @copyright Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
2023-01-02 11:17:40 -07:00
* @license MIT License; see LICENSE file for details.
*/
namespace Grav\Plugin\Admin;
2021-01-08 18:57:41 +02:00
class ScssList
{
/** @var string[] */
protected $list = [];
2021-01-08 18:57:41 +02:00
/**
* ScssList constructor.
* @param string|null $item
*/
public function __construct($item = null)
{
if ($item) {
$this->add($item);
}
}
2021-01-08 18:57:41 +02:00
/**
* @return array
*/
public function all(): array
{
return $this->list;
}
2021-01-08 18:57:41 +02:00
/**
* @param string $item
* @return void
*/
public function add($item): void
{
2021-01-08 18:57:41 +02:00
if ($item) {
$this->list[] = $item;
}
}
2021-01-08 18:57:41 +02:00
/**
* @param string $item
* @return void
*/
public function remove($item): void
{
2021-01-08 18:57:41 +02:00
$pos = array_search($item, $this->list, true);
if ($pos) {
unset($this->list[$pos]);
}
}
}