File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
src/aleksip/DataTransformPlugin Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace aleksip \DataTransformPlugin ;
4+
5+ use PatternLab \Config ;
6+ use PatternLab \Console ;
7+
8+ class DataTransformPlugin
9+ {
10+ public static function isEnabled ()
11+ {
12+ $ enabled = Config::getOption ('plugins.dataTransform.enabled ' );
13+ $ enabled = (is_null ($ enabled ) || (bool )$ enabled );
14+
15+ if (!$ enabled ) {
16+ self ::writeInfo ('plugin is disabled ' );
17+ }
18+
19+ return $ enabled ;
20+ }
21+
22+ public static function isVerbose ()
23+ {
24+ $ verbose = Config::getOption ('plugins.dataTransform.verbose ' );
25+
26+ return (!is_null ($ verbose ) && (bool )$ verbose );
27+ }
28+
29+ public static function writeInfo ($ line , $ indent = false )
30+ {
31+ if (self ::isVerbose ()) {
32+ if (!$ indent ) {
33+ $ line = '[data transform plugin] ' . $ line ;
34+ }
35+ Console::writeInfo ($ line , $ indent );
36+ }
37+ }
38+
39+ public static function writeWarning ($ line , $ indent = false )
40+ {
41+ if (!$ indent ) {
42+ $ line = '[data transform plugin] ' . $ line ;
43+ }
44+ Console::writeWarning ($ line , $ indent );
45+ }
46+ }
You can’t perform that action at this time.
0 commit comments