Skip to content

Commit b890233

Browse files
committed
initially setting up the files and analysis configs
1 parent cc29c0f commit b890233

7 files changed

+302
-12
lines changed

.codeclimate.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
engines:
3+
duplication:
4+
enabled: true
5+
config:
6+
languages:
7+
- javascript
8+
- php
9+
checks:
10+
ExcessivePublicCount:
11+
enabled: false
12+
Similar code:
13+
enabled: false
14+
Identical code:
15+
enabled: false
16+
fixme:
17+
enabled: true
18+
phpmd:
19+
enabled: true
20+
config:
21+
CyclomaticComplexity:
22+
reportLevel: 100
23+
ExcessiveClassComplexity:
24+
maximum: 200
25+
NpathComplexity:
26+
minimum: 500
27+
TooManyMethods:
28+
maxmethods: 50
29+
WeightedMethodCount:
30+
maxmethods: 50
31+
ExcessiveMethodLength:
32+
minimum: 250
33+
ignore-whitespace: true
34+
checks:
35+
UnusedFormalParameter:
36+
enabled: false
37+
Design/NpathComplexity:
38+
enabled: false
39+
Design/WeightedMethodCount:
40+
enabled: false
41+
Design/LongMethod:
42+
enabled: false
43+
CyclomaticComplexity:
44+
enabled: false
45+
ExcessivePublicCount:
46+
enabled: false
47+
Design/TooManyMethods:
48+
enabled: false
49+
Design/TooManyPublicMethods:
50+
enabled: false
51+
Naming/ShortVariable:
52+
enabled: false
53+
CleanCode/BooleanArgumentFlag:
54+
enabled: false
55+
Controversial/Superglobals:
56+
enabled: false
57+
CleanCode/ElseExpression:
58+
enabled: false
59+
CleanCode/StaticAccess:
60+
enabled: false
61+
ratings:
62+
paths:
63+
- "**.inc"
64+
- "**.js"
65+
- "**.php"
66+
exclude_paths:
67+
- tests/

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
composer.lock
2+
vendor/

.scrutinizer.yml

