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

Commit 795ea25

Browse files
committed
Fix internal nomenclature for attribs
1 parent 0165929 commit 795ea25

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/Helper/Gravatar.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Gravatar extends AbstractHtmlElement
4747
*
4848
* @var array
4949
*/
50-
protected $attribs;
50+
protected $attributes;
5151

5252
/**
5353
* Email Address
@@ -86,21 +86,21 @@ class Gravatar extends AbstractHtmlElement
8686
*
8787
* @see http://pl.gravatar.com/site/implement/url
8888
* @see http://pl.gravatar.com/site/implement/url More information about gravatar's service.
89-
* @param string|null $email Email address.
90-
* @param null|array $options Options
91-
* @param array $attribs Attributes for image tag (title, alt etc.)
89+
* @param string|null $email Email address.
90+
* @param null|array $options Options
91+
* @param array $attributes Attributes for image tag (title, alt etc.)
9292
* @return Gravatar
9393
*/
94-
public function __invoke($email = "", $options = [], $attribs = [])
94+
public function __invoke($email = "", $options = [], $attributes = [])
9595
{
9696
if (! empty($email)) {
9797
$this->setEmail($email);
9898
}
9999
if (! empty($options)) {
100100
$this->setOptions($options);
101101
}
102-
if (! empty($attribs)) {
103-
$this->setAttributes($attribs);
102+
if (! empty($attributes)) {
103+
$this->setAttributes($attributes);
104104
}
105105

106106
return $this;
@@ -186,7 +186,7 @@ public function getImgTag()
186186
*/
187187
public function setAttributes(array $attributes)
188188
{
189-
$this->attribs = $attributes;
189+
$this->attributes = $attributes;
190190
return $this;
191191
}
192192

@@ -222,7 +222,7 @@ public function setAttribs(array $attribs)
222222
*/
223223
public function getAttributes()
224224
{
225-
return $this->attribs;
225+
return $this->attributes;
226226
}
227227

228228
/**
@@ -395,8 +395,8 @@ public function getSecure()
395395
*/
396396
protected function setSrcAttribForImg()
397397
{
398-
$attribs = $this->getAttributes();
399-
$attribs['src'] = $this->getAvatarUrl();
400-
$this->setAttributes($attribs);
398+
$attributes = $this->getAttributes();
399+
$attributes['src'] = $this->getAvatarUrl();
400+
$this->setAttributes($attributes);
401401
}
402402
}

test/Helper/GravatarTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,17 @@ public function testGravatarHtmlDoctype()
8787
*/
8888
public function testGetAndSetMethods()
8989
{
90-
$attribs = ['class' => 'gravatar', 'title' => 'avatar', 'id' => 'gravatar-1'];
90+
$attributes = ['class' => 'gravatar', 'title' => 'avatar', 'id' => 'gravatar-1'];
9191
$this->helper->setDefaultImg('monsterid')
9292
->setImgSize(150)
9393
->setSecure(true)
9494
->setEmail("[email protected]")
95-
->setAttributes($attribs)
95+
->setAttributes($attributes)
9696
->setRating('pg');
9797
$this->assertEquals("monsterid", $this->helper->getDefaultImg());
9898
$this->assertEquals("pg", $this->helper->getRating());
9999
$this->assertEquals("[email protected]", $this->helper->getEmail());
100-
$this->assertEquals($attribs, $this->helper->getAttributes());
100+
$this->assertEquals($attributes, $this->helper->getAttributes());
101101
$this->assertEquals(150, $this->helper->getImgSize());
102102
$this->assertTrue($this->helper->getSecure());
103103
}
@@ -166,9 +166,9 @@ public function testHttpsSource()
166166
}
167167

168168
/**
169-
* Test HTML attribs
169+
* Test HTML attributes
170170
*/
171-
public function testImgAttribs()
171+
public function testImgAttributes()
172172
{
173173
$this->assertRegExp(
174174
'/class="gravatar" title="Gravatar"/',
@@ -235,7 +235,7 @@ public function testAutoDetectLocationOnIis()
235235
);
236236
}
237237

238-
public function testSetAttribsWithSrcKey()
238+
public function testSetAttributesWithSrcKey()
239239
{
240240
$email = '[email protected]';
241241
$this->helper->setEmail($email);

0 commit comments

Comments
 (0)