@@ -236,6 +236,8 @@ |
||
236 | 236 | * |
237 | 237 | * @param string device the device identifier string |
238 | 238 | * @param string path the path where the new installer can be found |
239 | + * @param string $device |
|
240 | + * @param string $path |
|
239 | 241 | */ |
240 | 242 | abstract public function updateCache($device, $path, $mime); |
241 | 243 |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * Loads the class file for a given class name. |
102 | 102 | * |
103 | 103 | * @param string $class The fully-qualified class name. |
104 | - * @return mixed The mapped file name on success, or boolean false on |
|
104 | + * @return string|false The mapped file name on success, or boolean false on |
|
105 | 105 | * failure. |
106 | 106 | */ |
107 | 107 | public function loadClass($class) |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @param string $prefix The namespace prefix. |
141 | 141 | * @param string $relative_class The relative class name. |
142 | - * @return mixed Boolean false if no mapped file can be loaded, or the |
|
142 | + * @return false|string Boolean false if no mapped file can be loaded, or the |
|
143 | 143 | * name of the mapped file that was loaded. |
144 | 144 | */ |
145 | 145 | protected function loadMappedFile($prefix, $relative_class) |
@@ -156,8 +156,8 @@ |
||
156 | 156 | // replace namespace separators with directory separators |
157 | 157 | // in the relative class name, append with .php |
158 | 158 | $file = $base_dir |
159 | - . str_replace('\\', '/', $relative_class) |
|
160 | - . '.php'; |
|
159 | + . str_replace('\\', '/', $relative_class) |
|
160 | + . '.php'; |
|
161 | 161 | |
162 | 162 | // if the mapped file exists, require it |
163 | 163 | if ($this->requireFile($file)) { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | /** |
31 | 31 | * |
32 | - * @return number |
|
32 | + * @return integer |
|
33 | 33 | */ |
34 | 34 | public function size(){ |
35 | 35 | return count($this->rows); |
@@ -53,7 +53,6 @@ discard block |
||
53 | 53 | |
54 | 54 | /** |
55 | 55 | * |
56 | - * @param array $row |
|
57 | 56 | */ |
58 | 57 | public function addRowArray($cells){ |
59 | 58 | $this->addRow(new Row($cells)); |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @author Zilvinas Vaira |
6 | 6 | * |
7 | 7 | */ |
8 | -class Table extends Tag{ |
|
8 | +class Table extends Tag { |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * |
23 | 23 | * @param array $rows |
24 | 24 | */ |
25 | - public function __construct($rows = array()){ |
|
25 | + public function __construct($rows = array()) { |
|
26 | 26 | parent::__construct('table'); |
27 | 27 | $this->setRows($rows); |
28 | 28 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * |
32 | 32 | * @return number |
33 | 33 | */ |
34 | - public function size(){ |
|
34 | + public function size() { |
|
35 | 35 | return count($this->rows); |
36 | 36 | } |
37 | 37 | |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | * @param string $column |
42 | 42 | * @param HtmlElement $element |
43 | 43 | */ |
44 | - public function addToCell($row, $column, $element){ |
|
45 | - if(!in_array($column, $this->columns)){ |
|
44 | + public function addToCell($row, $column, $element) { |
|
45 | + if (!in_array($column, $this->columns)) { |
|
46 | 46 | $this->columns [] = $column; |
47 | 47 | } |
48 | - if(!isset($this->rows[$row])){ |
|
48 | + if (!isset($this->rows[$row])) { |
|
49 | 49 | $this->rows [$row] = new Row(); |
50 | 50 | } |
51 | 51 | $this->rows[$row]->addToCell($column, $element); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @param array $row |
57 | 57 | */ |
58 | - public function addRowArray($cells){ |
|
58 | + public function addRowArray($cells) { |
|
59 | 59 | $this->addRow(new Row($cells)); |
60 | 60 | } |
61 | 61 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @param Row $row |
65 | 65 | */ |
66 | - public function addRow($row){ |
|
67 | - if(count($row->size())>0){ |
|
66 | + public function addRow($row) { |
|
67 | + if (count($row->size()) > 0) { |
|
68 | 68 | $this->rows [] = $row; |
69 | 69 | $this->setColumns($row); |
70 | 70 | } |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @param array $rows |
76 | 76 | */ |
77 | - public function setRows($rows){ |
|
78 | - if(count($rows)>0){ |
|
77 | + public function setRows($rows) { |
|
78 | + if (count($rows) > 0) { |
|
79 | 79 | foreach ($rows as $cells) { |
80 | 80 | $this->addRowArray($cells); |
81 | 81 | } |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @param Row $row |
88 | 88 | */ |
89 | - private function setColumns($row){ |
|
89 | + private function setColumns($row) { |
|
90 | 90 | $cells = $row->getCells(); |
91 | 91 | foreach ($cells as $key => $value) { |
92 | - if(!in_array($key, $this->columns)){ |
|
92 | + if (!in_array($key, $this->columns)) { |
|
93 | 93 | $this->columns [] = $key; |
94 | 94 | } |
95 | 95 | } |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | * |
100 | 100 | * @return string |
101 | 101 | */ |
102 | - protected function composeInnerString(){ |
|
102 | + protected function composeInnerString() { |
|
103 | 103 | $innerString = ""; |
104 | 104 | foreach ($this->rows as $row) { |
105 | 105 | $row->setColumns($this->columns); |
106 | - $row->setTab("\t".$this->tab); |
|
106 | + $row->setTab("\t" . $this->tab); |
|
107 | 107 | $innerString .= $row; |
108 | 108 | } |
109 | 109 | return $innerString; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @author Zilvinas Vaira |
10 | 10 | * |
11 | 11 | */ |
12 | -class DefaultPage implements Page{ |
|
12 | +class DefaultPage implements Page { |
|
13 | 13 | |
14 | 14 | private $title = ""; |
15 | 15 | |
@@ -19,46 +19,46 @@ discard block |
||
19 | 19 | $this->setTitle($title); |
20 | 20 | } |
21 | 21 | |
22 | - public function setTitle($title){ |
|
22 | + public function setTitle($title) { |
|
23 | 23 | $this->title = $title; |
24 | 24 | } |
25 | 25 | |
26 | - public function getTitle(){ |
|
26 | + public function getTitle() { |
|
27 | 27 | return $this->title; |
28 | 28 | } |
29 | 29 | |
30 | - public function append($name, $value){ |
|
31 | - if(isset($this->blocks [$name])){ |
|
32 | - $this->blocks [$name] .= "\n".$value; |
|
33 | - }else{ |
|
30 | + public function append($name, $value) { |
|
31 | + if (isset($this->blocks [$name])) { |
|
32 | + $this->blocks [$name] .= "\n" . $value; |
|
33 | + } else { |
|
34 | 34 | $this->assign($name, $value); |
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | - public function assign($name, $value){ |
|
38 | + public function assign($name, $value) { |
|
39 | 39 | $this->blocks [$name] = $value; |
40 | 40 | } |
41 | 41 | |
42 | - public function fetch($name){ |
|
43 | - if(isset($this->blocks[$name])){ |
|
42 | + public function fetch($name) { |
|
43 | + if (isset($this->blocks[$name])) { |
|
44 | 44 | return $this->blocks[$name]; |
45 | - }else{ |
|
45 | + } else { |
|
46 | 46 | return ''; |
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | - public function appendScript($url){ |
|
50 | + public function appendScript($url) { |
|
51 | 51 | $script = new Tag('script'); |
52 | 52 | $script->addAttribute('type', 'text/javascript'); |
53 | 53 | $script->addAttribute('src', $url); |
54 | 54 | $this->append('script', $script); |
55 | 55 | } |
56 | 56 | |
57 | - public function fetchScript(){ |
|
57 | + public function fetchScript() { |
|
58 | 58 | return $this->fetch('script'); |
59 | 59 | } |
60 | 60 | |
61 | - public function appendCss($url){ |
|
61 | + public function appendCss($url) { |
|
62 | 62 | $css = new UnaryTag('link'); |
63 | 63 | $css->addAttribute('rel', 'stylesheet'); |
64 | 64 | $css->addAttribute('type', 'text/css'); |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | $this->append('css', $css); |
67 | 67 | } |
68 | 68 | |
69 | - public function fetchCss(){ |
|
69 | + public function fetchCss() { |
|
70 | 70 | return $this->fetch('css'); |
71 | 71 | } |
72 | 72 | |
73 | - public function appendMeta($attributes = array()){ |
|
73 | + public function appendMeta($attributes = array()) { |
|
74 | 74 | $meta = new Tag('meta'); |
75 | 75 | foreach ($attributes as $name => $value) { |
76 | 76 | $meta->addAttribute($name, $value); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $this->append('meta', $meta); |
79 | 79 | } |
80 | 80 | |
81 | - public function fetchMeta(){ |
|
81 | + public function fetchMeta() { |
|
82 | 82 | return $this->fetch('meta'); |
83 | 83 | } |
84 | 84 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | public function append($name, $value){ |
31 | 31 | if(isset($this->blocks [$name])){ |
32 | 32 | $this->blocks [$name] .= "\n".$value; |
33 | - }else{ |
|
33 | + } else{ |
|
34 | 34 | $this->assign($name, $value); |
35 | 35 | } |
36 | 36 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function fetch($name){ |
43 | 43 | if(isset($this->blocks[$name])){ |
44 | 44 | return $this->blocks[$name]; |
45 | - }else{ |
|
45 | + } else{ |
|
46 | 46 | return ''; |
47 | 47 | } |
48 | 48 | } |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | use lib\view\html\Attribute; |
5 | 5 | |
6 | -class TitledFormDecorator extends PageElementDecorator{ |
|
6 | +class TitledFormDecorator extends PageElementDecorator { |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @param string $class |
39 | 39 | * @param string $title |
40 | 40 | */ |
41 | - public function __construct($element, $title, $action, $class = '', $method = 'post', $charset = 'UTF-8'){ |
|
41 | + public function __construct($element, $title, $action, $class = '', $method = 'post', $charset = 'UTF-8') { |
|
42 | 42 | parent::__construct($element, $class); |
43 | 43 | $this->title = $title; |
44 | 44 | $this->action = new Attribute('action', $action); |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | $this->charset = new Attribute('accept-charset', $charset); |
47 | 47 | } |
48 | 48 | |
49 | - public function addHtmlElement($element){ |
|
49 | + public function addHtmlElement($element) { |
|
50 | 50 | $this->elements [] = $element; |
51 | 51 | } |
52 | 52 | |
53 | 53 | public function render() { |
54 | 54 | ?> |
55 | - <form enctype="multipart/form-data"<?php echo $this->action.$this->method.$this->charset; ?>> |
|
55 | + <form enctype="multipart/form-data"<?php echo $this->action . $this->method . $this->charset; ?>> |
|
56 | 56 | <fieldset<?php echo $this->class; ?>> |
57 | 57 | <legend> |
58 | 58 | <strong><?php echo $this->title; ?></strong> |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | <div> |
65 | 65 | <?php |
66 | 66 | foreach ($this->elements as $element) { |
67 | - echo "\n".$element; |
|
67 | + echo "\n" . $element; |
|
68 | 68 | } |
69 | 69 | ?> |
70 | 70 | </div> |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use lib\view\html\Attribute; |
5 | 5 | |
6 | -abstract class PageElementDecorator implements PageElement{ |
|
6 | +abstract class PageElementDecorator implements PageElement { |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @author Zilvinas Vaira |
7 | 7 | * |
8 | 8 | */ |
9 | -class Tag extends UnaryTag{ |
|
9 | +class Tag extends UnaryTag { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | protected $text = ""; |
16 | 16 | |
17 | - public function addText($text){ |
|
17 | + public function addText($text) { |
|
18 | 18 | $this->text .= $text; |
19 | 19 | } |
20 | 20 | |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | * |
23 | 23 | * @return string |
24 | 24 | */ |
25 | - protected function composeInnerString(){ |
|
25 | + protected function composeInnerString() { |
|
26 | 26 | $innerString = ""; |
27 | - if(!empty($this->text)){ |
|
27 | + if (!empty($this->text)) { |
|
28 | 28 | $innerString = "\n\t" . $this->tab . $this->text; |
29 | 29 | } |
30 | 30 | return $innerString; |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | * {@inheritDoc} |
36 | 36 | * @see UnaryTag::composeTagString() |
37 | 37 | */ |
38 | - protected function composeTagString($attributeString){ |
|
38 | + protected function composeTagString($attributeString) { |
|
39 | 39 | $tagString = ""; |
40 | 40 | $innerString = $this->composeInnerString(); |
41 | - if(!empty($innerString)){ |
|
42 | - $tagString = "\n".$this->tab."<" . $this->name . $attributeString . ">" . $innerString . "\n".$this->tab."</" . $this->name . ">"; |
|
43 | - }else{ |
|
44 | - $tagString = "\n".$this->tab."<" . $this->name . $attributeString . "></" . $this->name . ">"; |
|
41 | + if (!empty($innerString)) { |
|
42 | + $tagString = "\n" . $this->tab . "<" . $this->name . $attributeString . ">" . $innerString . "\n" . $this->tab . "</" . $this->name . ">"; |
|
43 | + } else { |
|
44 | + $tagString = "\n" . $this->tab . "<" . $this->name . $attributeString . "></" . $this->name . ">"; |
|
45 | 45 | } |
46 | 46 | return $tagString; |
47 | 47 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | public function __toString(){ |
36 | 36 | if(!empty($this->name) && !empty($this->value)){ |
37 | 37 | return ' ' . $this->name . '="' . $this->value . '"'; |
38 | - }else{ |
|
38 | + } else{ |
|
39 | 39 | return ''; |
40 | 40 | } |
41 | 41 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @author Zilvinas Vaira |
7 | 7 | * |
8 | 8 | */ |
9 | -class Row extends Tag{ |
|
9 | +class Row extends Tag { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @param array $cells |
43 | 43 | */ |
44 | - public function setCells($cells){ |
|
44 | + public function setCells($cells) { |
|
45 | 45 | foreach ($cells as $key => $cell) { |
46 | 46 | $td = new CompositeTag('td'); |
47 | 47 | $td->addText($cell); |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - public function size(){ |
|
52 | + public function size() { |
|
53 | 53 | return count($this->cells); |
54 | 54 | } |
55 | 55 | |
56 | - public function getCells(){ |
|
56 | + public function getCells() { |
|
57 | 57 | return $this->cells; |
58 | 58 | } |
59 | 59 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * @param string $name |
64 | 64 | * @param string $value |
65 | 65 | */ |
66 | - public function addCellAttribute($column, $name, $value){ |
|
67 | - if(isset($this->cells[$column])){ |
|
66 | + public function addCellAttribute($column, $name, $value) { |
|
67 | + if (isset($this->cells[$column])) { |
|
68 | 68 | $this->cells[$column]->addAttribute($name, $value); |
69 | 69 | } |
70 | 70 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @param array $columns |
75 | 75 | */ |
76 | - public function setColumns($columns){ |
|
76 | + public function setColumns($columns) { |
|
77 | 77 | $this->columns = $columns; |
78 | 78 | } |
79 | 79 | |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | * @param string $column |
83 | 83 | * @param HtmlElement $element |
84 | 84 | */ |
85 | - public function addToCell($column, $element){ |
|
86 | - if(!isset($this->cells[$column])){ |
|
85 | + public function addToCell($column, $element) { |
|
86 | + if (!isset($this->cells[$column])) { |
|
87 | 87 | $this->cells[$column] = new CompositeTag('td'); |
88 | 88 | } |
89 | 89 | $this->cells[$column]->addTag($element); |
@@ -94,19 +94,19 @@ discard block |
||
94 | 94 | * {@inheritDoc} |
95 | 95 | * @see \lib\view\html\Tag::composeInnerString() |
96 | 96 | */ |
97 | - public function composeInnerString(){ |
|
98 | - if(count($this->columns)>0){ |
|
97 | + public function composeInnerString() { |
|
98 | + if (count($this->columns) > 0) { |
|
99 | 99 | $innerString = ""; |
100 | 100 | foreach ($this->columns as $column) { |
101 | - if(!isset($this->cells[$column])){ |
|
101 | + if (!isset($this->cells[$column])) { |
|
102 | 102 | $this->cells[$column] = new CompositeTag('td'); |
103 | 103 | } |
104 | - $this->cells[$column]->setTab("\t".$this->tab); |
|
104 | + $this->cells[$column]->setTab("\t" . $this->tab); |
|
105 | 105 | $innerString .= $this->cells[$column]; |
106 | 106 | |
107 | 107 | } |
108 | 108 | return $innerString; |
109 | - }else{ |
|
109 | + } else { |
|
110 | 110 | return parent::composeInnerString(); |
111 | 111 | } |
112 | 112 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | public function __toString(){ |
36 | 36 | if(!empty($this->name) && !empty($this->value)){ |
37 | 37 | return ' ' . $this->name . '="' . $this->value . '"'; |
38 | - }else{ |
|
38 | + } else{ |
|
39 | 39 | return ''; |
40 | 40 | } |
41 | 41 | } |
@@ -6,13 +6,13 @@ |
||
6 | 6 | * @author Zilvinas Vaira |
7 | 7 | * |
8 | 8 | */ |
9 | -class Button extends Tag{ |
|
9 | +class Button extends Tag { |
|
10 | 10 | |
11 | 11 | const SUBMIT_TYPE = 'submit'; |
12 | 12 | const RESET_TYPE = 'reset'; |
13 | 13 | const BUTTON_TYPE = 'button'; |
14 | 14 | |
15 | - public function __construct($title, $type = self::SUBMIT_TYPE, $name = '', $value = '', $class = ''){ |
|
15 | + public function __construct($title, $type = self::SUBMIT_TYPE, $name = '', $value = '', $class = '') { |
|
16 | 16 | parent::__construct('button'); |
17 | 17 | $this->addAttribute('type', $type); |
18 | 18 | $this->addAttribute('name', $name); |