+185
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
filter:
2+
excluded_paths:
3+
- tests/*
4+
build:
5+
environment:
6+
php: 7.0
7+
cache:
8+
disabled: false
9+
directories:
10+
- ~/.composer/cache
11+
- tmp/
12+
- vendor/
13+
dependencies:
14+
override:
15+
- composer self-update
16+
- composer update --with-dependencies -v -o
17+
tests:
18+
override:
19+
#- jshint-run $(ls public_html/js/*.js)
20+
#- shellcheck-run -s bash $(ls scripts/*/*.sh)
21+
#- csslint-run --exclude-list=public_html/css/domains.css,public_html/css/minified,public_html/css/reset.css,public_html/css/price_win.css public_html/css
22+
-
23+
command: 'vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/ -v --coverage-clover coverage.xml --whitelist src/'
24+
#command: 'phpdbg -qrr vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/ -v --coverage-clover coverage.xml --whitelist src/'
25+
coverage:
26+
file: 'coverage.xml'
27+
format: 'clover'
28+
checks:
29+
php:
30+
duplication: true
31+
uppercase_constants: true
32+
return_doc_comment_if_not_inferrable: true
33+
return_doc_comments: true
34+
remove_extra_empty_lines: true
35+
phpunit_assertions: true
36+
avoid_fixme_comments: true
37+
param_doc_comment_if_not_inferrable: true
38+
parameter_doc_comments: true
39+
simplify_boolean_return: true
40+
remove_extra_empty_lines: true
41+
property_assignments: true
42+
properties_in_camelcaps: true
43+
precedence_mistakes: true
44+
precedence_in_conditions: true
45+
phpunit_assertions: true
46+
php5_style_constructor: true
47+
parse_doc_comments: true
48+
parameters_in_camelcaps: true
49+
parameter_doc_comments: true
50+
param_doc_comment_if_not_inferrable: true
51+
one_class_per_file: true
52+
non_commented_empty_catch_block: true
53+
no_unnecessary_if: true
54+
no_trailing_whitespace: true
55+
no_short_open_tag: true
56+
no_non_implemented_abstract_methods: true
57+
no_goto: true
58+
no_long_variable_names:
59+
maximum: '25'
60+
more_specific_types_in_doc_comments: true
61+
missing_arguments: true
62+
instanceof_class_exists: true
63+
fix_use_statements:
64+
remove_unused: true
65+
preserve_multiple: false
66+
preserve_blanklines: false
67+
order_alphabetically: true
68+
fix_doc_comments: true
69+
encourage_shallow_comparison: true
70+
deprecated_code_usage: true
71+
deadlock_detection_in_loops: true
72+
comparison_always_same_result: true
73+
code_rating: true
74+
blank_line_after_namespace_declaration: true
75+
avoid_usage_of_logical_operators: true
76+
avoid_perl_style_comments: true
77+
avoid_fixme_comments: true
78+
avoid_duplicate_types: true
79+
avoid_corrupting_byteorder_marks: true
80+
avoid_closing_tag: true
81+
argument_type_checks: true
82+
coding_style:
83+
php:
84+
indentation:
85+
general:
86+
use_tabs: true
87+
size: 4
88+
switch:
89+
indent_case: true
90+
spaces:
91+
general:
92+
linefeed_character: newline
93+
before_parentheses:
94+
function_declaration: false
95+
closure_definition: false
96+
function_call: false
97+
if: true
98+
for: true
99+
while: true
100+
switch: true
101+
catch: true
102+
array_initializer: false
103+
around_operators:
104+
assignment: true
105+
logical: true
106+
equality: true
107+
relational: true
108+
bitwise: true
109+
additive: true
110+
multiplicative: true
111+
shift: true
112+
unary_additive: false
113+
concatenation: false
114+
negation: false
115+
before_left_brace:
116+
class: true
117+
function: true
118+
if: true
119+
else: true
120+
for: true
121+
while: true
122+
do: true
123+
switch: true
124+
try: true
125+
catch: true
126+
finally: true
127+
before_keywords:
128+
else: true
129+
while: true
130+
catch: true
131+
finally: true
132+
within:
133+
brackets: false
134+
array_initializer: false
135+
grouping: false
136+
function_call: false
137+
function_declaration: false
138+
if: false
139+
for: false
140+
while: false
141+
switch: false
142+
catch: false
143+
type_cast: false
144+
ternary_operator:
145+
before_condition: true
146+
after_condition: true
147+
before_alternative: true
148+
after_alternative: true
149+
in_short_version: false
150+
other:
151+
before_comma: false
152+
after_comma: true
153+
before_semicolon: false
154+
after_semicolon: true
155+
after_type_cast: true
156+
braces:
157+
classes_functions:
158+
class: end-of-line
159+
function: end-of-line
160+
closure: end-of-line
161+
if:
162+
opening: end-of-line
163+
always: false
164+
else_on_new_line: false
165+
for:
166+
opening: end-of-line
167+
always: false
168+
while:
169+
opening: end-of-line
170+
always: false
171+
do_while:
172+
opening: end-of-line
173+
always: false
174+
while_on_new_line: false
175+
switch:
176+
opening: end-of-line
177+
try:
178+
opening: end-of-line
179+
catch_on_new_line: false
180+
finally_on_new_line: false
181+
upper_lower_casing:
182+
keywords:
183+
general: lower
184+
constants:
185+
true_false_null: upper

