6f6c71f1124b5e056cb4227dbc78ef54b5516af5
[yaffs-website] / vendor / drupal / console / src / Extension / Extension.php
1 <?php
2
3 namespace Drupal\Console\Extension;
4
5 use Drupal\Core\Extension\Extension as BaseExtension;
6
7 /**
8  * Class Extension
9  *
10  * @package Drupal\Console\Extension
11  */
12 class Extension extends BaseExtension
13 {
14     /**
15      * @param $fullPath
16      * @return string
17      */
18     public function getPath($fullPath = false)
19     {
20         if ($fullPath) {
21             return $this->root . '/' . parent::getPath();
22         }
23
24         return parent::getPath();
25     }
26
27     /**
28      * @param bool $fullPath
29      * @return string
30      */
31     public function getControllerPath($fullPath = false)
32     {
33         return $this->getSourcePath($fullPath) . '/Controller';
34     }
35
36     /**
37      * @param bool $fullPath
38      * @return string
39      */
40     public function getConfigInstallDirectory($fullPath = false)
41     {
42         return $this->getPath($fullPath) .'/config/install';
43     }
44
45     /**
46      * @param bool $fullPath
47      * @return string
48      */
49     public function getConfigOptionalDirectory($fullPath = false)
50     {
51         return $this->getPath($fullPath) .'/config/optional';
52     }
53
54     /**
55      * @param bool $fullPath
56      * @return string
57      */
58     public function getSourcePath($fullPath=false)
59     {
60         return $this->getPath($fullPath) . '/src';
61     }
62
63     /**
64      * @param string  $authenticationType
65      * @param boolean $fullPath
66      * @return string
67      */
68     public function getAuthenticationPath($authenticationType, $fullPath = false)
69     {
70         return $this->getSourcePath($fullPath) .'/Authentication/' . $authenticationType;
71     }
72
73     /**
74      * @param $fullPath
75      * @return string
76      */
77     public function getFormPath($fullPath = false)
78     {
79         return $this->getSourcePath($fullPath) . '/Form';
80     }
81
82     /**
83      * @param $fullPath
84      * @return string
85      */
86     public function getRoutingPath($fullPath = false)
87     {
88         return $this->getSourcePath($fullPath) . '/Routing';
89     }
90
91     /**
92      * @param bool $fullPath
93      * @return string
94      */
95     public function getCommandDirectory($fullPath=false)
96     {
97         return $this->getSourcePath($fullPath) . '/Command/';
98     }
99
100     /**
101      * @param bool $fullPath
102      * @return string
103      */
104     public function getEntityPath($fullPath = false)
105     {
106         return $this->getSourcePath($fullPath) . '/Entity';
107     }
108
109     /**
110      * @param bool $fullPath
111      * @return string
112      */
113     public function getTemplatePath($fullPath = false)
114     {
115         return $this->getPath($fullPath) . '/templates';
116     }
117 }