prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function is_string;
use func... | odName)
{
$this->methodName = $methodName;
}
public function methodName(): string
{
return $this->methodName;
}
public function toString(): string
{
return sprintf(
'is "%s"',
$t | t
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class MethodNameConstraint extends Constraint
{
private string $methodName;
public function __construct(string $meth | {
"filepath": "src/Framework/MockObject/Runtime/MethodNameConstraint.php",
"language": "php",
"file_size": 1243,
"cut_index": 518,
"middle_length": 229
} |
is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function sprintf;
/**
* @no-named-arguments Parameter nam... | plements Exception
{
public function __construct(string $className)
{
parent::__construct(
sprintf(
'Class "%s" is an enumeration and cannot be doubled',
$className,
),
);
| ionException extends \PHPUnit\Framework\Exception im | {
"filepath": "src/Framework/MockObject/Generator/Exception/ClassIsEnumerationException.php",
"language": "php",
"file_size": 871,
"cut_index": 559,
"middle_length": 52
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function array_dif... | thods
*/
public function __construct(array $methods)
{
parent::__construct(
sprintf(
'Cannot double using a method list that contains duplicates: "%s" (duplicate: "%s")',
implode(', ', $metho |
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class DuplicateMethodException extends \PHPUnit\Framework\Exception implements Exception
{
/**
* @param list<string> $me | {
"filepath": "src/Framework/MockObject/Generator/Exception/DuplicateMethodException.php",
"language": "php",
"file_size": 1139,
"cut_index": 518,
"middle_length": 229
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function sprintf;
/**
* @no-named-arguments P... | ception implements Exception
{
public function __construct(string $className)
{
parent::__construct(
sprintf(
'Cannot use "%s" as the name of a test double class because it is not a valid PHP class name',
| alidClassNameException extends \PHPUnit\Framework\Ex | {
"filepath": "src/Framework/MockObject/Generator/Exception/InvalidClassNameException.php",
"language": "php",
"file_size": 910,
"cut_index": 547,
"middle_length": 52
} |
ict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function sprintf;
/**
* @no... | PUnit\Framework\Exception implements Exception
{
public function __construct(string $interfaceName)
{
parent::__construct(
sprintf(
'Interface "%s" does not exist',
$interfaceName,
),
| */
final class UnknownInterfaceException extends \PH | {
"filepath": "src/Framework/MockObject/Generator/Exception/UnknownInterfaceException.php",
"language": "php",
"file_size": 856,
"cut_index": 529,
"middle_length": 52
} |
clare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function sprintf;
/... | \PHPUnit\Framework\Exception implements Exception
{
public function __construct(string $type)
{
parent::__construct(
sprintf(
'Class or interface "%s" does not exist',
$type,
),
| PHPUnit
*/
final class UnknownTypeException extends | {
"filepath": "src/Framework/MockObject/Generator/Exception/UnknownTypeException.php",
"language": "php",
"file_size": 842,
"cut_index": 520,
"middle_length": 52
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function array_any;
use function array_unique;
use function array_values;
use function in_array;
use function strtolower;
use Exception;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\MockObject\Rule\Invocat... | ray $matchers = [];
/**
* @var array<non-empty-string, Matcher>
*/
private array $matcherMap = [];
/**
* @var list<ConfigurableMethod>
*/
private readonly array $configurableMethods;
/**
* @var class-string
| e backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class InvocationHandler
{
/**
* @var list<Matcher>
*/
private ar | {
"filepath": "src/Framework/MockObject/Runtime/InvocationHandler.php",
"language": "php",
"file_size": 7736,
"cut_index": 716,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function sprintf;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount;
use PHPUnit\Framework\MockObject\Rule\AnyParameters;
use PHPUnit\Framework\MockObject\Rule\InvocationOr... | @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class Matcher
{
private readonly InvocationOrder $invocationRule;
/**
* @var class-string
*/
private readonly string $className;
/** | bject\Rule\ParametersRule;
use PHPUnit\Framework\MockObject\Stub\Stub;
use PHPUnit\Util\ThrowableToStringMapper;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* | {
"filepath": "src/Framework/MockObject/Runtime/Matcher.php",
"language": "php",
"file_size": 7843,
"cut_index": 716,
"middle_length": 229
} |
is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function sprintf;
/**
* @no-named-arguments Parameter nam... | ements Exception
{
public function __construct(string $className)
{
parent::__construct(
sprintf(
'Class "%s" is an anonymous class and cannot be doubled',
$className,
),
);
| sException extends \PHPUnit\Framework\Exception impl | {
"filepath": "src/Framework/MockObject/Generator/Exception/ClassIsAnonymousException.php",
"language": "php",
"file_size": 873,
"cut_index": 559,
"middle_length": 52
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function array_all;
use function array_map;
use function explode;
use function in_array;
use function interface_exists;
use function sprintf;
use function str_contains;
use function str_ends_with;
use function str_starts_with;... | ng $className
* @param non-empty-string $methodName
*
* @throws Exception
*/
public function generate(string $className, string $methodName, StubInternal $testStub, string $returnType): mixed
{
$intersection = false; | are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class ReturnValueGenerator
{
/**
* @param class-stri | {
"filepath": "src/Framework/MockObject/Runtime/ReturnValueGenerator.php",
"language": "php",
"file_size": 7962,
"cut_index": 716,
"middle_length": 229
} |
ict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function sprintf;
/**
* @no... | HPUnit\Framework\Exception implements Exception
{
public function __construct(string $method)
{
parent::__construct(
sprintf(
'Cannot double method with invalid name "%s"',
$method,
), | */
final class InvalidMethodNameException extends \P | {
"filepath": "src/Framework/MockObject/Generator/Exception/InvalidMethodNameException.php",
"language": "php",
"file_size": 857,
"cut_index": 529,
"middle_length": 52
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function array_flip;
use function array_key_exists;
use function array_map;
use function array_merge;
use function array_pop;
use function assert;
use function count;
use function is_string;
use function range;
use function st... | nce;
use PHPUnit\Framework\MockObject\Stub\ReturnSelf;
use PHPUnit\Framework\MockObject\Stub\ReturnStub;
use PHPUnit\Framework\MockObject\Stub\ReturnValueMap;
use PHPUnit\Framework\MockObject\Stub\Stub;
use Throwable;
/**
* @no-named-arguments Parameter | tub\ConsecutiveCalls;
use PHPUnit\Framework\MockObject\Stub\Exception;
use PHPUnit\Framework\MockObject\Stub\ReturnArgument;
use PHPUnit\Framework\MockObject\Stub\ReturnCallback;
use PHPUnit\Framework\MockObject\Stub\ReturnRefere | {
"filepath": "src/Framework/MockObject/Runtime/AbstractInvocationImplementation.php",
"language": "php",
"file_size": 8821,
"cut_index": 716,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Framework\Exception;
/**
* @no-named-arguments Parameter names are not co... | ethodParametersAlreadyConfiguredForAnotherMatcherException
*
* @return $this
*/
public function with(mixed ...$arguments): InvocationMocker
{
$this->ensureParametersCanBeConfigured();
$this->ensureNoOtherMatcherHasPar | on extends AbstractInvocationImplementation implements InvocationMocker
{
/**
* @throws Exception
* @throws MethodNameNotConfiguredException
* @throws MethodParametersAlreadyConfiguredException
* @throws M | {
"filepath": "src/Framework/MockObject/Runtime/InvocationMockerImplementation.php",
"language": "php",
"file_size": 4709,
"cut_index": 614,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Stub;
use function array_shift;
use function count;
... | e array $stack;
private int $numberOfConfiguredReturnValues;
/**
* @param array<mixed> $stack
*/
public function __construct(array $stack)
{
$this->stack = $stack;
$this->numberOfConfigure | compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class ConsecutiveCalls implements Stub
{
/**
* @var array<mixed>
*/
privat | {
"filepath": "src/Framework/MockObject/Runtime/Stub/ConsecutiveCalls.php",
"language": "php",
"file_size": 1574,
"cut_index": 537,
"middle_length": 229
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function sprintf;
/**
* @no-named-arguments P... | ception implements Exception
{
/**
* @param class-string|trait-string $name
*/
public function __construct(string $name)
{
parent::__construct(
sprintf(
'The name "%s" is already in use',
| eAlreadyInUseException extends \PHPUnit\Framework\Ex | {
"filepath": "src/Framework/MockObject/Generator/Exception/NameAlreadyInUseException.php",
"language": "php",
"file_size": 902,
"cut_index": 547,
"middle_length": 52
} |
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use SebastianBergmann\Template\Template;
/**
* @no-named-arguments Parameter names a... | te static array $templates = [];
private function loadTemplate(string $template): Template
{
$filename = __DIR__ . '/templates/' . $template;
if (!isset(self::$templates[$filename])) {
self::$templates[$filename] = new | * @var array<string,Template>
*/
priva | {
"filepath": "src/Framework/MockObject/Generator/TemplateLoader.php",
"language": "php",
"file_size": 975,
"cut_index": 582,
"middle_length": 52
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Framework\MockObject\Invocation;
/**
* @no... | ub
{
private int $argumentIndex;
public function __construct(int $argumentIndex)
{
$this->argumentIndex = $argumentIndex;
}
public function invoke(Invocation $invocation): mixed
{
return $invocation->parameters()[$ | */
final readonly class ReturnArgument implements St | {
"filepath": "src/Framework/MockObject/Runtime/Stub/ReturnArgument.php",
"language": "php",
"file_size": 893,
"cut_index": 547,
"middle_length": 52
} |
clare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Framework\MockObj... | rence implements Stub
{
private mixed $reference;
public function __construct(mixed &$reference)
{
$this->reference = &$reference;
}
public function invoke(Invocation $invocation): mixed
{
return $this->reference;
| ility promise for PHPUnit
*/
final class ReturnRefe | {
"filepath": "src/Framework/MockObject/Runtime/Stub/ReturnReference.php",
"language": "php",
"file_size": 836,
"cut_index": 520,
"middle_length": 52
} |
are(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Framework\MockObjec... | r PHPUnit
*/
final readonly class ReturnStub implements Stub
{
private mixed $value;
public function __construct(mixed $value)
{
$this->value = $value;
}
public function invoke(Invocation $invocation): mixed
{
ret | ity promise fo | {
"filepath": "src/Framework/MockObject/Runtime/Stub/ReturnStub.php",
"language": "php",
"file_size": 818,
"cut_index": 522,
"middle_length": 14
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
interface InvocationMocker extends InvocationStubbe... | guments): self;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @return $this
*/
public function withAnyParameters(): self;
/**
* @no-named-arguments Par | ents): self;
/**
* @return $this
*/
public function withParameterSetsInAnyOrder(mixed ...$arguments): self;
/**
* @return $this
*/
public function withParameterSetsInPartialOrder(mixed ...$ar | {
"filepath": "src/Framework/MockObject/Runtime/Interface/InvocationMocker.php",
"language": "php",
"file_size": 1630,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use function count;
use PHPUnit\F... | invocations = [];
public function numberOfInvocations(): int
{
return count($this->invocations);
}
public function hasBeenInvoked(): bool
{
return count($this->invocations) > 0;
}
final public function invoked | PUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
abstract class InvocationOrder implements SelfDescribing
{
/**
* @var list<BaseInvocation>
*/
private array $ | {
"filepath": "src/Framework/MockObject/Runtime/Rule/InvocationOrder.php",
"language": "php",
"file_size": 1341,
"cut_index": 524,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use function sprintf;
use PHPUnit\Framework\Ex... | __construct(int $requiredInvocations)
{
$this->requiredInvocations = $requiredInvocations;
}
public function toString(): string
{
return sprintf(
'invoked at least %d time%s',
$this->requiredInvocati | HPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class InvokedAtLeastCount extends InvocationOrder
{
private readonly int $requiredInvocations;
public function | {
"filepath": "src/Framework/MockObject/Runtime/Rule/InvokedAtLeastCount.php",
"language": "php",
"file_size": 1999,
"cut_index": 537,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function array_map;
use function implode;
use function sprintf;
use function str_starts_with;
use function strtolower;
use f... | /**
* @var non-empty-string
*/
private string $methodName;
/**
* @var array<mixed>
*/
private array $parameters;
private string $returnType;
private bool $isReturnTypeNullable;
private MockObjectInternal|Stub | *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class Invocation implements SelfDescribing
{
/**
* @var class-string
*/
private string $className;
| {
"filepath": "src/Framework/MockObject/Runtime/Invocation.php",
"language": "php",
"file_size": 3482,
"cut_index": 614,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Framework\Mock... | is not covered by the backward compatibility promise for PHPUnit
*/
final class ReturnSelf implements Stub
{
/**
* @throws RuntimeException
*/
public function invoke(Invocation $invocation): object
{
return $invocation->obje | nal This class | {
"filepath": "src/Framework/MockObject/Runtime/Stub/ReturnSelf.php",
"language": "php",
"file_size": 801,
"cut_index": 517,
"middle_length": 14
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use PHPUnit\Framework\Constraint\Constraint;
use PHPUnit\Framework\MockObject\Runtime\PropertyHook;
use PHPUnit\Framework\MockOb... | e not covered by the backward compatibility promise for PHPUnit
*
* @return $this
*/
public function will(Stub $stub): self;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PH | @param Constraint|non-empty-string|PropertyHook $constraint
*
* @return $this
*/
public function method(Constraint|PropertyHook|string $constraint): self;
/**
* @no-named-arguments Parameter names ar | {
"filepath": "src/Framework/MockObject/Runtime/Interface/InvocationStubber.php",
"language": "php",
"file_size": 3112,
"cut_index": 614,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use Exception;
use PHPUnit\Framework\Expectati... | ameters
*
* @throws \PHPUnit\Framework\Exception
*/
public function __construct(array $parameters, private int $index, private bool $strict)
{
$this->parameters = new Parameters($parameters);
}
/**
* @throws Exc | *
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class IndexedParameters implements ParametersRule
{
private Parameters $parameters;
/**
* @param list<mixed> $par | {
"filepath": "src/Framework/MockObject/Runtime/Rule/IndexedParameters.php",
"language": "php",
"file_size": 1704,
"cut_index": 537,
"middle_length": 229
} |
n <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Stub;
use function call_user_func_array;
use PHPUnit\Framework\MockObject\Invocation;
/**
* @no-named-arguments Paramet... |
*/
private $callback;
public function __construct(callable $callback)
{
$this->callback = $callback;
}
public function invoke(Invocation $invocation): mixed
{
return call_user_func_array($this->callback, $inv | lback implements Stub
{
/**
* @var callable | {
"filepath": "src/Framework/MockObject/Runtime/Stub/ReturnCallback.php",
"language": "php",
"file_size": 946,
"cut_index": 606,
"middle_length": 52
} |
ict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use PHPUnit\Framework\MockObject\Invoc... | nyInvokedCount extends InvocationOrder
{
public function toString(): string
{
return 'invoked zero or more times';
}
public function verify(): void
{
}
public function matches(BaseInvocation $invocation): bool
{
| compatibility promise for PHPUnit
*/
final class A | {
"filepath": "src/Framework/MockObject/Runtime/Rule/AnyInvokedCount.php",
"language": "php",
"file_size": 864,
"cut_index": 529,
"middle_length": 52
} |
is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function sprintf;
/**
* @no-named-arguments Parameter nam... | ts Exception
{
public function __construct(string $className)
{
parent::__construct(
sprintf(
'Class "%s" is declared "final" and cannot be doubled',
$className,
),
);
}
}
| eption extends \PHPUnit\Framework\Exception implemen | {
"filepath": "src/Framework/MockObject/Generator/Exception/ClassIsFinalException.php",
"language": "php",
"file_size": 867,
"cut_index": 559,
"middle_length": 52
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use function sprintf;
use PHPUnit\Framework\ExpectationFailedException;
... | cations)
{
$this->allowedInvocations = $allowedInvocations;
}
public function toString(): string
{
if ($this->allowedInvocations === 1) {
return 'invoked at most once';
}
return sprintf(
| s class is not covered by the backward compatibility promise for PHPUnit
*/
final class InvokedAtMostCount extends InvocationOrder
{
private readonly int $allowedInvocations;
public function __construct(int $allowedInvo | {
"filepath": "src/Framework/MockObject/Runtime/Rule/InvokedAtMostCount.php",
"language": "php",
"file_size": 2031,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use function is_string;
use PHPUnit\Framework\... | promise for PHPUnit
*/
final readonly class MethodName
{
private Constraint $constraint;
/**
* @throws InvalidArgumentException
*/
public function __construct(Constraint|string $constraint)
{
if (is_string($constraint)) | nit\Framework\MockObject\MethodNameConstraint;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility | {
"filepath": "src/Framework/MockObject/Runtime/Rule/MethodName.php",
"language": "php",
"file_size": 1984,
"cut_index": 537,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use function assert;
use function count;
use function sprintf;
use Exception;
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\Constraint\Constraint;
use PHPUnit\Framework\Constraint\IsAnything;
use PHPUnit\Fr... | l class Parameters implements ParametersRule
{
/**
* @var list<Constraint>
*/
private array $parameters = [];
private ?BaseInvocation $invocation = null;
private null|bool|ExpectationFailedException $parameterVerificatio | ReflectionMethod;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
fina | {
"filepath": "src/Framework/MockObject/Runtime/Rule/Parameters.php",
"language": "php",
"file_size": 5933,
"cut_index": 716,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use function array_shift;
use function array_values;
use function count;
use function implode;
use function is_array;
use f... | $unapplied = [];
/**
* @var list<IndexedParameters>
*/
private array $applied = [];
private int $numberOfConfiguredParameterSets;
/**
* @param list<mixed> $stack
*/
public function __construct(array $stack)
{
| Exception;
final class UnorderedParameterSets implements ParametersRule
{
/**
* @var list<IndexedParameters>
*/
private array $stack = [];
/**
* @var list<IndexedParameters>
*/
private array | {
"filepath": "src/Framework/MockObject/Runtime/Rule/UnorderedParameterSets.php",
"language": "php",
"file_size": 3877,
"cut_index": 614,
"middle_length": 229
} |
?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use PHPUnit\Framework\Const... | nHandler;
public function method(Constraint|PropertyHook|string $constraint): InvocationStubber
{
return $this
->__phpunit_getInvocationHandler()
->expects(new AnyInvokedCount)
->method($constraint)
| he backward compatibility promise for PHPUnit
*
* @internal This trait is not covered by the backward compatibility promise for PHPUnit
*/
trait Method
{
abstract public function __phpunit_getInvocationHandler(): Invocatio | {
"filepath": "src/Framework/MockObject/Runtime/Api/Method.php",
"language": "php",
"file_size": 1055,
"cut_index": 513,
"middle_length": 229
} |
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
/**
* @no-named-arguments... | ic function __phpunit_getInvocationHandler(): InvocationHandler
{
return $this->__phpunit_state()->invocationHandler();
}
public function __phpunit_unsetInvocationMocker(): void
{
$this->__phpunit_state()->unsetInvocationHa |
{
private readonly TestDoubleState $__phpunit_state;
public function __phpunit_state(): TestDoubleState
{
return $this->__phpunit_state ?? new TestDoubleState([], static::class, true, false);
}
publ | {
"filepath": "src/Framework/MockObject/Runtime/Api/StubApi.php",
"language": "php",
"file_size": 1014,
"cut_index": 512,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Runtime;
use function sprintf;
/**
* ... | *
* @internal This method is not covered by the backward compatibility promise for PHPUnit
*/
public function asString(): string
{
return sprintf(
'$%s::get',
$this->propertyName(),
);
}
}
| -empty-string
| {
"filepath": "src/Framework/MockObject/Runtime/PropertyHook/PropertyGetHook.php",
"language": "php",
"file_size": 794,
"cut_index": 524,
"middle_length": 14
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Runtime;
use function sprintf;
/**
* ... | *
* @internal This method is not covered by the backward compatibility promise for PHPUnit
*/
public function asString(): string
{
return sprintf(
'$%s::set',
$this->propertyName(),
);
}
}
| -empty-string
| {
"filepath": "src/Framework/MockObject/Runtime/PropertyHook/PropertySetHook.php",
"language": "php",
"file_size": 794,
"cut_index": 524,
"middle_length": 14
} |
tring LEFT_MARGIN = ' ';
private int $lengthOfLongestOptionName = 0;
private readonly int $columnsAvailableForDescription;
private bool $hasColor;
public function __construct(?int $width = null, ?bool $withColor = null)
{
if ($width === null) {
$width = (new Console)->get... | {
$this->lengthOfLongestOptionName = max($this->lengthOfLongestOptionName, strlen($option['arg']));
}
}
}
$this->columnsAvailableForDescription = $width - $this->lengthOfLongestOptionName - | }
$maxLength = (int) ($width / 2) - 4;
foreach ($this->elements() as $options) {
foreach ($options as $option) {
if (isset($option['arg']) && strlen($option['arg']) <= $maxLength) | {
"filepath": "src/TextUI/Help.php",
"language": "php",
"file_size": 23025,
"cut_index": 1331,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Stub;
use function array_key_exists;
use function array_pop;
use function coun... | final readonly class ReturnValueMap implements Stub
{
/**
* @var array<mixed>
*/
private array $valueMap;
private bool $strict;
/**
* @param array<mixed> $valueMap
*/
public function __construct(array $valueMap, boo | PHPUnit\Util\Exporter;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
| {
"filepath": "src/Framework/MockObject/Runtime/Stub/ReturnValueMap.php",
"language": "php",
"file_size": 2829,
"cut_index": 563,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use function array_shift;
use function count;
use function is_array;
use function sprintf;
use PHPUnit\Framework\Expectatio... | /**
* @var list<IndexedParameters|Parameters>
*/
private array $stack = [];
/**
* @var list<IndexedParameters|Parameters>
*/
private array $applied = [];
private int $numberOfConfiguredParameterSets;
/**
* | names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class OrderedParameterSets implements ParametersRule
{
| {
"filepath": "src/Framework/MockObject/Runtime/Rule/OrderedParameterSets.php",
"language": "php",
"file_size": 3050,
"cut_index": 614,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use function array_key_exists;
use function array_values;
use function count;
use function is_array;
use PHPUnit\Framework\... | s ParametersRule
{
/**
* @var list<IndexedParameters>
*/
private array $stack = [];
/**
* @var list<IndexedParameters>
*/
private array $applied = [];
private ?OrderedParameterSets $ordered = | Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class PartiallyOrderedParameterSets implement | {
"filepath": "src/Framework/MockObject/Runtime/Rule/PartiallyOrderedParameterSets.php",
"language": "php",
"file_size": 4274,
"cut_index": 614,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
/**
* @no-named-arguments Parameter names are not covered by the backward co... | ockObject;
private ?InvocationHandler $invocationHandler = null;
/**
* @param list<ConfigurableMethod> $configurableMethods
* @param class-string $className
*/
public function __construct(array $configurableMethods, | bleMethod>
*/
private readonly array $configurableMethods;
/**
* @var class-string
*/
private readonly string $className;
private readonly bool $generateReturnValues;
private readonly bool $isM | {
"filepath": "src/Framework/MockObject/Runtime/Api/TestDoubleState.php",
"language": "php",
"file_size": 2376,
"cut_index": 563,
"middle_length": 229
} |
eGenerator;
use PHPUnit\Runner\Baseline\Reader;
use PHPUnit\Runner\Baseline\Writer;
use PHPUnit\Runner\CodeCoverage;
use PHPUnit\Runner\CodeCoverageInitializationStatus;
use PHPUnit\Runner\DeprecationCollector\Facade as DeprecationCollector;
use PHPUnit\Runner\DirectoryDoesNotExistException;
use PHPUnit\Runner\ErrorHan... | nner\ResultCache\ResultCache;
use PHPUnit\Runner\ResultCache\ResultCacheHandler;
use PHPUnit\Runner\TestSuiteSorter;
use PHPUnit\Runner\Version;
use PHPUnit\TestRunner\IssueFilter;
use PHPUnit\TestRunner\TestResult\Facade as TestResultFacade;
use PHPUnit\T | lectionHandler;
use PHPUnit\Runner\IssueTriggerResolver\Resolver;
use PHPUnit\Runner\Phpt\TestCase as PhptTestCase;
use PHPUnit\Runner\ResultCache\DefaultResultCache;
use PHPUnit\Runner\ResultCache\NullResultCache;
use PHPUnit\Ru | {
"filepath": "src/TextUI/Application.php",
"language": "php",
"file_size": 35307,
"cut_index": 2151,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
use PHPU... | bility promise for PHPUnit
*
* @immutable
*/
final readonly class Php
{
private File $target;
public function __construct(File $target)
{
$this->target = $target;
}
public function target(): File
{
return $this- | ckward compati | {
"filepath": "src/TextUI/Configuration/Xml/CodeCoverage/Report/Php.php",
"language": "php",
"file_size": 804,
"cut_index": 517,
"middle_length": 14
} |
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use DOMDocument;
use DOMElement;
/**
* @no-named-arguments Parameter n... | e implements Migration
{
public function migrate(DOMDocument $document): void
{
$root = $document->documentElement;
assert($root instanceof DOMElement);
if ($root->hasAttribute('beStrictAboutResourceUsageDuringSmallTests') | veBeStrictAboutResourceUsageDuringSmallTestsAttribut | {
"filepath": "src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutResourceUsageDuringSmallTestsAttribute.php",
"language": "php",
"file_size": 994,
"cut_index": 582,
"middle_length": 52
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use SebastianBergmann\FileFilter... | return self::$instance;
}
self::$instance = new self(
(new FileFilterMapper)->map(
Registry::get()->source(),
),
);
return self::$instance;
}
public function __construct | romise for PHPUnit
*/
final class SourceFilter
{
private static ?self $instance = null;
private readonly Filter $filter;
public static function instance(): self
{
if (self::$instance !== null) {
| {
"filepath": "src/TextUI/Configuration/SourceFilter.php",
"language": "php",
"file_size": 1228,
"cut_index": 518,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Runtime;
/**
* @no-named-arguments Par... | n-empty-string $propertyName
*/
public static function set(string $propertyName): PropertySetHook
{
return new PropertySetHook($propertyName);
}
/**
* @param non-empty-string $propertyName
*/
protected function _ | rtyName;
/**
* @param non-empty-string $propertyName
*/
public static function get(string $propertyName): PropertyGetHook
{
return new PropertyGetHook($propertyName);
}
/**
* @param no | {
"filepath": "src/Framework/MockObject/Runtime/PropertyHook/PropertyHook.php",
"language": "php",
"file_size": 1440,
"cut_index": 524,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI;
use const FILE_IGNORE_NEW_LINES;
use const FILE_SKIP_EMPTY_LINES;
use function array_map;
use function file;
use PHPUnit\Event;
use PHPUnit\Fr... | /**
* @throws Event\RuntimeException
* @throws FilterNotConfiguredException
* @throws RuntimeException
*/
public function process(Configuration $configuration, TestSuite $suite): void
{
$factory = new Factory;
| Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class TestSuiteFilterProcessor
{
| {
"filepath": "src/TextUI/TestSuiteFilterProcessor.php",
"language": "php",
"file_size": 4218,
"cut_index": 614,
"middle_length": 229
} |
pes=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI;
use function sprintf;
use RuntimeException;
/**
* @no-named-a... | on implements Exception
{
public function __construct(string $socket)
{
parent::__construct(
sprintf(
'"%s" does not match "socket://hostname:port" format',
$socket,
),
);
| class InvalidSocketException extends RuntimeExcepti | {
"filepath": "src/TextUI/Exception/InvalidSocketException.php",
"language": "php",
"file_size": 847,
"cut_index": 535,
"middle_length": 52
} |
are(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI;
use function sprintf;
use RuntimeException;
/**
... | class TestFileNotFoundException extends RuntimeException implements Exception
{
public function __construct(string $path)
{
parent::__construct(
sprintf(
'Test file "%s" not found',
$path,
| nit
*/
final | {
"filepath": "src/TextUI/Exception/TestFileNotFoundException.php",
"language": "php",
"file_size": 819,
"cut_index": 522,
"middle_length": 14
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use PHPUnit\TextUI\CliArguments\Builder as CliConfi... | ise for PHPUnit
*
* @codeCoverageIgnore
*/
final readonly class Builder
{
/**
* @param list<string> $argv
*
* @throws ConfigurationCannotBeBuiltException
*/
public function build(array $argv): Configuration
{
try | Configuration;
use PHPUnit\TextUI\XmlConfiguration\Exception as XmlConfigurationException;
use PHPUnit\TextUI\XmlConfiguration\Loader;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility prom | {
"filepath": "src/TextUI/Configuration/Builder.php",
"language": "php",
"file_size": 1780,
"cut_index": 537,
"middle_length": 229
} |
* @var non-empty-string
*/
private string $coverageHtmlColorDanger;
/**
* @var non-empty-string
*/
private string $coverageHtmlColorDangerDark;
/**
* @var non-empty-string
*/
private string $coverageHtmlColorDangerBar;
/**
* @var non-empty-string
*/
priv... | ;
/**
* @var ?non-empty-string
*/
private ?string $coveragePhp;
/**
* @var ?non-empty-string
*/
private ?string $coverageText;
private bool $coverageTextShowUncoveredFiles;
private bool $coverageTextShowOnlySum | ivate string $coverageHtmlColorBreadcrumbsDark;
/**
* @var ?non-empty-string
*/
private ?string $coverageHtmlCustomCssFile;
/**
* @var ?non-empty-string
*/
private ?string $coverageOpenClover | {
"filepath": "src/TextUI/Configuration/Configuration.php",
"language": "php",
"file_size": 70496,
"cut_index": 3790,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use function realpath;
use SebastianBergmann\FileFi... | d(
$this->directories($source->includeDirectories()),
$this->files($source->includeFiles()),
$this->directories($source->excludeDirectories()),
$this->files($source->excludeFiles()),
);
}
/** | nit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class FileFilterMapper
{
public function map(Source $source): FileFilter
{
return (new FilterBuilder)->buil | {
"filepath": "src/TextUI/Configuration/FileFilterMapper.php",
"language": "php",
"file_size": 1914,
"cut_index": 537,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use const PATH_SEPARATOR;
use function constant;
use function define;
use function defined;
use function getenv;
use function implode;
use function ini_get;
use function ini_set;
use function is_array;
use function is_scalar;
use ... | onfiguration): void
{
$this->handleIncludePaths($configuration->includePaths());
$this->handleIniSettings($configuration->iniSettings());
$this->handleConstants($configuration->constants());
$this->handleGlobalVariables( | are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class PhpHandler
{
public function handle(Php $c | {
"filepath": "src/TextUI/Configuration/PhpHandler.php",
"language": "php",
"file_size": 5212,
"cut_index": 716,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
/**
* @no-named-arguments Parameter n... | unction __clone(): void
{
$this->__phpunit_state = clone $this->__phpunit_state;
$this->__phpunit_state()->cloneInvocationHandler();
parent::__clone();
}
abstract public function __phpunit_state(): TestDoubleState;
}
| {
public f | {
"filepath": "src/Framework/MockObject/Runtime/Api/ProxiedCloneMethod.php",
"language": "php",
"file_size": 794,
"cut_index": 524,
"middle_length": 14
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use function sprintf;
use PHPUnit\Framework\ExpectationFailedException;
... | $this->expectedCount = $expectedCount;
}
public function isNever(): bool
{
return $this->expectedCount === 0;
}
public function toString(): string
{
if ($this->expectedCount === 1) {
return 'invo | s class is not covered by the backward compatibility promise for PHPUnit
*/
final class InvokedCount extends InvocationOrder
{
private readonly int $expectedCount;
public function __construct(int $expectedCount)
{
| {
"filepath": "src/Framework/MockObject/Runtime/Rule/InvokedCount.php",
"language": "php",
"file_size": 2870,
"cut_index": 563,
"middle_length": 229
} |
p declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI;
use function sprintf;
use RuntimeException;
... | tion extends RuntimeException implements Exception
{
public function __construct(string $path)
{
parent::__construct(
sprintf(
'Test directory "%s" not found',
$path,
),
);
| r PHPUnit
*/
final class TestDirectoryNotFoundExcep | {
"filepath": "src/TextUI/Exception/TestDirectoryNotFoundException.php",
"language": "php",
"file_size": 829,
"cut_index": 516,
"middle_length": 52
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use function array_keys;
use function assert;
use S... | try
{
private static ?self $instance = null;
private ?Filter $filter = null;
private bool $configured = false;
public static function instance(): self
{
if (self::$instance === null) {
self::$instance = | named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class CodeCoverageFilterRegis | {
"filepath": "src/TextUI/Configuration/CodeCoverageFilterRegistry.php",
"language": "php",
"file_size": 1938,
"cut_index": 537,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use PHPUnit\Framework\MockObject\Rule\InvocationOrd... | ParametersRule(): bool
{
return $this->__phpunit_getInvocationHandler()->hasParametersRule();
}
public function __phpunit_verify(bool $unsetInvocationMocker = true): void
{
$this->__phpunit_getInvocationHandler()->verify(); | e for PHPUnit
*/
trait MockObjectApi
{
public function __phpunit_hasInvocationCountRule(): bool
{
return $this->__phpunit_getInvocationHandler()->hasInvocationCountRule();
}
public function __phpunit_has | {
"filepath": "src/Framework/MockObject/Runtime/Api/MockObjectApi.php",
"language": "php",
"file_size": 1514,
"cut_index": 537,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use function assert;
use function file_get_contents;
use function file_put_contents;
use function serialize;
use function unseri... | * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class Registry
{
private static ?Configuration | n\Configuration as XmlConfiguration;
use PHPUnit\Util\VersionComparisonOperator;
/**
* CLI options and XML configuration are static within a single PHPUnit process.
* It is therefore okay to use a Singleton registry here.
*
| {
"filepath": "src/TextUI/Configuration/Registry.php",
"language": "php",
"file_size": 3700,
"cut_index": 614,
"middle_length": 229
} |
ict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI;
use function sprintf;
use RuntimeException;
/**
* @no-n... | meException implements Exception
{
public function __construct(string $hostname, int $port)
{
parent::__construct(
sprintf(
'Cannot open socket %s:%d',
$hostname,
$port,
|
final class CannotOpenSocketException extends Runti | {
"filepath": "src/TextUI/Exception/CannotOpenSocketException.php",
"language": "php",
"file_size": 861,
"cut_index": 529,
"middle_length": 52
} |
merge(CliConfiguration $cliConfiguration, XmlConfiguration $xmlConfiguration): Configuration
{
$testFilesFile = null;
if ($cliConfiguration->hasTestFilesFile()) {
$testFilesFile = $cliConfiguration->testFilesFile();
}
$configurationFile = null;
if ($xmlConfigur... | ation->phpunit()->bootstrap();
}
if ($cliConfiguration->hasCacheResult()) {
$cacheResult = $cliConfiguration->cacheResult();
} else {
$cacheResult = $xmlConfiguration->phpunit()->cacheResult();
}
| $bootstrap = null;
if ($cliConfiguration->hasBootstrap()) {
$bootstrap = $cliConfiguration->bootstrap();
} elseif ($xmlConfiguration->phpunit()->hasBootstrap()) {
$bootstrap = $xmlConfigur | {
"filepath": "src/TextUI/Configuration/Merger.php",
"language": "php",
"file_size": 59526,
"cut_index": 2151,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\TextUI;
use PHPUnit\TestRunner\TestResult\TestResult;
use PHPUnit\TextUI\Configuration\Configuration;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covere... | nPhpunitNotice = false;
$failOnPhpunitWarning = false;
$failOnEmptyTestSuite = false;
$failOnIncomplete = false;
$failOnNotice = false;
$failOnRisky = false;
$fai | rivate const int EXCEPTION_EXIT = 2;
public function calculate(Configuration $configuration, TestResult $result): int
{
$failOnDeprecation = false;
$failOnPhpunitDeprecation = false;
$failO | {
"filepath": "src/TextUI/ShellExitCodeCalculator.php",
"language": "php",
"file_size": 5339,
"cut_index": 716,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use const PHP_EOL;
use function in_array;
use function is_readable;
use funct... | ic function handle(Configuration $configuration): void
{
if (!$configuration->hasBootstrap()) {
return;
}
$this->load($configuration->bootstrap());
foreach ($configuration->bootstrapForTestSuite() as $testS | al This class is not covered by the backward compatibility promise for PHPUnit
*/
final class BootstrapLoader
{
/**
* @throws BootstrapScriptDoesNotExistException
* @throws BootstrapScriptException
*/
publ | {
"filepath": "src/TextUI/Configuration/BootstrapLoader.php",
"language": "php",
"file_size": 2635,
"cut_index": 563,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use const DIRECTORY_SEPARATOR;
use function array_values;
use function file_get_contents;
use function file_put_contents;
use function is_array;
use function is_string;
use function preg_match;
use function realpath;
use function ... | Source, array<non-empty-string, true>>
*/
private static ?SplObjectStorage $files = null;
public static function saveTo(string $path, Source $source): bool
{
$map = (new self)->map($source);
return file_put_contents($path | s are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class SourceMapper
{
/**
* @var ?SplObjectStorage< | {
"filepath": "src/TextUI/Configuration/SourceMapper.php",
"language": "php",
"file_size": 6687,
"cut_index": 716,
"middle_length": 229
} |
ict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use function sprintf;
use RuntimeException;... | stException extends RuntimeException implements Exception
{
public function __construct(string $filename)
{
parent::__construct(
sprintf(
'Cannot open bootstrap script "%s"',
$filename,
| or PHPUnit
*/
final class BootstrapScriptDoesNotExi | {
"filepath": "src/TextUI/Configuration/Exception/BootstrapScriptDoesNotExistException.php",
"language": "php",
"file_size": 861,
"cut_index": 529,
"middle_length": 52
} |
that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use PHPUnit\Runner\TestSuiteSorter;
use PHPUnit\TextUI\Configuration\ConstantCollection;
use PHPUnit\TextUI\Configuration\DirectoryCollection;
use PHPUnit\TextUI\Configuration\ExtensionBootstrapCollection;
use PHPUnit\TextUI\Co... | CodeCoverage\CodeCoverage;
use PHPUnit\TextUI\XmlConfiguration\Logging\Logging;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatib | ction;
use PHPUnit\TextUI\Configuration\Php;
use PHPUnit\TextUI\Configuration\Source;
use PHPUnit\TextUI\Configuration\TestSuiteCollection;
use PHPUnit\TextUI\Configuration\VariableCollection;
use PHPUnit\TextUI\XmlConfiguration\ | {
"filepath": "src/TextUI/Configuration/Xml/DefaultConfiguration.php",
"language": "php",
"file_size": 5123,
"cut_index": 716,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function str_replace;
/**
* @no-named-arguments Parameter names are ... | location}"
bootstrap="{bootstrap_script}"
cacheDirectory="{cache_directory}"
executionOrder="depends,defects"
requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDurin | /**
* @var string
*/
private const string TEMPLATE = <<<'EOT'
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="{schema_ | {
"filepath": "src/TextUI/Configuration/Xml/Generator.php",
"language": "php",
"file_size": 2236,
"cut_index": 563,
"middle_length": 229
} |
;
use PHPUnit\TextUI\Configuration\IniSetting;
use PHPUnit\TextUI\Configuration\IniSettingCollection;
use PHPUnit\TextUI\Configuration\Php;
use PHPUnit\TextUI\Configuration\Source;
use PHPUnit\TextUI\Configuration\TestDirectory;
use PHPUnit\TextUI\Configuration\TestDirectoryCollection;
use PHPUnit\TextUI\Configuration\... | \TextUI\XmlConfiguration\CodeCoverage\Report\Cobertura;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Crap4j;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Html as CodeCoverageHtml;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Repor | HPUnit\TextUI\Configuration\Variable;
use PHPUnit\TextUI\Configuration\VariableCollection;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Clover;
use PHPUnit | {
"filepath": "src/TextUI/Configuration/Xml/Loader.php",
"language": "php",
"file_size": 54528,
"cut_index": 2151,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use function defined;
use function is_file;
use funct... | lic function available(): array
{
$result = [Version::series()];
foreach ((new DirectoryIterator($this->path() . 'schema')) as $file) {
if ($file->isDot()) {
continue;
}
$version = $ | ility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class SchemaFinder
{
/**
* @return non-empty-list<non-empty-string>
*/
pub | {
"filepath": "src/TextUI/Configuration/Xml/SchemaFinder.php",
"language": "php",
"file_size": 2042,
"cut_index": 563,
"middle_length": 229
} |
n <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use PHPUnit\Util\Xml\XmlException;
/**
* @no-named-arguments Parameter names are not covered by the backward compat... | DetectionResult $this
*/
public function detected(): bool
{
return false;
}
/**
* @throws XmlException
*/
public function version(): string
{
throw new XmlException('No supported schema was detected') | /**
* @phpstan-assert-if-true SuccessfulSchema | {
"filepath": "src/TextUI/Configuration/Xml/SchemaDetector/SchemaDetectionResult.php",
"language": "php",
"file_size": 924,
"cut_index": 606,
"middle_length": 52
} |
hp declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
/**
* @no-named-arguments... | c function __construct(string $version)
{
$this->version = $version;
}
public function detected(): bool
{
return true;
}
/**
* @throws void
*
* @return non-empty-string
*/
public function ve | */
final readonly class SuccessfulSchemaDetectionResult extends SchemaDetectionResult
{
/**
* @var non-empty-string
*/
private string $version;
/**
* @param non-empty-string $version
*/
publi | {
"filepath": "src/TextUI/Configuration/Xml/SchemaDetector/SuccessfulSchemaDetectionResult.php",
"language": "php",
"file_size": 1061,
"cut_index": 515,
"middle_length": 229
} |
es=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
use PHPUnit\TextUI\Configur... | PHPUnit
*
* @immutable
*/
final readonly class Clover
{
private File $target;
public function __construct(File $target)
{
$this->target = $target;
}
public function target(): File
{
return $this->target;
}
} | y promise for | {
"filepath": "src/TextUI/Configuration/Xml/CodeCoverage/Report/Clover.php",
"language": "php",
"file_size": 807,
"cut_index": 536,
"middle_length": 14
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
use PHPUn... | t $threshold
*/
public function __construct(File $target, int $threshold)
{
$this->target = $target;
$this->threshold = $threshold;
}
public function target(): File
{
return $this->target;
}
/** | kward compatibility promise for PHPUnit
*
* @immutable
*/
final readonly class Crap4j
{
private File $target;
/**
* @var non-negative-int
*/
private int $threshold;
/**
* @param non-negative-in | {
"filepath": "src/TextUI/Configuration/Xml/CodeCoverage/Report/Crap4j.php",
"language": "php",
"file_size": 1128,
"cut_index": 518,
"middle_length": 229
} |
es=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
use PHPUnit\TextUI\Configur... | PHPUnit
*
* @immutable
*/
final readonly class OpenClover
{
private File $target;
public function __construct(File $target)
{
$this->target = $target;
}
public function target(): File
{
return $this->target;
| y promise for | {
"filepath": "src/TextUI/Configuration/Xml/CodeCoverage/Report/OpenClover.php",
"language": "php",
"file_size": 811,
"cut_index": 536,
"middle_length": 14
} |
that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use const DIRECTORY_SEPARATOR;
use const PHP_EOL;
use function assert;
use function count;
use function dirname;
use function file;
use function is_dir;
use function is_file;
use function realpath;
use function str_ends_with;
use ... | uments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class TestSuiteBuilder
{
/**
* @throws \PHPUnit | Unit\TextUI\TestDirectoryNotFoundException;
use PHPUnit\TextUI\TestFileNotFoundException;
use PHPUnit\TextUI\XmlConfiguration\TestSuiteMapper;
use SebastianBergmann\FileIterator\Facade as FileIteratorFacade;
/**
* @no-named-arg | {
"filepath": "src/TextUI/Configuration/TestSuiteBuilder.php",
"language": "php",
"file_size": 5895,
"cut_index": 716,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use PHPUnit\TextUI\Configurat... | ion $exclude)
{
$this->include = $include;
$this->exclude = $exclude;
}
public function hasInclude(): bool
{
return !$this->include->isEmpty();
}
public function include(): GroupCollection
{
ret | patibility promise for PHPUnit
*
* @immutable
*/
final readonly class Groups
{
private GroupCollection $include;
private GroupCollection $exclude;
public function __construct(GroupCollection $include, GroupCollect | {
"filepath": "src/TextUI/Configuration/Xml/Groups.php",
"language": "php",
"file_size": 1217,
"cut_index": 518,
"middle_length": 229
} |
layDetailsOnAllIssues;
private bool $displayDetailsOnIncompleteTests;
private bool $displayDetailsOnSkippedTests;
private bool $displayDetailsOnTestsThatTriggerDeprecations;
private bool $displayDetailsOnPhpunitDeprecations;
private bool $displayDetailsOnPhpunitNotices;
private bool $displayDeta... |
private array $bootstrapForTestSuite;
private bool $processIsolation;
private bool $failOnAllIssues;
private bool $failOnDeprecation;
private bool $failOnPhpunitDeprecation;
private bool $failOnPhpunitNotice;
private bool $fail | vate bool $requireCoverageMetadata;
private bool $requireSealedMockObjects;
/**
* @var ?non-empty-string
*/
private ?string $bootstrap;
/**
* @var array<non-empty-string, non-empty-string>
*/ | {
"filepath": "src/TextUI/Configuration/Xml/PHPUnit.php",
"language": "php",
"file_size": 22312,
"cut_index": 1331,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use PHPUnit\Util\Xml\Loader;
... | Loader)->loadFile($filename);
$schemaFinder = new SchemaFinder;
foreach ($schemaFinder->available() as $candidate) {
$schema = (new SchemaFinder)->find($candidate);
if (!(new Validator)->validate($document, $sche | e backward compatibility promise for PHPUnit
*/
final readonly class SchemaDetector
{
/**
* @throws XmlException
*/
public function detect(string $filename): SchemaDetectionResult
{
$document = (new | {
"filepath": "src/TextUI/Configuration/Xml/SchemaDetector/SchemaDetector.php",
"language": "php",
"file_size": 1186,
"cut_index": 518,
"middle_length": 229
} |
es=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
use PHPUnit\TextUI\Configur... | PHPUnit
*
* @immutable
*/
final readonly class Cobertura
{
private File $target;
public function __construct(File $target)
{
$this->target = $target;
}
public function target(): File
{
return $this->target;
| y promise for | {
"filepath": "src/TextUI/Configuration/Xml/CodeCoverage/Report/Cobertura.php",
"language": "php",
"file_size": 810,
"cut_index": 536,
"middle_length": 14
} |
Exception;
use PHPUnit\TextUI\Configuration\NoHtmlCoverageTargetException;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @immutable
*/
final readonly class H... | e string $colorSuccessMedium;
/**
* @var non-empty-string
*/
private string $colorSuccessMediumDark;
/**
* @var non-empty-string
*/
private string $colorSuccessHigh;
/**
* @var non-empty-string
*/
pr | d;
/**
* @var non-empty-string
*/
private string $colorSuccessLow;
/**
* @var non-empty-string
*/
private string $colorSuccessLowDark;
/**
* @var non-empty-string
*/
privat | {
"filepath": "src/TextUI/Configuration/Xml/CodeCoverage/Report/Html.php",
"language": "php",
"file_size": 9341,
"cut_index": 921,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use PHPUnit\TextUI\Configuration\ExtensionBootstrapCollection;
use PHPUnit... | romise for PHPUnit
*
* @immutable
*/
final readonly class LoadedFromFileConfiguration extends Configuration
{
/**
* @var non-empty-string
*/
private string $filename;
private ValidationResult $validationResult;
/**
* @par | Unit\TextUI\XmlConfiguration\Logging\Logging;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility p | {
"filepath": "src/TextUI/Configuration/Xml/LoadedFromFileConfiguration.php",
"language": "php",
"file_size": 2133,
"cut_index": 563,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Clover;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Cobertura;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Crap4j;
use PHPUnit\TextUI\... | patibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @immutable
*/
final readonly class CodeCoverage
{
private bool $pathCoverage;
private bool $branchCoverage;
privat | mlConfiguration\CodeCoverage\Report\Text;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Xml;
use PHPUnit\TextUI\XmlConfiguration\Exception;
/**
* @no-named-arguments Parameter names are not covered by the backward com | {
"filepath": "src/TextUI/Configuration/Xml/CodeCoverage/CodeCoverage.php",
"language": "php",
"file_size": 6674,
"cut_index": 716,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use PHPUnit\TextUI\Configuration\ExtensionBootstrapCollection;
use PHPUnit... | romise for PHPUnit
*
* @immutable
*/
abstract readonly class Configuration
{
private ExtensionBootstrapCollection $extensions;
private Source $source;
private CodeCoverage $codeCoverage;
private Groups $groups;
private Logging $loggi | Unit\TextUI\XmlConfiguration\Logging\Logging;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility p | {
"filepath": "src/TextUI/Configuration/Xml/Configuration.php",
"language": "php",
"file_size": 2712,
"cut_index": 563,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use const PHP_VERSION;
use function in_array;
use function is_dir;
use function is_file;
use function sprintf;
use function str_contains;
use function version_compare;
use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Framew... | PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class TestSuiteMapper
{
/**
* @param non-empty-string $xmlConfigurationFile
* @param list<non-empty-string> $include | TextUI\TestDirectoryNotFoundException;
use PHPUnit\TextUI\TestFileNotFoundException;
use SebastianBergmann\FileIterator\Facade;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for | {
"filepath": "src/TextUI/Configuration/Xml/TestSuiteMapper.php",
"language": "php",
"file_size": 5606,
"cut_index": 716,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
use PHPUn... | rget, bool $showUncoveredFiles, bool $showOnlySummary)
{
$this->target = $target;
$this->showUncoveredFiles = $showUncoveredFiles;
$this->showOnlySummary = $showOnlySummary;
}
public function target(): Fi | kward compatibility promise for PHPUnit
*
* @immutable
*/
final readonly class Text
{
private File $target;
private bool $showUncoveredFiles;
private bool $showOnlySummary;
public function __construct(File $ta | {
"filepath": "src/TextUI/Configuration/Xml/CodeCoverage/Report/Text.php",
"language": "php",
"file_size": 1248,
"cut_index": 518,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use const PHP_EOL;
use function sprintf;
use fun... | LError> $errors
*/
public static function fromArray(array $errors): self
{
$validationErrors = [];
foreach ($errors as $error) {
if (!isset($validationErrors[$error->line])) {
$validationErrors[$err | ward compatibility promise for PHPUnit
*
* @immutable
*/
final readonly class ValidationResult
{
/**
* @var array<int, list<string>>
*/
private array $validationErrors;
/**
* @param array<int, LibXM | {
"filepath": "src/TextUI/Configuration/Xml/Validator/ValidationResult.php",
"language": "php",
"file_size": 1912,
"cut_index": 537,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function version_compare;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promi... | s,
IntroduceCoverageElement::class,
MoveAttributesFromRootToCoverage::class,
MoveAttributesFromFilterWhitelistToCoverage::class,
MoveWhitelistIncludesToCoverage::class,
MoveWhitelistExcludesToCove | mpty-string, non-empty-list<class-string>>
*/
private const array AVAILABLE_MIGRATIONS = [
'8.5' => [
RemoveLogTypes::class,
],
'9.2' => [
RemoveCacheTokensAttribute::clas | {
"filepath": "src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php",
"language": "php",
"file_size": 3655,
"cut_index": 614,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use function str_contains;
use DOMDocument;
use DOMEl... | * @throws XmlException
*/
public function migrate(string $filename): string
{
$origin = (new SchemaDetector)->detect($filename);
if (!$origin->detected()) {
throw new Exception('The file does not validate against | atibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class Migrator
{
/**
* @throws Exception
* @throws MigrationException
| {
"filepath": "src/TextUI/Configuration/Xml/Migration/Migrator.php",
"language": "php",
"file_size": 2405,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use DOMDocument;
use DOMEle... | $logging instanceof DOMElement) {
return;
}
$types = [
'junit' => 'junit',
'teamcity' => 'teamcity',
'testdox-html' => 'testdoxHtml',
'testdox-text' => 'testdoxText',
| ise for PHPUnit
*/
final readonly class ConvertLogTypes implements Migration
{
public function migrate(DOMDocument $document): void
{
$logging = $document->getElementsByTagName('logging')->item(0);
if (! | {
"filepath": "src/TextUI/Configuration/Xml/Migration/Migrations/ConvertLogTypes.php",
"language": "php",
"file_size": 1788,
"cut_index": 537,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use DOME... | $logNode): DOMElement
{
$ownerDocument = $logNode->ownerDocument;
assert($ownerDocument !== null);
$html = $ownerDocument->createElement('html');
$html->setAttribute('outputDirectory', $logNode->getAttribute('target') | omise for PHPUnit
*/
final readonly class CoverageHtmlToReport extends LogToReportMigration
{
protected function forType(): string
{
return 'coverage-html';
}
protected function toReportFormat(DOMElement | {
"filepath": "src/TextUI/Configuration/Xml/Migration/Migrations/CoverageHtmlToReport.php",
"language": "php",
"file_size": 1126,
"cut_index": 518,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use DOME... | $logNode): DOMElement
{
$ownerDocument = $logNode->ownerDocument;
assert($ownerDocument !== null);
$text = $ownerDocument->createElement('text');
$text->setAttribute('outputFile', $logNode->getAttribute('target'));
| omise for PHPUnit
*/
final readonly class CoverageTextToReport extends LogToReportMigration
{
protected function forType(): string
{
return 'coverage-text';
}
protected function toReportFormat(DOMElement | {
"filepath": "src/TextUI/Configuration/Xml/Migration/Migrations/CoverageTextToReport.php",
"language": "php",
"file_size": 1127,
"cut_index": 518,
"middle_length": 229
} |
n <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use DOMDocument;
use DOMElement;
/**
* @no-named-arguments Parameter names are not covered by ... | ate(DOMDocument $document): void
{
$root = $document->documentElement;
assert($root instanceof DOMElement);
if ($root->hasAttribute('cacheDirectory')) {
return;
}
$root->setAttribute('cacheDirector | bute implements Migration
{
public function migr | {
"filepath": "src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCacheDirectoryAttribute.php",
"language": "php",
"file_size": 945,
"cut_index": 606,
"middle_length": 52
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use function sprintf;
use DOMDocument;
use DOMElement... | = $document->getElementsByTagName('coverage')->item(0);
if (!$coverage instanceof DOMElement) {
throw new MigrationException('Unexpected state - No coverage element');
}
$logNode = $this->findLogNode($document);
| ility promise for PHPUnit
*/
abstract readonly class LogToReportMigration implements Migration
{
/**
* @throws MigrationException
*/
public function migrate(DOMDocument $document): void
{
$coverage | {
"filepath": "src/TextUI/Configuration/Xml/Migration/Migrations/LogToReportMigration.php",
"language": "php",
"file_size": 2559,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use DOMDocument;
use DOMEle... | 'disableCodeCoverageIgnore' => 'disableCodeCoverageIgnore',
'ignoreDeprecatedCodeUnitsFromCodeCoverage' => 'ignoreDeprecatedCodeUnits',
];
$root = $document->documentElement;
assert($root inst | ise for PHPUnit
*/
final readonly class MoveAttributesFromRootToCoverage implements Migration
{
/**
* @throws MigrationException
*/
public function migrate(DOMDocument $document): void
{
$map = [
| {
"filepath": "src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromRootToCoverage.php",
"language": "php",
"file_size": 1519,
"cut_index": 537,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use function in_array;
use DOMDocument;
use DOMElemen... | ocument->getElementsByTagName('whitelist')->item(0);
if ($whitelist === null) {
return;
}
$excludeNodes = SnapshotNodeList::fromNodeList($whitelist->getElementsByTagName('exclude'));
if ($excludeNodes->count() | for PHPUnit
*/
final readonly class MoveWhitelistExcludesToCoverage implements Migration
{
/**
* @throws MigrationException
*/
public function migrate(DOMDocument $document): void
{
$whitelist = $d | {
"filepath": "src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistExcludesToCoverage.php",
"language": "php",
"file_size": 2234,
"cut_index": 563,
"middle_length": 229
} |
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
use... | ource)
{
$this->target = $target;
$this->includeSource = $includeSource;
}
public function target(): Directory
{
return $this->target;
}
public function includeSource(): bool
{
return $th | by the backward compatibility promise for PHPUnit
*
* @immutable
*/
final readonly class Xml
{
private Directory $target;
private bool $includeSource;
public function __construct(Directory $target, bool $includeS | {
"filepath": "src/TextUI/Configuration/Xml/CodeCoverage/Report/Xml.php",
"language": "php",
"file_size": 1024,
"cut_index": 512,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
use func... | cument $document, string $xsdFilename): ValidationResult
{
$buffer = file_get_contents($xsdFilename);
assert($buffer !== false);
$originalErrorHandling = libxml_use_internal_errors(true);
$document->schemaValidateSour | are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class Validator
{
public function validate(DOMDo | {
"filepath": "src/TextUI/Configuration/Xml/Validator/Validator.php",
"language": "php",
"file_size": 1209,
"cut_index": 518,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function count;
use ArrayIterat... | * @var list<DOMNode>
*/
private array $nodes = [];
/**
* @param DOMNodeList<DOMNode> $list
*/
public static function fromNodeList(DOMNodeList $list): self
{
$snapshot = new self;
foreach ($list as $node) {
| ernal This class is not covered by the backward compatibility promise for PHPUnit
*
* @template-implements IteratorAggregate<int, DOMNode>
*/
final class SnapshotNodeList implements Countable, IteratorAggregate
{
/**
| {
"filepath": "src/TextUI/Configuration/Xml/Migration/SnapshotNodeList.php",
"language": "php",
"file_size": 1344,
"cut_index": 524,
"middle_length": 229
} |
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function assert;
us... | ment $logNode): DOMElement
{
$ownerDocument = $logNode->ownerDocument;
assert($ownerDocument !== null);
$php = $ownerDocument->createElement('php');
$php->setAttribute('outputFile', $logNode->getAttribute('target'));
| ity promise for PHPUnit
*/
final readonly class CoveragePhpToReport extends LogToReportMigration
{
protected function forType(): string
{
return 'coverage-php';
}
protected function toReportFormat(DOMEle | {
"filepath": "src/TextUI/Configuration/Xml/Migration/Migrations/CoveragePhpToReport.php",
"language": "php",
"file_size": 1026,
"cut_index": 512,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.