-
Notifications
You must be signed in to change notification settings - Fork 26
/
PluginComposerData.php
66 lines (56 loc) · 1.23 KB
/
PluginComposerData.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/*
* This file is part of the Yosymfony\Spress.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\Spress\Plugin;
/**
* Wrapper for Composer data of a plugin
*
* @author Victor Puertas <vpgugr@gmail.com>
*/
class PluginComposerData
{
private $data;
/**
* Constructor
*
* @param array $data
*/
public function __construct(array $data)
{
$this->data = $data;
}
/**
* Get the Spress plugin name
*
* @return string
*/
public function getSpressName()
{
$result = '';
if(isset($this->data['extra']['spress_name']))
{
$result = $this->data['extra']['spress_name'];
}
return $result;
}
/**
* Get the Spress plugin entry-point
*
* @return string
*/
public function getSpressClass()
{
$result = '';
if(isset($this->data['extra']['spress_class']))
{
$result = $this->data['extra']['spress_class'];
}
return $result;
}
}