@@ -46,8 +46,9 @@ |
||
| 46 | 46 | break; |
| 47 | 47 | case 'month': |
| 48 | 48 | $text = (isset($date[1])) ? $date[1] : ''; |
| 49 | - if (empty($text) || $text < 1 || $text > 12) |
|
| 50 | - return; |
|
| 49 | + if (empty($text) || $text < 1 || $text > 12) { |
|
| 50 | + return; |
|
| 51 | + } |
|
| 51 | 52 | // $form = $this->form; |
| 52 | 53 | switch ($this->form) { |
| 53 | 54 | case 'numeric': break; |
@@ -30,8 +30,9 @@ |
||
| 30 | 30 | public function render($data, $mode = NULL) { |
| 31 | 31 | $var = $this->variable; |
| 32 | 32 | |
| 33 | - if (!$var || empty($data->$var)) |
|
| 34 | - return; |
|
| 33 | + if (!$var || empty($data->$var)) { |
|
| 34 | + return; |
|
| 35 | + } |
|
| 35 | 36 | |
| 36 | 37 | // $form = $this->form; |
| 37 | 38 | |
@@ -64,10 +64,12 @@ |
||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - if (empty($text)) |
|
| 68 | - return; |
|
| 69 | - if ($this->{'strip-periods'}) |
|
| 70 | - $text = str_replace('.', '', $text); |
|
| 67 | + if (empty($text)) { |
|
| 68 | + return; |
|
| 69 | + } |
|
| 70 | + if ($this->{'strip-periods'}) { |
|
| 71 | + $text = str_replace('.', '', $text); |
|
| 72 | + } |
|
| 71 | 73 | return $this->format($text); |
| 72 | 74 | } |
| 73 | 75 | |
@@ -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); |