Skip to content

Commit bf17ddc

Browse files
committed
PSR corrections and other fixes
1 parent 2e6e85f commit bf17ddc

10 files changed

Lines changed: 15 additions & 15 deletions

File tree

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ trim_trailing_whitespace = true
1313
trim_trailing_whitespace = false
1414

1515
[*.yml]
16-
indent_size = 4
1716
indent_style = space

acp/ideas_module.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ class ideas_module
1616
public $u_action;
1717

1818
/**
19-
* Main ACP module
20-
*
21-
* @access public
22-
*/
19+
* Main ACP module
20+
*
21+
* @access public
22+
* @throws \Exception
23+
*/
2324
public function main()
2425
{
2526
global $phpbb_container;

controller/idea_controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function idea($idea_id)
4242
$mode = $this->request->variable('mode', '');
4343
if (!empty($mode) && $this->request->is_ajax())
4444
{
45-
$result = call_user_func(array($this, $mode));
45+
$result = $this->$mode();
4646

4747
return new \Symfony\Component\HttpFoundation\JsonResponse($result);
4848
}

event/listener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function __construct(auth $auth, config $config, helper $helper, ideas $i
7878
/**
7979
* @inheritDoc
8080
*/
81-
static public function getSubscribedEvents()
81+
public static function getSubscribedEvents()
8282
{
8383
return array(
8484
'core.viewforum_get_topic_data' => 'ideas_forum_redirect',
@@ -334,9 +334,9 @@ public function viewonline_ideas($event)
334334
public function edit_idea_title($event)
335335
{
336336
if ($event['mode'] !== 'edit' ||
337+
$event['post_data']['topic_first_post_id'] != $event['post_id'] ||
337338
!$event['update_subject'] ||
338-
!$this->is_ideas_forum($event['forum_id']) ||
339-
$event['post_data']['topic_first_post_id'] != $event['post_id'])
339+
!$this->is_ideas_forum($event['forum_id']))
340340
{
341341
return;
342342
}

factory/ideas.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public function set_title($idea_id, $title)
421421
* @param int $user_id The ID of the user voting.
422422
* @param int $value Up (1) or down (0)?
423423
*
424-
* @return array Array of information.
424+
* @return array|string Array of information or string on error.
425425
*/
426426
public function vote(&$idea, $user_id, $value)
427427
{

tests/factory/linkhelper_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class linkhelper_test extends \phpbb_database_test_case
1414
{
15-
static protected function setup_extensions()
15+
protected static function setup_extensions()
1616
{
1717
return array('phpbb/ideas');
1818
}

tests/functional/ideas_functional_base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ideas_functional_base extends \phpbb_functional_test_case
2020
*
2121
* @return array vendor/name of extension(s) to test
2222
*/
23-
static protected function setup_extensions()
23+
protected static function setup_extensions()
2424
{
2525
return array('phpbb/ideas');
2626
}

tests/functional/ideas_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function create_idea($title, $message)
135135

136136
// Get the new idea's ID and add it to the data array
137137
$url = $crawler->selectLink($this->lang('REMOVE_VOTE'))->link()->getUri();
138-
preg_match('#\/idea\/(\d+)\?#', $url, $matches);
138+
preg_match('#/idea/(\d+)\?#', $url, $matches);
139139
$data['idea_id'] = $matches ? $matches[1] : null;
140140

141141
return $data;

tests/ideas/get_ideas_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class get_ideas_test extends ideas_base
3232
public function test_get_ideas($test_data, $expected)
3333
{
3434
// Initialize get_ideas argument values
35-
$number = $sort = $sort_direction = $status = $where = $start = null;
35+
$number = $sort = $sort_direction = $status = $start = null;
3636

3737
// Update the default values array with test values
3838
foreach ($test_data as $key => $var)

tests/ideas/ideas_base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class ideas_base extends \phpbb_database_test_case
1414
{
15-
static protected function setup_extensions()
15+
protected static function setup_extensions()
1616
{
1717
return array('phpbb/ideas');
1818
}

0 commit comments

Comments
 (0)