Skip to content

Commit

Permalink
Add config for scrutinizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Dec 17, 2013
1 parent 38fc062 commit 379b700
Show file tree
Hide file tree
Showing 12 changed files with 200 additions and 290 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ docs/phpdoc/
test/message.txt
test/testbootstrap.php
.idea
build/
126 changes: 126 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
before_commands:
- "composer install --prefer-source"

tools:
# Code Coverage
external_code_coverage:
enabled: true
timeout: 300
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'


php_code_coverage:
enabled: false
test_command: phpunit
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'


# Code Sniffer
php_code_sniffer:
enabled: true
command: phpcs
config:
standard: PSR2
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'


# Copy/Paste Detector
php_cpd:
enabled: true
command: phpcpd
excluded_dirs:
- docs
- examples
- extras
- test
- vendor


# PHP CS Fixer (http://http://cs.sensiolabs.org/).
php_cs_fixer:
enabled: true
command: php-cs-fixer
config:
level: psr2
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'


# Analyzes the size and structure of a PHP project.
php_loc:
enabled: true
command: phploc
excluded_dirs:
- docs
- examples
- extras
- test
- vendor


# PHP Mess Detector (http://phpmd.org).
php_mess_detector:
enabled: true
command: phpmd
config:
rulesets:
- codesize
- unusedcode
- naming
- design
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'


# Analyzes the size and structure of a PHP project.
php_pdepend:
enabled: true
command: pdepend
excluded_dirs:
- docs
- examples
- extras
- test
- vendor

# Runs Scrutinizer's PHP Analyzer Tool
php_analyzer:
enabled: true
filter:
excluded_paths:
- 'docs/*'
- 'examples/*'
- 'extras/*'
- 'test/*'
- 'vendor/*'

# Security Advisory Checker
sensiolabs_security_checker: true
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ before_install:
before_script:
- sudo service postfix stop
- smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
- mkdir -p build/logs
- cd test
- cp testbootstrap-dist.php testbootstrap.php
- chmod +x fakesendmail.sh
- sudo mkdir -p /var/qmail/bin
- sudo cp fakesendmail.sh /var/qmail/bin/sendmail
- sudo cp fakesendmail.sh /usr/sbin/sendmail
- 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"
- pwd
- ls -al
script:
- phpunit phpmailerTest
- phpunit --configuration ../travis.phpunit.xml.dist
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover ../build/logs/clover.xml
5 changes: 4 additions & 1 deletion PHPMailerAutoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ function PHPMailerAutoload($classname)
spl_autoload_register('PHPMailerAutoload');
}
} else {
//Fall back to traditional autoload for old PHP versions
/**
* Fall back to traditional autoload for old PHP versions
* @param string $classname The name of the class to load
*/
function __autoload($classname)
{
PHPMailerAutoload($classname);
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# PHPMailer - A full-featured email creation and transfer class for PHP

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

## Class Features

Expand Down
7 changes: 1 addition & 6 deletions class.phpmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,7 @@ class PHPMailer
* The function that handles the result of the send email action.
* It is called out by send() for each email sent.
*
* Value can be:
* - 'function_name' for function names
* - 'Class::Method' for static method calls
* - array($object, 'Method') for calling methods on $object
* See http://php.net/is_callable manual page for more details.
* Value can be any php callable: http://www.php.net/is_callable
*
* Parameters:
* bool $result result of the send action
Expand All @@ -410,7 +406,6 @@ class PHPMailer
* string $subject the subject
* string $body the email body
* string $from email address of sender
*
* @type string
*/
public $action_function = '';
Expand Down
4 changes: 2 additions & 2 deletions docs/generatedocs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Regenerate PHPMailer documentation
# Run from within the docs folder
rm -rf phpdocs/*
phpdoc --directory .. --target ./phpdoc --ignore test/,examples/,extras/,test_script/ --sourcecode --force --title PHPMailer
rm -rf phpdoc/*
phpdoc --directory .. --target ./phpdoc --ignore test/,examples/,extras/,test_script/ --sourcecode --force --title PHPMailer --template="clean"
2 changes: 1 addition & 1 deletion language/phpmailer.lang-no.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
$PHPMAILER_LANG['signing'] = 'Signeringsfeil: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() feilet.';
$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfeil: ';
$PHPMAILER_LANG['variable_set'] = 'Kan ikke sette eller resette variabelen: ';
$PHPMAILER_LANG['variable_set'] = 'Kan ikke sette eller resette variabelen: ';
5 changes: 5 additions & 0 deletions test/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
require_once 'vendor/autoload.php';
spl_autoload_register(function ($class) {
require_once strtr($class, '\\_', '//').'.php';
});
Loading

0 comments on commit 379b700

Please sign in to comment.