Skip to content

Commit 0a55f1c

Browse files
committed
CS fixes
1 parent 367109a commit 0a55f1c

File tree

6 files changed

+85
-27
lines changed

6 files changed

+85
-27
lines changed

src/RbComment/Controller/CommentController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function addAction()
3939
$comment->visible = $rbCommentConfig->default_visibility;
4040

4141
// If akismet is enabled check for spam
42-
if(($rbCommentConfig->akismet['enabled'] === true) &&
42+
if (($rbCommentConfig->akismet['enabled'] === true) &&
4343
$this->isSpam($comment, $rbCommentConfig)) {
4444
$comment->spam = 1;
4545
$comment->visible = 0;
@@ -49,7 +49,7 @@ public function addAction()
4949
$comment->id = $this->getCommentTable()->saveComment($comment);
5050

5151
// Send email if active and not spam
52-
if(($rbCommentConfig->email['notify'] === true) &&
52+
if (($rbCommentConfig->email['notify'] === true) &&
5353
($comment->spam === 0)) {
5454
$this->rbMailer($comment);
5555
}

src/RbComment/View/Helper/Comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Zend\ServiceManager\ServiceLocatorInterface;
77
use Zend\ServiceManager\ServiceLocatorAwareInterface;
88

9-
class Comment extends AbstractHelper implements ServiceLocatorAwareInterface
9+
class Comment extends AbstractHelper implements ServiceLocatorAwareInterface
1010
{
1111
private $serviceLocator;
1212

tests/RbCommentTest/Controller/CommentControllerTest.php

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ class CommentControllerTest extends PHPUnit_Framework_TestCase
1414

1515
public function setUp()
1616
{
17-
$this->serviceLocatorMock = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface',
18-
array('get', 'has'), array(), 'ServiceLocatorInterface');
17+
$this->serviceLocatorMock = $this->getMock(
18+
'Zend\ServiceManager\ServiceLocatorInterface',
19+
array('get', 'has'),
20+
array(),
21+
'ServiceLocatorInterface'
22+
);
1923

2024
// Global values
2125
$_SERVER['HTTP_USER_AGENT'] = 'RbComment Testing Suite';
@@ -36,8 +40,13 @@ public function testIsSpam($comment, $isSpam)
3640
),
3741
);
3842

39-
$akismetServiceMock = $this->getMock('ZendService\Akismet\Akismet',
40-
array('isSpam'), array(), '', false);
43+
$akismetServiceMock = $this->getMock(
44+
'ZendService\Akismet\Akismet',
45+
array('isSpam'),
46+
array(),
47+
'',
48+
false
49+
);
4150

4251
$akismetServiceMock->expects($this->once())
4352
->method('isSpam')
@@ -87,8 +96,13 @@ public static function isSpamDataProvider()
8796

8897
public function testGetCommentTableReturnsAnInstanceOfCommentTable()
8998
{
90-
$tableGatewayMock = $this->getMock('Zend\Db\TableGateway\TableGateway',
91-
array(), array(), '', false);
99+
$tableGatewayMock = $this->getMock(
100+
'Zend\Db\TableGateway\TableGateway',
101+
array(),
102+
array(),
103+
'',
104+
false
105+
);
92106

93107
$commentTable = new CommentTable($tableGatewayMock);
94108

tests/RbCommentTest/Model/CommentTableTest.php

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ class CommentTableTest extends PHPUnit_Framework_TestCase
1212
{
1313
public function testConstructorSetsDependencies()
1414
{
15-
$tableGatewayMock = $this->getMock('Zend\Db\TableGateway\TableGateway',
16-
array(), array(), 'TableGateway', false);
15+
$tableGatewayMock = $this->getMock(
16+
'Zend\Db\TableGateway\TableGateway', array(), array(),
17+
'TableGateway', false);
1718
$commentTable = new CommentTable($tableGatewayMock);
1819

1920
$reflectedCommentTable = new ReflectionClass($commentTable);
@@ -29,8 +30,13 @@ public function testConstructorSetsDependencies()
2930
public function testFetchAllReturnsAllComments()
3031
{
3132
$resultSet = new ResultSet();
32-
$tableGatewayMock = $this->getMock('Zend\Db\TableGateway\TableGateway',
33-
array('select'), array(), '', false);
33+
$tableGatewayMock = $this->getMock(
34+
'Zend\Db\TableGateway\TableGateway',
35+
array('select'),
36+
array(),
37+
'',
38+
false
39+
);
3440
$tableGatewayMock->expects($this->once())
3541
->method('select')
3642
->will($this->returnValue($resultSet));
@@ -43,8 +49,14 @@ public function testFetchAllReturnsAllComments()
4349
public function testFetchAllForThreadReturnsAllTheCommentsInThread()
4450
{
4551
$resultSet = new ResultSet();
46-
$tableGatewayMock = $this->getMock('Zend\Db\TableGateway\TableGateway',
47-
array('selectWith'), array(), '', false);
52+
$tableGatewayMock = $this->getMock(
53+
'Zend\Db\TableGateway\TableGateway',
54+
array('selectWith'),
55+
array(),
56+
'',
57+
false
58+
);
59+
4860
$tableGatewayMock->expects($this->once())
4961
->method('selectWith')
5062
->will($this->returnValue($resultSet));
@@ -72,8 +84,14 @@ public function testCanRetrieveACommentByItsId()
7284
$resultSet->setArrayObjectPrototype(new Comment());
7385
$resultSet->initialize(array($comment));
7486

75-
$tableGatewayMock = $this->getMock('Zend\Db\TableGateway\TableGateway',
76-
array('select'), array(), '', false);
87+
$tableGatewayMock = $this->getMock(
88+
'Zend\Db\TableGateway\TableGateway',
89+
array('select'),
90+
array(),
91+
'',
92+
false
93+
);
94+
7795
$tableGatewayMock->expects($this->once())
7896
->method('select')
7997
->with(array('id' => 12345))
@@ -99,8 +117,14 @@ public function testSaveCommentWillInsertNewCommentIfDoesNotAlreadyHaveAnId()
99117

100118
$comment->exchangeArray($commentData);
101119

102-
$tableGatewayMock = $this->getMock('Zend\Db\TableGateway\TableGateway',
103-
array('insert'), array(), '', false);
120+
$tableGatewayMock = $this->getMock(
121+
'Zend\Db\TableGateway\TableGateway',
122+
array('insert'),
123+
array(),
124+
'',
125+
false
126+
);
127+
104128
$tableGatewayMock->expects($this->once())
105129
->method('insert')
106130
->with($commentData);
@@ -129,8 +153,14 @@ public function testSaveCommentWillUpdateExistingCommentIfItAlreadyHasAnId()
129153
$resultSet->setArrayObjectPrototype(new Comment());
130154
$resultSet->initialize(array($comment));
131155

132-
$tableGatewayMock = $this->getMock('Zend\Db\TableGateway\TableGateway',
133-
array('select', 'update'), array(), '', false);
156+
$tableGatewayMock = $this->getMock(
157+
'Zend\Db\TableGateway\TableGateway',
158+
array('select', 'update'),
159+
array(),
160+
'',
161+
false
162+
);
163+
134164
$tableGatewayMock->expects($this->once())
135165
->method('select')
136166
->with(array('id' => 12345))
@@ -153,8 +183,14 @@ public function testSaveCommentWillUpdateExistingCommentIfItAlreadyHasAnId()
153183

154184
public function testCanDeleteACommentByItsId()
155185
{
156-
$tableGatewayMock = $this->getMock('Zend\Db\TableGateway\TableGateway',
157-
array('delete'), array(), '', false);
186+
$tableGatewayMock = $this->getMock(
187+
'Zend\Db\TableGateway\TableGateway',
188+
array('delete'),
189+
array(),
190+
'',
191+
false
192+
);
193+
158194
$tableGatewayMock->expects($this->once())
159195
->method('delete')
160196
->with(array('id' => 12345));

tests/RbCommentTest/Mvc/Controller/Plugin/MailerTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ class MailerTest extends PHPUnit_Framework_TestCase
99
{
1010
public function testSetAndGetServiceLocator()
1111
{
12-
$serviceLocatorMock = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface',
13-
array(), array(), 'ServiceLocatorInterface');
12+
$serviceLocatorMock = $this->getMock(
13+
'Zend\ServiceManager\ServiceLocatorInterface',
14+
array(),
15+
array(),
16+
'ServiceLocatorInterface'
17+
);
1418

1519
$mailer = new Mailer();
1620
$mailer->setServiceLocator($serviceLocatorMock);

tests/RbCommentTest/View/Helper/CommentTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ class CommentTest extends PHPUnit_Framework_TestCase
99
{
1010
public function testSetAndGetServiceLocator()
1111
{
12-
$serviceLocatorMock = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface',
13-
array(), array(), 'ServiceLocatorInterface');
12+
$serviceLocatorMock = $this->getMock(
13+
'Zend\ServiceManager\ServiceLocatorInterface',
14+
array(),
15+
array(),
16+
'ServiceLocatorInterface'
17+
);
1418

1519
$commentViewHelper = new RbCommentViewHelper();
1620
$commentViewHelper->setServiceLocator($serviceLocatorMock);

0 commit comments

Comments
 (0)