mirror of
				https://github.com/getgrav/grav-plugin-admin.git
				synced 2025-10-31 02:16:26 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			60 lines
		
	
	
		
			1019 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1019 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| /**
 | |
|  * @package    Grav\Plugin\Admin
 | |
|  *
 | |
|  * @copyright  Copyright (c) 2015 - 2024 Trilby Media, LLC. All rights reserved.
 | |
|  * @license    MIT License; see LICENSE file for details.
 | |
|  */
 | |
| 
 | |
| namespace Grav\Plugin\Admin;
 | |
| 
 | |
| class ScssList
 | |
| {
 | |
|     /** @var string[] */
 | |
|     protected $list = [];
 | |
| 
 | |
|     /**
 | |
|      * ScssList constructor.
 | |
|      * @param string|null $item
 | |
|      */
 | |
|     public function __construct($item = null)
 | |
|     {
 | |
|         if ($item) {
 | |
|             $this->add($item);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @return array
 | |
|      */
 | |
|     public function all(): array
 | |
|     {
 | |
|         return $this->list;
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @param string $item
 | |
|      * @return void
 | |
|      */
 | |
|     public function add($item): void
 | |
|     {
 | |
|         if ($item) {
 | |
|             $this->list[] = $item;
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @param string $item
 | |
|      * @return void
 | |
|      */
 | |
|     public function remove($item): void
 | |
|     {
 | |
|         $pos = array_search($item, $this->list, true);
 | |
|         if ($pos) {
 | |
|             unset($this->list[$pos]);
 | |
|         }
 | |
|     }
 | |
| 
 | |
| }
 |