@@ -56,7 +56,7 @@ |
||
56 | 56 | if (empty(HierAttributes::$arr)) { |
57 | 57 | $refClass = new \ReflectionClass('\AcademicPuma\CiteProc\HierAttributes'); |
58 | 58 | $constants = $refClass->getConstants(); |
59 | - array_walk($constants, function ($value) { |
|
59 | + array_walk($constants, function($value) { |
|
60 | 60 | HierAttributes::$arr[$value] = $value; |
61 | 61 | }); |
62 | 62 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $element_count++; |
37 | 37 | if (($element instanceof Text) && |
38 | 38 | ($element->source == 'term' || |
39 | - $element->source == 'value' )) { |
|
39 | + $element->source == 'value')) { |
|
40 | 40 | $terms++; |
41 | 41 | } |
42 | 42 | if (($element instanceof Label)) { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | } |
64 | 64 | //give the text parts a name |
65 | - if($element instanceof Text) { |
|
65 | + if ($element instanceof Text) { |
|
66 | 66 | $text_parts[$element->getVar()] = $text; |
67 | 67 | } else { |
68 | 68 | $text_parts[$element_count] = $text; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | private static function getLocalesFileName($lang) { |
95 | 95 | |
96 | - include_once __DIR__.'/../vendorPath.php'; |
|
96 | + include_once __DIR__ . '/../vendorPath.php'; |
|
97 | 97 | |
98 | 98 | if (!($vendorPath = vendorPath())) { |
99 | 99 | throw new \Exception('Error: vendor path not found. Use composer to initialize your project'); |
@@ -101,10 +101,10 @@ discard block |
||
101 | 101 | |
102 | 102 | $localeFile = null; |
103 | 103 | |
104 | - if(isset(self::$langBase[$lang])) { |
|
105 | - $localeFile = file_get_contents($vendorPath.'/academicpuma/locales/locales-' . self::$langBase[$lang] . '.xml'); |
|
104 | + if (isset(self::$langBase[$lang])) { |
|
105 | + $localeFile = file_get_contents($vendorPath . '/academicpuma/locales/locales-' . self::$langBase[$lang] . '.xml'); |
|
106 | 106 | } else { |
107 | - $localeFile = file_get_contents($vendorPath.'/academicpuma/locales/locales-en-US.xml'); |
|
107 | + $localeFile = file_get_contents($vendorPath . '/academicpuma/locales/locales-en-US.xml'); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | return $localeFile; |
@@ -92,13 +92,13 @@ |
||
92 | 92 | * @throws \Exception |
93 | 93 | */ |
94 | 94 | public static function loadStyleSheet($name) { |
95 | - include_once __DIR__.'/../vendorPath.php'; |
|
95 | + include_once __DIR__ . '/../vendorPath.php'; |
|
96 | 96 | |
97 | 97 | if (!($vendorPath = vendorPath())) { |
98 | 98 | throw new \Exception('Error: vendor path not found. Use composer to initialize your project'); |
99 | 99 | } |
100 | 100 | |
101 | - return file_get_contents($vendorPath.'/academicpuma/styles/'.$name.'.csl'); |
|
101 | + return file_get_contents($vendorPath . '/academicpuma/styles/' . $name . '.csl'); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -169,9 +169,9 @@ |
||
169 | 169 | |
170 | 170 | if ($this->form == 'count') { |
171 | 171 | if (!$et_al_triggered) { |
172 | - return (int)count($authors); |
|
172 | + return (int) count($authors); |
|
173 | 173 | } else { |
174 | - return (int)(count($authors) - 1); |
|
174 | + return (int) (count($authors) - 1); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | // strip out the last delimiter if not required |
@@ -26,27 +26,27 @@ |
||
26 | 26 | //$class_name = 'csl_' . str_replace('-', '_', $dom_node->nodeName); |
27 | 27 | $className = ucfirst($dom_node->nodeName); |
28 | 28 | |
29 | - while(true) { |
|
29 | + while (true) { |
|
30 | 30 | //find '-' |
31 | 31 | $pos = strpos($className, '-'); |
32 | - if($pos === false) { |
|
32 | + if ($pos === false) { |
|
33 | 33 | break; |
34 | 34 | } |
35 | 35 | //replace '-' and transform to camel case |
36 | - $className = substr($className, 0, $pos) . ucfirst(substr($className, $pos+1)); |
|
36 | + $className = substr($className, 0, $pos) . ucfirst(substr($className, $pos + 1)); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // |
40 | - switch($className) { |
|
40 | + switch ($className) { |
|
41 | 41 | case 'If': |
42 | 42 | case 'Else': |
43 | 43 | case 'ElseIf': |
44 | - $className = 'P'.$className; |
|
44 | + $className = 'P' . $className; |
|
45 | 45 | } |
46 | 46 | |
47 | - $className = 'AcademicPuma\\CiteProc\\'.$className; |
|
47 | + $className = 'AcademicPuma\\CiteProc\\' . $className; |
|
48 | 48 | |
49 | - if(!class_exists($className)) { |
|
49 | + if (!class_exists($className)) { |
|
50 | 50 | new \Exception("Class \"$className\" does not exist."); |
51 | 51 | } |
52 | 52 | return new $className($dom_node, $citeproc); |