.travis.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
env:
2+
global:
3+
- GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
4+
language: php
5+
os: linux
6+
dist: trusty
7+
sudo: false
8+
php:
9+
- 5.4
10+
- 5.5
11+
- 5.6
12+
- 7.0
13+
- 7.1
14+
cache:
15+
directories:
16+
- $HOME/.composer/cache/files
17+
- tmp/pear/download/
18+
- vendor/
19+
addons:
20+
code_climate:
21+
repo_token: $CODECLIMATE_REPO_TOKEN
22+
before_script:
23+
- mkdir -p build/logs
24+
- phpenv config-rm xdebug.ini
25+
- pear install pear/XML_RPC2
26+
- phpenv rehash
27+
- travis_retry composer self-update
28+
- travis_retry composer update --with-dependencies --no-interaction --dev --prefer-dist
29+
script:
30+
- if [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then phpdbg -qrr vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/ -v --coverage-clover coverage.xml --whitelist src/; fi;
31+
- if [ "$TRAVIS_PHP_VERSION" != "7.0" ]; then vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/ -v; fi
32+
after_success:
33+
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then travis_retry vendor/bin/test-reporter --coverage-report=coverage.xml; fi
34+
- if [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then travis_retry bash <(curl -s https://codecov.io/bash); fi;
35+
- if [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then travis_retry php vendor/bin/coveralls -v --coverage_clover=coverage.xml; fi;
36+
- if [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then travis_retry php vendor/bin/codacycoverage clover coverage.xml; fi;

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# AuthorizeNet handling plugin for MyAdmin
1+
# Authorizenet handling plugin for MyAdmin
22

3-
AuthorizeNet handling plugin for MyAdmin
3+
Authorizenet handling plugin for MyAdmin
44

55
## Build Status and Code Analysis
66

@@ -24,5 +24,5 @@ composer require detain/myadmin-authorizenet-payments
2424

2525
## License
2626

27-
The AuthorizeNet handling plugin for MyAdmin class is licensed under the LGPL-v2 license.
27+
The Authorizenet handling plugin for MyAdmin class is licensed under the LGPL-v2 license.
2828

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "detain/myadmin-authorizenet-payments",
33
"type": "myadmin-plugin",
4-
"description": "AuthorizeNet handling plugin for MyAdmin",
4+
"description": "Authorizenet handling plugin for MyAdmin",
55
"keywords": ["abuse","administration","spam"],
66
"license": "LGPL-2.1",
77
"authors": [
@@ -28,6 +28,6 @@
2828
"codacy/coverage": "dev-master"
2929
},
3030
"autoload": {
31-
"psr-4": {"Detain\\MyAdminAuthorizeNet\\": "src/"}
31+
"psr-4": {"Detain\\MyAdminAuthorizenet\\": "src/"}
3232
}
3333
}

src/Plugin.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace Detain\MyAdminAuthorizeNet;
3+
namespace Detain\MyAdminAuthorizenet;
44

55
use Symfony\Component\EventDispatcher\GenericEvent;
66

77
class Plugin {
88

9-
public static $name = 'AuthorizeNet Plugin';
10-
public static $description = 'Allows handling of AuthorizeNet emails and honeypots';
9+
public static $name = 'Authorizenet Plugin';
10+
public static $description = 'Allows handling of Authorizenet emails and honeypots';
1111
public static $help = '';
1212
public static $type = 'plugin';
1313

@@ -27,22 +27,22 @@ public static function getMenu(GenericEvent $event) {
2727
if ($GLOBALS['tf']->ima == 'admin') {
2828
function_requirements('has_acl');
2929
if (has_acl('client_billing'))
30-
$menu->add_link('admin', 'choice=none.abuse_admin', '//my.interserver.net/bower_components/webhostinghub-glyphs-icons/icons/development-16/Black/icon-spam.png', 'AuthorizeNet');
30+
$menu->add_link('admin', 'choice=none.abuse_admin', '//my.interserver.net/bower_components/webhostinghub-glyphs-icons/icons/development-16/Black/icon-spam.png', 'Authorizenet');
3131
}
3232
}
3333

3434
public static function getRequirements(GenericEvent $event) {
3535
$loader = $event->getSubject();
36-
$loader->add_requirement('class.AuthorizeNet', '/../vendor/detain/myadmin-authorizenet-payments/src/AuthorizeNet.php');
36+
$loader->add_requirement('class.Authorizenet', '/../vendor/detain/myadmin-authorizenet-payments/src/Authorizenet.php');
3737
$loader->add_requirement('deactivate_kcare', '/../vendor/detain/myadmin-authorizenet-payments/src/abuse.inc.php');
3838
$loader->add_requirement('deactivate_abuse', '/../vendor/detain/myadmin-authorizenet-payments/src/abuse.inc.php');
3939
$loader->add_requirement('get_abuse_licenses', '/../vendor/detain/myadmin-authorizenet-payments/src/abuse.inc.php');
4040
}
4141

4242
public static function getSettings(GenericEvent $event) {
4343
$settings = $event->getSubject();
44-
$settings->add_text_setting('General', 'AuthorizeNet', 'abuse_imap_user', 'AuthorizeNet IMAP User:', 'AuthorizeNet IMAP Username', ABUSE_IMAP_USER);
45-
$settings->add_text_setting('General', 'AuthorizeNet', 'abuse_imap_pass', 'AuthorizeNet IMAP Pass:', 'AuthorizeNet IMAP Password', ABUSE_IMAP_PASS);
44+
$settings->add_text_setting('General', 'Authorizenet', 'abuse_imap_user', 'Authorizenet IMAP User:', 'Authorizenet IMAP Username', ABUSE_IMAP_USER);
45+
$settings->add_text_setting('General', 'Authorizenet', 'abuse_imap_pass', 'Authorizenet IMAP Pass:', 'Authorizenet IMAP Password', ABUSE_IMAP_PASS);
4646
}
4747

4848
}

0 commit comments

Comments
 (0)