Skip to content
Snippets Groups Projects
Unverified Commit 29a25627 authored by Pieter Frenssen's avatar Pieter Frenssen Committed by GitHub
Browse files

Merge pull request #15 from pfrenssen/custom-autoloader

Add a custom autoloader for abstract base classes
parents fd3321a7 e6b29544
No related branches found
No related tags found
No related merge requests found
......@@ -33,4 +33,5 @@ before_script:
script:
- ./vendor/bin/phpunit
- ./vendor/bin/phpcs
- ./vendor/bin/phpcs -p
- ./vendor/bin/phpcs -p --standard=coder_sniffer/Drupal/Test/phpcs-ruleset.xml coder_sniffer/Drupal/Test/good/ --ignore=coder_sniffer/Drupal/Test/good/GoodUnitTest.php
......@@ -9,7 +9,6 @@
namespace Drupal\Sniffs\Semantics;
use Drupal\Sniffs\Semantics\FunctionCall;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
......
......@@ -9,7 +9,6 @@
namespace Drupal\Sniffs\Semantics;
use Drupal\Sniffs\Semantics\FunctionDefinition;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
......
<?xml version="1.0"?>
<!-- PHP_CodeSniffer standard for Drupal projects. -->
<!-- See http://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php -->
<!-- This file is used to test whether projects can include and override the Drupal coding standard in their projects. -->
<ruleset name="Drupal">
<description>Drupal coding standard</description>
<rule ref=".." />
</ruleset>
<?php
/**
* Includes classes which are not detected by PHP_CodeSniffer's autoloader.
*
* @category PHP
* @package PHP_CodeSniffer
* @link http://pear.php.net/package/PHP_CodeSniffer
* @see https://github.com/squizlabs/PHP_CodeSniffer/issues/1469
*/
// Abstract base classes are not discovered by the autoloader.
require_once 'Sniffs/Semantics/FunctionCall.php';
require_once 'Sniffs/Semantics/FunctionDefinition.php';
......@@ -7,6 +7,8 @@
<arg name="extensions" value="php,module,inc,install,test,profile,theme,css,info,txt,md,yml"/>
<autoload>autoload.php</autoload>
<rule ref="Internal.NoCodeFound">
<!-- Empty files are fine, might be used for testing. -->
<exclude-pattern>*</exclude-pattern>
......
......@@ -12,7 +12,7 @@
"require": {
"php": ">=5.4.0",
"ext-mbstring": "*",
"squizlabs/php_codesniffer": "^3.0.0",
"squizlabs/php_codesniffer": "^3.0.1",
"symfony/yaml": ">=2.0.0"
},
"autoload": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment