Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4097273
phpcsutils-autoload.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
phpcsutils-autoload.php
View Options
<?php
/**
* PHPCSUtils, utility functions and classes for PHP_CodeSniffer sniff developers.
*
* Autoloader for the PHPCSUtils files.
* Also provides PHPCS cross-version class aliases.
*
* - If an external standard only supports PHPCS >= 3.1.0 and uses the PHPCS
* native unit test framework, this file does not need to be included.
*
* - If an external standard uses its own unit test setup, this file should
* be included from the unit test bootstrap file.
*
* - If an external standard uses the PHPCSUtils {@see PHPCSUtils\TestUtils\UtilityMethodTestCase}
* class to test their own utility methods, this file should be included from
* the unit test bootstrap file.
*
* @package PHPCSUtils
* @copyright 2019-2020 PHPCSUtils Contributors
* @license https://opensource.org/licenses/LGPL-3.0 LGPL3
* @link https://github.com/PHPCSStandards/PHPCSUtils
*
* @since 1.0.0
*/
if
(
defined
(
'PHPCSUTILS_AUTOLOAD'
)
===
false
)
{
/*
* Register an autoloader.
*
* External PHPCS standards which have their own unit test suite
* should include this file in their test runner bootstrap.
*/
spl_autoload_register
(
function
(
$fqClassName
)
{
// Only try & load our own classes.
if
(
stripos
(
$fqClassName
,
'PHPCSUtils'
)
!==
0
)
{
return
;
}
$file
=
realpath
(
__DIR__
)
.
DIRECTORY_SEPARATOR
.
strtr
(
$fqClassName
,
'
\\
'
,
DIRECTORY_SEPARATOR
)
.
'.php'
;
if
(
file_exists
(
$file
))
{
include_once
$file
;
}
});
define
(
'PHPCSUTILS_AUTOLOAD'
,
true
);
}
if
(
defined
(
'PHPCSUTILS_PHPUNIT_ALIASES_SET'
)
===
false
)
{
/*
* Alias the PHPUnit 4/5 TestCase class to its PHPUnit 6+ name.
*
* This allows both the PHPCSUtils native unit tests as well as the
* `UtilityMethodTestCase` class to work cross-version with PHPUnit
* below 6.x and above.
*
* {@internal The `class_exists` wrappers are needed to play nice with
* PHPUnit bootstrap files of external standards which may be creating
* cross-version compatibility in a similar manner.}}
*/
if
(
class_exists
(
'PHPUnit_Framework_TestCase'
)
===
true
&&
class_exists
(
'PHPUnit
\F
ramework
\T
estCase'
)
===
false
)
{
class_alias
(
'PHPUnit_Framework_TestCase'
,
'PHPUnit
\F
ramework
\T
estCase'
);
}
define
(
'PHPCSUTILS_PHPUNIT_ALIASES_SET'
,
true
);
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 14:47 (3 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6e/5c/61015ccbd9018a4b652829c18748
Default Alt Text
phpcsutils-autoload.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment