[PhpUnitBridge] Lint files with PHP 5.5
This commit is contained in:
parent
52a0233905
commit
0bc15ff759
|
@ -0,0 +1,28 @@
|
|||
name: PhpUnitBridge
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/Symfony/Bridge/PhpUnit/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/Symfony/Bridge/PhpUnit/**'
|
||||
|
||||
jobs:
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "5.5"
|
||||
|
||||
- name: Lint
|
||||
run: find ./src/Symfony/Bridge/PhpUnit -name '*.php' | grep -v -e /Tests/ -e ForV6 -e ForV7 -e ForV8 -e ForV9 -e ConstraintLogicTrait | parallel -j 4 php -l {}
|
|
@ -30,17 +30,23 @@ class ClassExistsMock
|
|||
|
||||
public static function class_exists($name, $autoload = true)
|
||||
{
|
||||
return (bool) (self::$classes[ltrim($name, '\\')] ?? \class_exists($name, $autoload));
|
||||
$name = ltrim($name, '\\');
|
||||
|
||||
return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \class_exists($name, $autoload);
|
||||
}
|
||||
|
||||
public static function interface_exists($name, $autoload = true)
|
||||
{
|
||||
return (bool) (self::$classes[ltrim($name, '\\')] ?? \interface_exists($name, $autoload));
|
||||
$name = ltrim($name, '\\');
|
||||
|
||||
return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \interface_exists($name, $autoload);
|
||||
}
|
||||
|
||||
public static function trait_exists($name, $autoload = true)
|
||||
{
|
||||
return (bool) (self::$classes[ltrim($name, '\\')] ?? \trait_exists($name, $autoload));
|
||||
$name = ltrim($name, '\\');
|
||||
|
||||
return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \trait_exists($name, $autoload);
|
||||
}
|
||||
|
||||
public static function register($class)
|
||||
|
|
Reference in New Issue