Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit e3344bd

Browse files
committed
Cs fixes
1 parent 7376be7 commit e3344bd

5 files changed

Lines changed: 136 additions & 65 deletions

File tree

Controller/Component/RecaptchaComponent.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ class RecaptchaComponent extends Component {
7171
'errorField' => 'recaptcha',
7272
'actions' => array()
7373
);
74-
75-
/**
74+
75+
/**
7676
* Constructor
7777
*
7878
* @param ComponentCollection $collection A ComponentCollection this component can use to lazy load its components
@@ -91,8 +91,8 @@ public function __construct(ComponentCollection $collection, $settings = array()
9191
/**
9292
* Callback
9393
*
94-
* @param Controller $controller
95-
* @param array $settings
94+
* @param Controller $controller Controller with components to initialize
95+
* @param array $settings Array of configuration settings
9696
* @throws Exception Throws an exception if Recaptchas config is not present
9797
* @return void
9898
*/
@@ -115,7 +115,7 @@ public function initialize(Controller $controller, $settings = array()) {
115115
/**
116116
* Callback
117117
*
118-
* @param Controller $controller
118+
* @param Controller $controller Controller with components to initialize
119119
* @return void
120120
*/
121121
public function startup(Controller $controller) {

Model/Behavior/RecaptchaBehavior.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ class RecaptchaBehavior extends ModelBehavior {
3636
/**
3737
* Setup
3838
*
39-
* @param Model $Model
40-
* @param array $settings
39+
* @param Model $Model Model using this behavior
40+
* @param array $settings Configuration settings for $model
41+
* @return void
4142
*/
4243
public function setup(Model $Model, $settings = array()) {
4344
if (!isset($this->settings[$Model->alias])) {
@@ -49,7 +50,7 @@ public function setup(Model $Model, $settings = array()) {
4950
/**
5051
* Validates the captcha responses status set by the component to the model
5152
*
52-
* @param Model $Model
53+
* @param Model $Model Model using this behavior
5354
* @return boolean
5455
* @see RecaptchaComponent::initialize()
5556
*/
@@ -63,8 +64,8 @@ public function validateCaptcha(Model $Model) {
6364
/**
6465
* Validates the captcha
6566
*
66-
* @param Model $Model
67-
* @param array $options
67+
* @param Model $Model Model using this behavior
68+
* @param array $options Options passed from Model::save()
6869
* @return void
6970
*/
7071
public function beforeValidate(Model $Model, $options = array()) {

Test/Case/Controller/Component/RecaptchaComponentTest.php

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,59 @@
1515

1616
if (!class_exists('ArticlesTestController')) {
1717
class ArticleTestController extends Controller {
18+
19+
/**
20+
* Class name.
21+
*
22+
* @var string
23+
*/
1824
public $name = 'ArticleTests';
25+
26+
/**
27+
* An array of names of components to load.
28+
*
29+
* @var array
30+
*/
1931
public $components = array('Recaptcha.Recaptcha');
32+
33+
/**
34+
* An array of names of models to load.
35+
*
36+
* @var array
37+
*/
2038
public $uses = array('RecaptchaTestArticle');
39+
40+
/**
41+
*
42+
*/
2143
public function test_captcha() {
2244
}
45+
2346
}
2447
}
2548

2649
if (!class_exists('RecaptchaTestArticle')) {
2750
class RecaptchaTestArticle extends CakeTestModel {
51+
52+
/**
53+
* Class name.
54+
*
55+
* @var string
56+
*/
2857
public $name = 'RecaptchaTestArticle';
58+
59+
/**
60+
* An array of names of behaviors to load.
61+
*
62+
* @var array
63+
*/
2964
public $actsAs = array('Recaptcha.Recaptcha');
65+
66+
/**
67+
* Use table.
68+
*
69+
* @var mixed False or table name
70+
*/
3071
public $useTable = 'articles';
3172
}
3273
}
@@ -38,6 +79,7 @@ class RecaptchaTestArticle extends CakeTestModel {
3879
* @subpackage recaptcha.tests.cases.components
3980
*/
4081
class RecaptchaComponentTest extends CakeTestCase {
82+
4183
/**
4284
* fixtures property
4385
*
@@ -46,10 +88,10 @@ class RecaptchaComponentTest extends CakeTestCase {
4688
public $fixtures = array('plugin.recaptcha.article');
4789

4890
/**
49-
* setUp method
50-
*
51-
* @return void
52-
*/
91+
* setUp method
92+
*
93+
* @return void
94+
*/
5395
public function setUp() {
5496
parent::setUp();
5597
Configure::write('Recaptcha.privateKey', 'private-key');

Test/Case/Model/Behavior/RecaptchaBehaviorTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,26 @@
1515
* Slugged Article
1616
*/
1717
class RecaptchaArticle extends CakeTestModel {
18+
19+
/**
20+
* Class name.
21+
*
22+
* @var string
23+
*/
1824
public $name = 'RecaptchaArticle';
25+
26+
/**
27+
* An array of names of behaviors to load.
28+
*
29+
* @var array
30+
*/
1931
public $actsAs = array('Recaptcha.Recaptcha');
32+
33+
/**
34+
* Use table.
35+
*
36+
* @var mixed False or table name
37+
*/
2038
public $useTable = 'articles';
2139
}
2240

0 commit comments

Comments
 (0)