Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit b35fa7a

Browse files

25 files changed

+237
-237
lines changed

src/Helper/AbstractHtmlElement.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ abstract class AbstractHtmlElement extends AbstractHelper
2727
*
2828
* @var string
2929
*/
30-
protected $_closingBracket = null;
30+
protected $closingBracket = null;
3131

3232
/**
3333
* Get the tag closing bracket
@@ -36,23 +36,23 @@ abstract class AbstractHtmlElement extends AbstractHelper
3636
*/
3737
public function getClosingBracket()
3838
{
39-
if (!$this->_closingBracket) {
40-
if ($this->_isXhtml()) {
41-
$this->_closingBracket = ' />';
39+
if (!$this->closingBracket) {
40+
if ($this->isXhtml()) {
41+
$this->closingBracket = ' />';
4242
} else {
43-
$this->_closingBracket = '>';
43+
$this->closingBracket = '>';
4444
}
4545
}
4646

47-
return $this->_closingBracket;
47+
return $this->closingBracket;
4848
}
4949

5050
/**
5151
* Is doctype XHTML?
5252
*
5353
* @return boolean
5454
*/
55-
protected function _isXhtml()
55+
protected function isXhtml()
5656
{
5757
$doctype = $this->view->plugin('doctype');
5858
return $doctype->isXhtml();
@@ -68,7 +68,7 @@ protected function _isXhtml()
6868
*
6969
* @return string The XHTML for the attributes.
7070
*/
71-
protected function _htmlAttribs($attribs)
71+
protected function htmlAttribs($attribs)
7272
{
7373
$xhtml = '';
7474
$escaper = $this->view->plugin('escapehtml');
@@ -94,7 +94,7 @@ protected function _htmlAttribs($attribs)
9494
}
9595

9696
if ('id' == $key) {
97-
$val = $this->_normalizeId($val);
97+
$val = $this->normalizeId($val);
9898
}
9999

100100
if (strpos($val, '"') !== false) {
@@ -113,7 +113,7 @@ protected function _htmlAttribs($attribs)
113113
* @param string $value
114114
* @return string
115115
*/
116-
protected function _normalizeId($value)
116+
protected function normalizeId($value)
117117
{
118118
if (strstr($value, '[')) {
119119
if ('[]' == substr($value, -2)) {

src/Helper/Cycle.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ class Cycle extends AbstractHelper implements \Iterator
3030
*
3131
* @var array
3232
*/
33-
protected $_pointers = array(self::DEFAULT_NAME =>-1) ;
33+
protected $pointers = array(self::DEFAULT_NAME =>-1) ;
3434

3535
/**
3636
* Array of values
3737
*
3838
* @var array
3939
*/
40-
protected $_data = array(self::DEFAULT_NAME=>array());
40+
protected $data = array(self::DEFAULT_NAME=>array());
4141

4242
/**
4343
* Actual name of cycle
4444
*
4545
* @var string
4646
*/
47-
protected $_name = self::DEFAULT_NAME;
47+
protected $name = self::DEFAULT_NAME;
4848

4949
/**
5050
* Add elements to alternate
@@ -56,7 +56,7 @@ class Cycle extends AbstractHelper implements \Iterator
5656
public function __invoke(array $data = array(), $name = self::DEFAULT_NAME)
5757
{
5858
if(!empty($data))
59-
$this->_data[$name] = $data;
59+
$this->data[$name] = $data;
6060

6161
$this->setName($name);
6262
return $this;
@@ -72,7 +72,7 @@ public function __invoke(array $data = array(), $name = self::DEFAULT_NAME)
7272
public function assign(Array $data , $name = self::DEFAULT_NAME)
7373
{
7474
$this->setName($name);
75-
$this->_data[$name] = $data;
75+
$this->data[$name] = $data;
7676
$this->rewind();
7777
return $this;
7878
}
@@ -85,12 +85,12 @@ public function assign(Array $data , $name = self::DEFAULT_NAME)
8585
*/
8686
public function setName($name = self::DEFAULT_NAME)
8787
{
88-
$this->_name = $name;
88+
$this->name = $name;
8989

90-
if(!isset($this->_data[$this->_name]))
91-
$this->_data[$this->_name] = array();
90+
if(!isset($this->data[$this->name]))
91+
$this->data[$this->name] = array();
9292

93-
if(!isset($this->_pointers[$this->_name]))
93+
if(!isset($this->pointers[$this->name]))
9494
$this->rewind();
9595

9696
return $this;
@@ -104,7 +104,7 @@ public function setName($name = self::DEFAULT_NAME)
104104
*/
105105
public function getName()
106106
{
107-
return $this->_name;
107+
return $this->name;
108108
}
109109

110110

@@ -115,7 +115,7 @@ public function getName()
115115
*/
116116
public function getAll()
117117
{
118-
return $this->_data[$this->_name];
118+
return $this->data[$this->name];
119119
}
120120

121121
/**
@@ -125,7 +125,7 @@ public function getAll()
125125
*/
126126
public function toString()
127127
{
128-
return (string) $this->_data[$this->_name][$this->key()];
128+
return (string) $this->data[$this->name][$this->key()];
129129
}
130130

131131
/**
@@ -145,11 +145,11 @@ public function __toString()
145145
*/
146146
public function next()
147147
{
148-
$count = count($this->_data[$this->_name]);
149-
if ($this->_pointers[$this->_name] == ($count - 1))
150-
$this->_pointers[$this->_name] = 0;
148+
$count = count($this->data[$this->name]);
149+
if ($this->pointers[$this->name] == ($count - 1))
150+
$this->pointers[$this->name] = 0;
151151
else
152-
$this->_pointers[$this->_name] = ++$this->_pointers[$this->_name];
152+
$this->pointers[$this->name] = ++$this->pointers[$this->name];
153153
return $this;
154154
}
155155

@@ -160,11 +160,11 @@ public function next()
160160
*/
161161
public function prev()
162162
{
163-
$count = count($this->_data[$this->_name]);
164-
if ($this->_pointers[$this->_name] <= 0)
165-
$this->_pointers[$this->_name] = $count - 1;
163+
$count = count($this->data[$this->name]);
164+
if ($this->pointers[$this->name] <= 0)
165+
$this->pointers[$this->name] = $count - 1;
166166
else
167-
$this->_pointers[$this->_name] = --$this->_pointers[$this->_name];
167+
$this->pointers[$this->name] = --$this->pointers[$this->name];
168168
return $this;
169169
}
170170

@@ -175,10 +175,10 @@ public function prev()
175175
*/
176176
public function key()
177177
{
178-
if ($this->_pointers[$this->_name] < 0)
178+
if ($this->pointers[$this->name] < 0)
179179
return 0;
180180
else
181-
return $this->_pointers[$this->_name];
181+
return $this->pointers[$this->name];
182182
}
183183

184184
/**
@@ -188,7 +188,7 @@ public function key()
188188
*/
189189
public function rewind()
190190
{
191-
$this->_pointers[$this->_name] = -1;
191+
$this->pointers[$this->name] = -1;
192192
return $this;
193193
}
194194

@@ -199,7 +199,7 @@ public function rewind()
199199
*/
200200
public function valid()
201201
{
202-
return isset($this->_data[$this->_name][$this->key()]);
202+
return isset($this->data[$this->name][$this->key()]);
203203
}
204204

205205
/**
@@ -209,6 +209,6 @@ public function valid()
209209
*/
210210
public function current()
211211
{
212-
return $this->_data[$this->_name][$this->key()];
212+
return $this->data[$this->name][$this->key()];
213213
}
214214
}

src/Helper/DeclareVars.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ public function __invoke()
5555
foreach($args as $key) {
5656
if (is_array($key)) {
5757
foreach ($key as $name => $value) {
58-
$this->_declareVar($name, $value);
58+
$this->declareVar($name, $value);
5959
}
6060
} elseif (!isset($view->vars()->$key)) {
61-
$this->_declareVar($key);
61+
$this->declareVar($key);
6262
}
6363
}
6464
}
@@ -72,7 +72,7 @@ public function __invoke()
7272
* @param string $value Defaults to an empty string
7373
* @return void
7474
*/
75-
protected function _declareVar($key, $value = '')
75+
protected function declareVar($key, $value = '')
7676
{
7777
$view = $this->getView();
7878
$vars = $view->vars();

src/Helper/Gravatar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public function getImgTag()
332332
{
333333
$this->setSrcAttribForImg();
334334
$html = '<img'
335-
. $this->_htmlAttribs($this->getAttribs())
335+
. $this->htmlAttribs($this->getAttribs())
336336
. $this->getClosingBracket();
337337

338338
return $html;

src/Helper/HeadLink.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ class HeadLink extends Placeholder\Container\AbstractStandalone
2727
*
2828
* @var array
2929
*/
30-
protected $_itemKeys = array('charset', 'href', 'hreflang', 'id', 'media', 'rel', 'rev', 'type', 'title', 'extras');
30+
protected $itemKeys = array('charset', 'href', 'hreflang', 'id', 'media', 'rel', 'rev', 'type', 'title', 'extras');
3131

3232
/**
3333
* @var string registry key
3434
*/
35-
protected $_regKey = 'Zend_View_Helper_HeadLink';
35+
protected $regKey = 'Zend_View_Helper_HeadLink';
3636

3737
/**
3838
* Constructor
@@ -160,15 +160,15 @@ public function __call($method, $args)
160160
* @param mixed $value
161161
* @return boolean
162162
*/
163-
protected function _isValid($value)
163+
protected function isValid($value)
164164
{
165165
if (!$value instanceof \stdClass) {
166166
return false;
167167
}
168168

169169
$vars = get_object_vars($value);
170170
$keys = array_keys($vars);
171-
$intersection = array_intersect($this->_itemKeys, $keys);
171+
$intersection = array_intersect($this->itemKeys, $keys);
172172
if (empty($intersection)) {
173173
return false;
174174
}
@@ -185,7 +185,7 @@ protected function _isValid($value)
185185
*/
186186
public function append($value)
187187
{
188-
if (!$this->_isValid($value)) {
188+
if (!$this->isValid($value)) {
189189
throw new Exception\InvalidArgumentException(
190190
'append() expects a data token; please use one of the custom append*() methods'
191191
);
@@ -204,7 +204,7 @@ public function append($value)
204204
*/
205205
public function offsetSet($index, $value)
206206
{
207-
if (!$this->_isValid($value)) {
207+
if (!$this->isValid($value)) {
208208
throw new Exception\InvalidArgumentException(
209209
'offsetSet() expects a data token; please use one of the custom offsetSet*() methods'
210210
);
@@ -222,7 +222,7 @@ public function offsetSet($index, $value)
222222
*/
223223
public function prepend($value)
224224
{
225-
if (!$this->_isValid($value)) {
225+
if (!$this->isValid($value)) {
226226
throw new Exception\InvalidArgumentException(
227227
'prepend() expects a data token; please use one of the custom prepend*() methods'
228228
);
@@ -240,7 +240,7 @@ public function prepend($value)
240240
*/
241241
public function set($value)
242242
{
243-
if (!$this->_isValid($value)) {
243+
if (!$this->isValid($value)) {
244244
throw new Exception\InvalidArgumentException(
245245
'set() expects a data token; please use one of the custom set*() methods'
246246
);
@@ -261,14 +261,14 @@ public function itemToString(\stdClass $item)
261261
$attributes = (array) $item;
262262
$link = '<link ';
263263

264-
foreach ($this->_itemKeys as $itemKey) {
264+
foreach ($this->itemKeys as $itemKey) {
265265
if (isset($attributes[$itemKey])) {
266266
if(is_array($attributes[$itemKey])) {
267267
foreach($attributes[$itemKey] as $key => $value) {
268-
$link .= sprintf('%s="%s" ', $key, ($this->_autoEscape) ? $this->_escape($value) : $value);
268+
$link .= sprintf('%s="%s" ', $key, ($this->autoEscape) ? $this->escape($value) : $value);
269269
}
270270
} else {
271-
$link .= sprintf('%s="%s" ', $itemKey, ($this->_autoEscape) ? $this->_escape($attributes[$itemKey]) : $attributes[$itemKey]);
271+
$link .= sprintf('%s="%s" ', $itemKey, ($this->autoEscape) ? $this->escape($attributes[$itemKey]) : $attributes[$itemKey]);
272272
}
273273
}
274274
}
@@ -311,7 +311,7 @@ public function toString($indent = null)
311311
$items[] = $this->itemToString($item);
312312
}
313313

314-
return $indent . implode($this->_escape($this->getSeparator()) . $indent, $items);
314+
return $indent . implode($this->escape($this->getSeparator()) . $indent, $items);
315315
}
316316

317317
/**
@@ -340,7 +340,7 @@ public function createDataStylesheet(array $args)
340340
$conditionalStylesheet = false;
341341
$href = array_shift($args);
342342

343-
if ($this->_isDuplicateStylesheet($href)) {
343+
if ($this->isDuplicateStylesheet($href)) {
344344
return false;
345345
}
346346

@@ -376,7 +376,7 @@ public function createDataStylesheet(array $args)
376376
* @param string $uri
377377
* @return bool
378378
*/
379-
protected function _isDuplicateStylesheet($uri)
379+
protected function isDuplicateStylesheet($uri)
380380
{
381381
foreach ($this->getContainer() as $item) {
382382
if (($item->rel == 'stylesheet') && ($item->href == $uri)) {

0 commit comments

Comments
 (0)