diff --git a/.gitattributes b/.gitattributes index 475f5f2..7526f7d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,7 @@ /tests export-ignore -/docs export-ignore /.gitattributes export-ignore /.gitignore export-ignore /.travis.yml export-ignore /.scrutinizer.yml export-ignore +/codecov.yml export-ignore +/phpunit.xml.dist export-ignore diff --git a/.travis.yml b/.travis.yml index 70fc8c0..bec7188 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,8 @@ matrix: env: DB=PGSQL PHPUNIT_TEST=1 - php: 7.1 env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1 + - php: 7.2 + env: DB=MYSQL PHPUNIT_TEST=1 before_script: - phpenv rehash @@ -25,7 +27,7 @@ before_script: script: - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi - if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi - - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs --standard=vendor/silverstripe/framework/phpcs.xml.dist src/ tests/ ; fi + - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/ *.php; fi after_success: - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi diff --git a/_config.php b/_config.php index bfdcd2b..294ccc0 100644 --- a/_config.php +++ b/_config.php @@ -1,23 +1,70 @@ + + CodeSniffer ruleset for SilverStripe coding conventions. + + + + + + diff --git a/src/Checks/ExternalURLCheck.php b/src/Checks/ExternalURLCheck.php index 3b15340..429cd46 100644 --- a/src/Checks/ExternalURLCheck.php +++ b/src/Checks/ExternalURLCheck.php @@ -10,9 +10,13 @@ use SilverStripe\EnvironmentCheck\EnvironmentCheck; * it can still fail if the URL in question is requested by the client, e.g. through an iframe. * * Requires curl to present, so ensure to check it before with the following: - * EnvironmentCheckSuite::register('check', 'HasFunctionCheck("curl_init")', "Does PHP have CURL support?"); - * - * @package environmentcheck + * + * EnvironmentCheckSuite::register( + * 'check', + * 'HasFunctionCheck("curl_init")', + * "Does PHP have CURL support?" + * ); + * */ class ExternalURLCheck implements EnvironmentCheck { diff --git a/src/Checks/FileAccessibilityAndValidationCheck.php b/src/Checks/FileAccessibilityAndValidationCheck.php index 99da854..e86558f 100644 --- a/src/Checks/FileAccessibilityAndValidationCheck.php +++ b/src/Checks/FileAccessibilityAndValidationCheck.php @@ -3,28 +3,40 @@ namespace SilverStripe\EnvironmentCheck\Checks; use SilverStripe\EnvironmentCheck\EnvironmentCheck; -use SilverStripe\ORM\Versioning\Versioned; +use SilverStripe\Versioned\Versioned; /** * Checks for the accessibility and file type validation of one or more files or folders. * * Examples: * // Checks /assets/calculator_files has .json files and all files are valid json files. - * EnvironmentCheckSuite::register('check', 'FileAccessibilityAndValidationCheck("' . BASE_PATH . '/assets/calculator_files/*.json", - * "jsonValidate", '.FileAccessibilityAndValidationCheck::CHECK_ALL.')', 'Check a json file exist and are all valid json files' + * EnvironmentCheckSuite::register( + * 'check', + * 'FileAccessibilityAndValidationCheck( + * "' . BASE_PATH . '/assets/calculator_files/*.json", + * "jsonValidate", + * '.FileAccessibilityAndValidationCheck::CHECK_ALL.' + * )', + * 'Check a json file exist and are all valid json files' * ); * * // Checks /assets/calculator_files/calculator.json exists and is valid json file. - * EnvironmentCheckSuite::register('check', 'FileAccessibilityAndValidationCheck("' . BASE_PATH . '/assets/calculator_files/calculator.json", - * "jsonValidate", '.FileAccessibilityAndValidationCheck::CHECK_SINGLE.')', 'Check a calculator.json exists and is valid json file' + * EnvironmentCheckSuite::register( + * 'check', + * 'FileAccessibilityAndValidationCheck( + * "' . BASE_PATH . '/assets/calculator_files/calculator.json", + * "jsonValidate", + * '.FileAccessibilityAndValidationCheck::CHECK_SINGLE.' + * )', + * 'Check a calculator.json exists and is valid json file' * ); * * // Check only existence - * EnvironmentCheckSuite::register('check', 'FileAccessibilityAndValidationCheck("' . BASE_PATH . '/assets/calculator_files/calculator.json")', - * 'Check a calculator.json exists only' + * EnvironmentCheckSuite::register( + * 'check', + * 'FileAccessibilityAndValidationCheck("' . BASE_PATH . '/assets/calculator_files/calculator.json")', + * 'Check a calculator.json exists only' * ); - * - * @package environmentcheck */ class FileAccessibilityAndValidationCheck implements EnvironmentCheck {