Skip to content

Commit 379b700

Browse files
committed
Add config for scrutinizer
1 parent 38fc062 commit 379b700

12 files changed

+200
-290
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ docs/phpdoc/
22
test/message.txt
33
test/testbootstrap.php
44
.idea
5+
build/

.scrutinizer.yml

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
before_commands:
2+
- "composer install --prefer-source"
3+
4+
tools:
5+
# Code Coverage
6+
external_code_coverage:
7+
enabled: true
8+
timeout: 300
9+
filter:
10+
excluded_paths:
11+
- 'docs/*'
12+
- 'examples/*'
13+
- 'extras/*'
14+
- 'test/*'
15+
- 'vendor/*'
16+
17+
18+
php_code_coverage:
19+
enabled: false
20+
test_command: phpunit
21+
filter:
22+
excluded_paths:
23+
- 'docs/*'
24+
- 'examples/*'
25+
- 'extras/*'
26+
- 'test/*'
27+
- 'vendor/*'
28+
29+
30+
# Code Sniffer
31+
php_code_sniffer:
32+
enabled: true
33+
command: phpcs
34+
config:
35+
standard: PSR2
36+
filter:
37+
excluded_paths:
38+
- 'docs/*'
39+
- 'examples/*'
40+
- 'extras/*'
41+
- 'test/*'
42+
- 'vendor/*'
43+
44+
45+
# Copy/Paste Detector
46+
php_cpd:
47+
enabled: true
48+
command: phpcpd
49+
excluded_dirs:
50+
- docs
51+
- examples
52+
- extras
53+
- test
54+
- vendor
55+
56+
57+
# PHP CS Fixer (http://http://cs.sensiolabs.org/).
58+
php_cs_fixer:
59+
enabled: true
60+
command: php-cs-fixer
61+
config:
62+
level: psr2
63+
filter:
64+
excluded_paths:
65+
- 'docs/*'
66+
- 'examples/*'
67+
- 'extras/*'
68+
- 'test/*'
69+
- 'vendor/*'
70+
71+
72+
# Analyzes the size and structure of a PHP project.
73+
php_loc:
74+
enabled: true
75+
command: phploc
76+
excluded_dirs:
77+
- docs
78+
- examples
79+
- extras
80+
- test
81+
- vendor
82+
83+
84+
# PHP Mess Detector (http://phpmd.org).
85+
php_mess_detector:
86+
enabled: true
87+
command: phpmd
88+
config:
89+
rulesets:
90+
- codesize
91+
- unusedcode
92+
- naming
93+
- design
94+
filter:
95+
excluded_paths:
96+
- 'docs/*'
97+
- 'examples/*'
98+
- 'extras/*'
99+
- 'test/*'
100+
- 'vendor/*'
101+
102+
103+
# Analyzes the size and structure of a PHP project.
104+
php_pdepend:
105+
enabled: true
106+
command: pdepend
107+
excluded_dirs:
108+
- docs
109+
- examples
110+
- extras
111+
- test
112+
- vendor
113+
114+
# Runs Scrutinizer's PHP Analyzer Tool
115+
php_analyzer:
116+
enabled: true
117+
filter:
118+
excluded_paths:
119+
- 'docs/*'
120+
- 'examples/*'
121+
- 'extras/*'
122+
- 'test/*'
123+
- 'vendor/*'
124+
125+
# Security Advisory Checker
126+
sensiolabs_security_checker: true

.travis.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@ before_install:
99
before_script:
1010
- sudo service postfix stop
1111
- smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
12+
- mkdir -p build/logs
1213
- cd test
1314
- cp testbootstrap-dist.php testbootstrap.php
1415
- chmod +x fakesendmail.sh
1516
- sudo mkdir -p /var/qmail/bin
1617
- sudo cp fakesendmail.sh /var/qmail/bin/sendmail
1718
- sudo cp fakesendmail.sh /usr/sbin/sendmail
1819
- echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' | sudo tee "/home/travis/.phpenv/versions/`php -i|grep "PHP Version"|head -n 1|grep -o -P '\d+\.\d+\.\d+.*'`/etc/conf.d/sendmail.ini"
20+
- pwd
21+
- ls -al
1922
script:
20-
- phpunit phpmailerTest
23+
- phpunit --configuration ../travis.phpunit.xml.dist
24+
after_script:
25+
- wget https://scrutinizer-ci.com/ocular.phar
26+
- php ocular.phar code-coverage:upload --format=php-clover ../build/logs/clover.xml

PHPMailerAutoload.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ function PHPMailerAutoload($classname)
3838
spl_autoload_register('PHPMailerAutoload');
3939
}
4040
} else {
41-
//Fall back to traditional autoload for old PHP versions
41+
/**
42+
* Fall back to traditional autoload for old PHP versions
43+
* @param string $classname The name of the class to load
44+
*/
4245
function __autoload($classname)
4346
{
4447
PHPMailerAutoload($classname);

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# PHPMailer - A full-featured email creation and transfer class for PHP
22

33
Build status: [![Build Status](https://travis-ci.org/Synchro/PHPMailer.png)](https://travis-ci.org/Synchro/PHPMailer)
4+
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/Synchro/PHPMailer/badges/quality-score.png?s=320d104c5f7ae0bdb10abd98ea04e0cb107fe905)](https://scrutinizer-ci.com/g/Synchro/PHPMailer/)
5+
[![Code Coverage](https://scrutinizer-ci.com/g/Synchro/PHPMailer/badges/coverage.png?s=4a55049051633406197503e4f66cc8eeb224c9a4)](https://scrutinizer-ci.com/g/Synchro/PHPMailer/)
46

57
## Class Features
68

class.phpmailer.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,7 @@ class PHPMailer
396396
* The function that handles the result of the send email action.
397397
* It is called out by send() for each email sent.
398398
*
399-
* Value can be:
400-
* - 'function_name' for function names
401-
* - 'Class::Method' for static method calls
402-
* - array($object, 'Method') for calling methods on $object
403-
* See http://php.net/is_callable manual page for more details.
399+
* Value can be any php callable: http://www.php.net/is_callable
404400
*
405401
* Parameters:
406402
* bool $result result of the send action
@@ -410,7 +406,6 @@ class PHPMailer
410406
* string $subject the subject
411407
* string $body the email body
412408
* string $from email address of sender
413-
*
414409
* @type string
415410
*/
416411
public $action_function = '';

docs/generatedocs.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
22
# Regenerate PHPMailer documentation
33
# Run from within the docs folder
4-
rm -rf phpdocs/*
5-
phpdoc --directory .. --target ./phpdoc --ignore test/,examples/,extras/,test_script/ --sourcecode --force --title PHPMailer
4+
rm -rf phpdoc/*
5+
phpdoc --directory .. --target ./phpdoc --ignore test/,examples/,extras/,test_script/ --sourcecode --force --title PHPMailer --template="clean"

language/phpmailer.lang-no.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
$PHPMAILER_LANG['signing'] = 'Signeringsfeil: ';
2222
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() feilet.';
2323
$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfeil: ';
24-
$PHPMAILER_LANG['variable_set'] = 'Kan ikke sette eller resette variabelen: ';
24+
$PHPMAILER_LANG['variable_set'] = 'Kan ikke sette eller resette variabelen: ';

test/bootstrap.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
require_once 'vendor/autoload.php';
3+
spl_autoload_register(function ($class) {
4+
require_once strtr($class, '\\_', '//').'.php';
5+
});

0 commit comments

Comments
 (0)